summaryrefslogtreecommitdiff
path: root/.gitlab/ci/rails.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci/rails.gitlab-ci.yml')
-rw-r--r--.gitlab/ci/rails.gitlab-ci.yml80
1 files changed, 60 insertions, 20 deletions
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml
index e8087aebcef..f73e0c1d503 100644
--- a/.gitlab/ci/rails.gitlab-ci.yml
+++ b/.gitlab/ci/rails.gitlab-ci.yml
@@ -1,6 +1,3 @@
-.rails:needs:setup-and-assets:
- needs: ["setup-test-env", "compile-assets pull-cache"]
-
.rails-job-base:
extends:
- .default-retry
@@ -35,32 +32,54 @@ setup-test-env:
- tmp/tests/repositories
- tmp/tests/second_storage
when: always
+
+update-rails-cache:
+ extends:
+ - setup-test-env
+ - .shared:rules:update-cache
+ artifacts: {} # This job's purpose is only to update the cache.
+ cache:
+ policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
+
+.static-analysis-base:
+ extends:
+ - .default-retry
+ - .default-before_script
+ - .static-analysis-cache
+ needs: []
+ variables:
+ SETUP_DB: "false"
+ ENABLE_SPRING: "1"
+
+update-static-analysis-cache:
+ extends:
+ - .static-analysis-base
+ - .shared:rules:update-cache
+ stage: prepare
+ script:
+ - rm -rf ./node_modules # We remove node_modules because there's no mechanism to remove stall entries.
+ - run_timed_command "retry yarn install --frozen-lockfile"
+ - bundle exec rubocop --parallel # For the moment we only cache `vendor/ruby/`, `node_modules/`, and `tmp/rubocop_cache` so we don't need to run all the tasks,
cache:
+ # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up but RuboCop has a mechanism
+ # for keeping only the N latest cache files, so we take advantage of it with `pull-push` and removing `node_modules` at the start of the job.
policy: pull-push
static-analysis:
extends:
- - .rails-job-base
+ - .static-analysis-base
- .rails:rules:default-refs-code-backstage-qa
- - .rails:needs:setup-and-assets
stage: test
- variables:
- SETUP_DB: "false"
- parallel: 2
+ parallel: 4
script:
+ - run_timed_command "retry yarn install --frozen-lockfile"
- scripts/static-analysis
- cache:
- key: "ruby-2.6.6-pg11-rubocop"
- paths:
- - vendor/ruby
- - tmp/rubocop_cache
- policy: pull-push
downtime_check:
extends:
- .rails-job-base
- .rails:rules:downtime_check
- needs: ["setup-test-env"]
+ needs: []
stage: test
variables:
SETUP_DB: "false"
@@ -70,7 +89,7 @@ downtime_check:
.rspec-base:
extends: .rails-job-base
stage: test
- needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache"]
+ needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets"]
script:
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
@@ -173,7 +192,7 @@ db:migrate-from-v12.10.0:
db:rollback:
extends: .db-job-base
script:
- - bundle exec rake db:migrate VERSION=20180101160629
+ - bundle exec rake db:migrate VERSION=20181228175414
- bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true
gitlab:setup:
@@ -218,8 +237,6 @@ rspec:coverage:
- memory-on-boot
variables:
SETUP_DB: "false"
- cache:
- policy: pull
script:
- bundle exec scripts/merge-simplecov
- bundle exec scripts/gather-test-memory-data
@@ -247,7 +264,7 @@ rspec:coverage:
- .rails:rules:as-if-foss
- .as-if-foss
- .use-pg11
- needs: ["setup-test-env", "retrieve-tests-metadata", "compile-assets pull-cache as-if-foss"]
+ needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss"]
.rspec-ee-base-pg11:
extends:
@@ -323,3 +340,26 @@ db:rollback geo:
- bundle exec rake geo:db:migrate
# EE: default refs (MRs, master, schedules) jobs #
##################################################
+
+##################################################
+# EE: Canonical MR pipelines
+rspec foss-impact:
+ extends:
+ - .rspec-base
+ - .as-if-foss
+ - .rails:rules:ee-mr-only
+ - .use-pg11
+ script:
+ - install_gitlab_gem
+ - run_timed_command "scripts/gitaly-test-build"
+ - run_timed_command "scripts/gitaly-test-spawn"
+ - source scripts/rspec_helpers.sh
+ - tooling/bin/find_foss_tests tmp/matching_foss_tests.txt
+ - rspec_matched_tests tmp/matching_foss_tests.txt "--tag ~quarantine --tag ~geo --tag ~level:migration"
+ artifacts:
+ expire_in: 7d
+ paths:
+ - tmp/matching_foss_tests.txt
+ - tmp/capybara/
+# EE: Merge Request pipelines
+##################################################