<commit_before>image: registry.gitlab.com/welaika/<%= app_name %>

variables:
  GET_SOURCES_ATTEMPTS: 3
  ARTIFACT_DOWNLOAD_ATTEMPTS: 3
  RESTORE_CACHE_ATTEMPTS: 3
  POSTGRES_DB: rails_app_test
  POSTGRES_USER: root
  POSTGRES_PASSWORD: ''

.job-creation-policy: &job-creation-policy
  only:
    - master
    - merge_requests
  except:
    - staging

.services: &rails-services
  - postgres:<%= Suspenders::POSTGRES_VERSION %>

.cache: &cache-settings
  key: "$CI_COMMIT_REF_SLUG"
  untracked: true
  policy: pull
  paths:
    - vendor/bundle

stages:
  - setup
  - quality
  - test

prepare:
  <<: *job-creation-policy
  stage: setup
  cache:
    <<: *cache-settings
    policy: pull-push
  script:
    - bundle install --retry 3 --deployment --jobs $(nproc)

quality:rubocop:
  <<: *job-creation-policy
  stage: quality
  cache:
    <<: *cache-settings
  script:
    - bundle check --path vendor/bundle
    - bundle exec rubocop

quality:sasslint:
  <<: *job-creation-policy
  stage: quality
  cache:
    <<: *cache-settings
  script:
    - npx stylelint app/assets/stylesheets

quality:slim_lint:
  <<: *job-creation-policy
  stage: quality
  cache:
    <<: *cache-settings
  script:
    - bundle check --path vendor/bundle
    - bundle exec slim-lint app/views/<commit_msg>Fix typo<commit_after>image: registry.gitlab.com/welaika/<%= app_name %>

variables:
  GET_SOURCES_ATTEMPTS: 3
  ARTIFACT_DOWNLOAD_ATTEMPTS: 3
  RESTORE_CACHE_ATTEMPTS: 3
  POSTGRES_DB: rails_app_test
  POSTGRES_USER: root
  POSTGRES_PASSWORD: ''

.job-creation-policy: &job-creation-policy
  only:
    - master
    - merge_requests
  except:
    - staging

.services: &rails-services
  - postgres:<%= Suspenders::POSTGRES_VERSION %>

.cache: &cache-settings
  key: "$CI_COMMIT_REF_SLUG"
  untracked: true
  policy: pull
  paths:
    - vendor/bundle

stages:
  - setup
  - quality
  - test

prepare:
  <<: *job-creation-policy
  stage: setup
  cache:
    <<: *cache-settings
    policy: pull-push
  script:
    - bundle install --retry 3 --deployment --jobs $(nproc)

quality:rubocop:
  <<: *job-creation-policy
  stage: quality
  cache:
    <<: *cache-settings
  script:
    - bundle check --path vendor/bundle
    - bundle exec rubocop

quality:stylelint:
  <<: *job-creation-policy
  stage: quality
  cache:
    <<: *cache-settings
  script:
    - npx stylelint app/assets/stylesheets

quality:slim_lint:
  <<: *job-creation-policy
  stage: quality
  cache:
    <<: *cache-settings
  script:
    - bundle check --path vendor/bundle
    - bundle exec slim-lint app/views/
{'fraction_non_alphanumeric': 0.12156862745098039, 'fraction_numerical': 0.003137254901960784, 'mean_word_length': 3.1012861736334405, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1048175', 'n_tokens_mistral': 970, 'n_tokens_neox': 919, 'n_words': 190}