Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ variables:
- bundle check || bundle install --deployment --jobs=4 --retry=3 --without deploy development doc production --path vendor/ruby

.yarn_install: &yarn_install
- yarn install --ignore-engines --cache-folder .yarn-cache
- yarn install --frozen-lockfile --ignore-engines --cache-folder .yarn-cache

.yarn_production_install: &yarn_production_install
- yarn install --production --frozen-lockfile --ignore-engines --cache-folder .yarn-cache

cache:
- &ruby_cache
Expand All @@ -31,9 +34,19 @@ cache:
- .yarn-cache/
policy: pull

- &yarn_production_cache
key:
files:
- yarn.lock
paths:
- .yarn-cache/
policy: pull

- &assets_cache
key: $CI_COMMIT_SHA
paths:
- tmp/cache/webpacker/last-compilation-digest-test
- tmp/cache/assets
- public/assets
- public/packs
- public/packs-test
Expand Down Expand Up @@ -93,6 +106,7 @@ specs:
AWS_SECRET_ACCESS_KEY: test
CAPYBARA_WAIT_TIME_SECONDS: 5
COVERAGE: 'true'
DOCKER_DB_HOST: postgres
POSTGRES_DB: upaya_test
POSTGRES_USER: postgres_user
POSTGRES_PASSWORD: postgres_password
Expand Down Expand Up @@ -124,12 +138,24 @@ specs:
- cp -a keys.example keys
- cp -a certs.example certs
- cp pwned_passwords/pwned_passwords.txt.sample pwned_passwords/pwned_passwords.txt
- "echo -e \"test:\n redis_url: 'redis://redis:6379/0'\n redis_throttle_url: 'redis://localhost:6379/1'\" > config/application.yml"
- bundle exec rake db:create db:migrate --trace
- bundle exec rake db:seed
- >
ruby -i -pe 'gsub(/^(\s+)compile: true$/, "\\1compile: false")' config/webpacker.yml
- bundle exec rake knapsack:rspec

js_build:
extends: .on_push
stage: test
cache:
- <<: *ruby_cache
- <<: *yarn_production_cache
script:
- *bundle_install
- *yarn_production_install
- bundle exec rake assets:precompile

js_tests:
extends: .on_push
stage: test
Expand Down