From 19d37ed95407b4d1f2fb3ee96ae7c0ff4ddba3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= <remy@rymai.me> Date: Tue, 4 Jul 2023 21:09:03 +0200 Subject: [PATCH] ci: Streamline internal gems CI config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable <remy@rymai.me> --- .gitlab/ci/rules.gitlab-ci.yml | 101 ------------ .gitlab/ci/templates/gem.gitlab-ci.yml | 14 +- .gitlab/ci/vendored-gems.gitlab-ci.yml | 156 ++++++------------ gems/gem.gitlab-ci.yml | 46 ++++-- vendor/gems/attr_encrypted/.gitlab-ci.yml | 26 +-- vendor/gems/bundler-checksum/.gitlab-ci.yml | 26 +-- .../gems/cloud_profiler_agent/.gitlab-ci.yml | 37 +---- .../devise-pbkdf2-encryptable/.gitlab-ci.yml | 33 +--- .../gems/gitlab_active_record/.gitlab-ci.yml | 33 +--- vendor/gems/ipynbdiff/.gitlab-ci.yml | 42 +---- vendor/gems/mail-smtp_pool/.gitlab-ci.yml | 36 +--- .../microsoft_graph_mailer/.gitlab-ci.yml | 37 +---- .../gems/omniauth-azure-oauth2/.gitlab-ci.yml | 41 +---- vendor/gems/omniauth-gitlab/.gitlab-ci.yml | 41 +---- .../gems/omniauth-salesforce/.gitlab-ci.yml | 41 +---- vendor/gems/omniauth_crowd/.gitlab-ci.yml | 41 +---- .../sidekiq-reliable-fetch/.gitlab-ci.yml | 83 ++++------ 17 files changed, 202 insertions(+), 632 deletions(-) diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 1f6858020a07b..2c833f0d65b32 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -2136,107 +2136,6 @@ - <<: *if-merge-request changes: *code-backstage-qa-patterns -######################## -# GitLab monorepo gems # -######################## - -.gems:rules:activerecord-gitlab: - rules: - - <<: *if-merge-request - changes: ["gems/activerecord-gitlab/**/*"] - -.gems:rules:gitlab-rspec: - rules: - - <<: *if-merge-request - changes: ["gems/gitlab-rspec/**/*"] - -.gems:rules:gitlab-utils: - rules: - - <<: *if-merge-request - changes: ["gems/gitlab-utils/**/*"] - -####################### -# Vendored gems rules # -####################### - -.vendor:rules:mail-smtp_pool: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/mail-smtp_pool/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:attr_encrypted: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/attr_encrypted/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:microsoft_graph_mailer: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/microsoft_graph_mailer/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:ipynbdiff: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/ipynbdiff/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:omniauth-azure-oauth2: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/omniauth-azure-oauth2/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:omniauth_crowd: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/omniauth_crowd/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:omniauth-gitlab: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/omniauth-gitlab/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:omniauth-salesforce: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/omniauth-salesforce/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:devise-pbkdf2-encryptable: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/devise-pbkdf2-encryptable/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:gitlab_active_record: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/gitlab_active_record/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:bundler-checksum: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/bundler-checksum/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:cloud_profiler_agent: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/cloud_profiler_agent/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - -.vendor:rules:sidekiq-reliable-fetch: - rules: - - <<: *if-merge-request - changes: ["vendor/gems/sidekiq-reliable-fetch/**/*"] - - <<: *if-merge-request-labels-run-all-rspec - ################## # Releases rules # ################## diff --git a/.gitlab/ci/templates/gem.gitlab-ci.yml b/.gitlab/ci/templates/gem.gitlab-ci.yml index c5b1a1ecf45bf..1f995e8040f8c 100644 --- a/.gitlab/ci/templates/gem.gitlab-ci.yml +++ b/.gitlab/ci/templates/gem.gitlab-ci.yml @@ -2,18 +2,26 @@ # # Inputs: # - `gem_name`: The name of the gem, i.e. if the gem is located at `gems/gitlab-rspec`, `gem_name` should be set to `gitlab-rspec`. +# - `gem_path_prefix`: The prefix of the gem path, i.e. if the gem is located at `vendor/gems/gitlab-rspec`, `gem_path_prefix` should be set to `vendor/gems/`. Defaults to `gems/`. spec: inputs: gem_name: + gem_path_prefix: + default: "gems/" --- .gems:rules:$[[inputs.gem_name]]: rules: - if: '$CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached"' - changes: ["gems/$[[inputs.gem_name]]/**/*"] + changes: + - "$[[inputs.gem_path_prefix]]$[[inputs.gem_name]]/**/*" + - ".gitlab/ci/templates/gem.gitlab-ci.yml" + - "gems/gem.gitlab-ci.yml" gems $[[inputs.gem_name]]: - extends: .gems:rules:$[[inputs.gem_name]] + extends: ".gems:rules:$[[inputs.gem_name]]" needs: [] trigger: - include: gems/$[[inputs.gem_name]]/.gitlab-ci.yml + include: "$[[inputs.gem_path_prefix]]$[[inputs.gem_name]]/.gitlab-ci.yml" strategy: depend + inherit: + variables: false diff --git a/.gitlab/ci/vendored-gems.gitlab-ci.yml b/.gitlab/ci/vendored-gems.gitlab-ci.yml index 3773a343d6d63..3c9dadb83322d 100644 --- a/.gitlab/ci/vendored-gems.gitlab-ci.yml +++ b/.gitlab/ci/vendored-gems.gitlab-ci.yml @@ -1,103 +1,53 @@ -vendor mail-smtp_pool: - extends: - - .vendor:rules:mail-smtp_pool - needs: [] - trigger: - include: vendor/gems/mail-smtp_pool/.gitlab-ci.yml - strategy: depend - -vendor attr_encrypted: - extends: - - .vendor:rules:attr_encrypted - needs: [] - trigger: - include: vendor/gems/attr_encrypted/.gitlab-ci.yml - strategy: depend - -vendor microsoft_graph_mailer: - extends: - - .vendor:rules:microsoft_graph_mailer - needs: [] - trigger: - include: vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml - strategy: depend - -vendor ipynbdiff: - extends: - - .vendor:rules:ipynbdiff - needs: [] - trigger: - include: vendor/gems/ipynbdiff/.gitlab-ci.yml - strategy: depend - -vendor omniauth-azure-oauth2: - extends: - - .vendor:rules:omniauth-azure-oauth2 - needs: [] - trigger: - include: vendor/gems/omniauth-azure-oauth2/.gitlab-ci.yml - strategy: depend - -vendor omniauth_crowd: - extends: - - .vendor:rules:omniauth_crowd - needs: [] - trigger: - include: vendor/gems/omniauth_crowd/.gitlab-ci.yml - strategy: depend - -vendor omniauth-gitlab: - extends: - - .vendor:rules:omniauth-gitlab - needs: [] - trigger: - include: vendor/gems/omniauth-gitlab/.gitlab-ci.yml - strategy: depend - -vendor omniauth-salesforce: - extends: - - .vendor:rules:omniauth-salesforce - needs: [] - trigger: - include: vendor/gems/omniauth-salesforce/.gitlab-ci.yml - strategy: depend - -vendor devise-pbkdf2-encryptable: - extends: - - .vendor:rules:devise-pbkdf2-encryptable - needs: [] - trigger: - include: vendor/gems/devise-pbkdf2-encryptable/.gitlab-ci.yml - strategy: depend - -vendor bundler-checksum: - extends: - - .vendor:rules:bundler-checksum - needs: [] - trigger: - include: vendor/gems/bundler-checksum/.gitlab-ci.yml - strategy: depend - -vendor gitlab_active_record: - extends: - - .vendor:rules:gitlab_active_record - needs: [] - trigger: - include: vendor/gems/gitlab_active_record/.gitlab-ci.yml - strategy: depend - -vendor cloud_profiler_agent: - extends: - - .vendor:rules:cloud_profiler_agent - needs: [] - trigger: - include: vendor/gems/cloud_profiler_agent/.gitlab-ci.yml - strategy: depend - -vendor sidekiq-reliable-fetch: - extends: - - .vendor:rules:sidekiq-reliable-fetch - needs: [] - trigger: - include: vendor/gems/sidekiq-reliable-fetch/.gitlab-ci.yml - strategy: depend +include: + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "mail-smtp_pool" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "attr_encrypted" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "microsoft_graph_mailer" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "ipynbdiff" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "omniauth-azure-oauth2" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "omniauth_crowd" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "omniauth-gitlab" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "omniauth-salesforce" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "devise-pbkdf2-encryptable" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "bundler-checksum" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "gitlab_active_record" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "cloud_profiler_agent" + gem_path_prefix: "vendor/gems/" + - local: .gitlab/ci/templates/gem.gitlab-ci.yml + inputs: + gem_name: "sidekiq-reliable-fetch" + gem_path_prefix: "vendor/gems/" diff --git a/gems/gem.gitlab-ci.yml b/gems/gem.gitlab-ci.yml index 63be78c6edbe9..8a0518fa41514 100644 --- a/gems/gem.gitlab-ci.yml +++ b/gems/gem.gitlab-ci.yml @@ -2,40 +2,64 @@ # # Inputs # - `gem_name`: The name of the gem, i.e. if the gem is located at `gems/gitlab-rspec`, `gem_name` should be set to `gitlab-rspec`. +# - `gem_path_prefix`: The prefix of the gem path, i.e. if the gem is located at `vendor/gems/gitlab-rspec`, `gem_path_prefix` should be set to `vendor/gems/`. Defaults to `gems/`. spec: inputs: gem_name: + gem_path_prefix: + default: "gems/" --- workflow: + name: '$PIPELINE_NAME' rules: - if: $CI_MERGE_REQUEST_ID + variables: + PIPELINE_NAME: '[$[[inputs.gem_name]] gem] Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline' + +variables: + GIT_DEPTH: "20" + # 'GIT_STRATEGY: clone' optimizes the pack-objects cache hit ratio + GIT_STRATEGY: "clone" + GIT_SUBMODULE_STRATEGY: "none" + GET_SOURCES_ATTEMPTS: "3" + # Default Ruby version for jobs that don't use .ruby_matrix + RUBY_VERSION: "3.1" default: image: "ruby:${RUBY_VERSION}" cache: key: "$[[inputs.gem_name]]-${RUBY_VERSION}" paths: - - "gems/$[[inputs.gem_name]]/vendor/ruby" + - "$[[inputs.gem_path_prefix]]$[[inputs.gem_name]]/vendor/ruby" before_script: - - cd gems/$[[inputs.gem_name]] + - cd $[[inputs.gem_path_prefix]]$[[inputs.gem_name]] - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image + - bundle_version=$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1 | sed -e 's/[[:space:]]//') + - gem install bundler --version $bundle_version --no-document # Bundler is not installed with the image - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - bundle config # Show bundler configuration - - bundle install -j $(nproc) + - bundle install --jobs=$(nproc) --retry=3 -rubocop: - script: - - bundle exec rubocop --config .rubocop.yml +.ruby_matrix: parallel: matrix: - RUBY_VERSION: ["3.0", "3.1", "3.2"] +rubocop: + extends: .ruby_matrix + rules: + - exists: ["$[[inputs.gem_path_prefix]]$[[inputs.gem_name]]/.rubocop.yml"] + script: + - bundle exec rubocop --config .rubocop.yml + rspec: + extends: .ruby_matrix script: - bundle exec rspec - parallel: - matrix: - - RUBY_VERSION: ["3.0", "3.1", "3.2"] + coverage: '/LOC \((\d+\.\d+%)\) covered.$/' + artifacts: + expire_in: 31d + when: always + paths: + - coverage/ diff --git a/vendor/gems/attr_encrypted/.gitlab-ci.yml b/vendor/gems/attr_encrypted/.gitlab-ci.yml index 7d954de43a004..c285eef6e6472 100644 --- a/vendor/gems/attr_encrypted/.gitlab-ci.yml +++ b/vendor/gems/attr_encrypted/.gitlab-ci.yml @@ -1,26 +1,12 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -default: - image: "ruby:${RUBY_VERSION}" +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "attr_encrypted" + gem_path_prefix: "vendor/gems/" rspec: - cache: - key: attr_encrypted-ruby - paths: - - vendor/gems/attr_encrypted/vendor/ruby - before_script: - - cd vendor/gems/attr_encrypted - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' # This is set to 'deployment' otherwise - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) script: - bundle exec rake test parallel: matrix: - - RUBY_VERSION: ["2.7", "3.0", "3.1"] + - RUBY_VERSION: ["3.0", "3.1"] # 3.2 isn't supported yet diff --git a/vendor/gems/bundler-checksum/.gitlab-ci.yml b/vendor/gems/bundler-checksum/.gitlab-ci.yml index 2de1c5e982cf1..0ec9a5d94f15f 100644 --- a/vendor/gems/bundler-checksum/.gitlab-ci.yml +++ b/vendor/gems/bundler-checksum/.gitlab-ci.yml @@ -1,24 +1,10 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "bundler-checksum" + gem_path_prefix: "vendor/gems/" rspec: - image: "ruby:${RUBY_VERSION}" - cache: - key: bundler-checksum - paths: - - vendor/gems/bundler-checksum/vendor/ruby - before_script: - - cd vendor/gems/bundler-checksum - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) + extends: .ruby_matrix script: - pushd test/project_with_checksum_lock && scripts/test - parallel: - matrix: - - RUBY_VERSION: ["2.7", "3.0", "3.1", "3.2"] diff --git a/vendor/gems/cloud_profiler_agent/.gitlab-ci.yml b/vendor/gems/cloud_profiler_agent/.gitlab-ci.yml index 9e508d920e89a..aa4638486e50e 100644 --- a/vendor/gems/cloud_profiler_agent/.gitlab-ci.yml +++ b/vendor/gems/cloud_profiler_agent/.gitlab-ci.yml @@ -1,32 +1,5 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -.rspec: - cache: - key: cloud_profiler_agent-ruby-${RUBY_VERSION} - paths: - - vendor/gems/cloud_profiler_agent/vendor/ruby - before_script: - - cd vendor/gems/cloud_profiler_agent - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec - -rspec-3.1: - image: "ruby:3.1" - extends: .rspec - -rspec-3.2: - image: "ruby:3.2" - extends: .rspec +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "cloud_profiler_agent" + gem_path_prefix: "vendor/gems/" diff --git a/vendor/gems/devise-pbkdf2-encryptable/.gitlab-ci.yml b/vendor/gems/devise-pbkdf2-encryptable/.gitlab-ci.yml index ed5e27f5a8cdb..c8698943ca974 100644 --- a/vendor/gems/devise-pbkdf2-encryptable/.gitlab-ci.yml +++ b/vendor/gems/devise-pbkdf2-encryptable/.gitlab-ci.yml @@ -1,28 +1,5 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -.rspec: - cache: - key: devise-pbkdf2-encryptable - paths: - - vendor/gems/devise-pbkdf2-encryptable/vendor/ruby - before_script: - - cd vendor/gems/devise-pbkdf2-encryptable - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "devise-pbkdf2-encryptable" + gem_path_prefix: "vendor/gems/" diff --git a/vendor/gems/gitlab_active_record/.gitlab-ci.yml b/vendor/gems/gitlab_active_record/.gitlab-ci.yml index a1e883119e885..a9bc04659d775 100644 --- a/vendor/gems/gitlab_active_record/.gitlab-ci.yml +++ b/vendor/gems/gitlab_active_record/.gitlab-ci.yml @@ -1,28 +1,5 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -.rspec: - cache: - key: gitlab_active_record-ruby - paths: - - vendor/gems/gitlab_active_record/vendor/ruby - before_script: - - cd vendor/gems/gitlab_active_record - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "gitlab_active_record" + gem_path_prefix: "vendor/gems/" diff --git a/vendor/gems/ipynbdiff/.gitlab-ci.yml b/vendor/gems/ipynbdiff/.gitlab-ci.yml index bf8f8b15c2623..dd8f61050bb82 100644 --- a/vendor/gems/ipynbdiff/.gitlab-ci.yml +++ b/vendor/gems/ipynbdiff/.gitlab-ci.yml @@ -1,34 +1,10 @@ -# You can override the included template(s) by including variable overrides -# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings -# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings -# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings -# Note that environment variables can be set in several places -# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "ipynbdiff" + gem_path_prefix: "vendor/gems/" -.rspec: - cache: - key: ipynbdiff - paths: - - vendor/gems/ipynbdiff/vendor/ruby - before_script: - - cd vendor/gems/ipynbdiff - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec +rspec: + parallel: + matrix: + - RUBY_VERSION: ["3.0", "3.1"] # 3.2 isn't supported yet diff --git a/vendor/gems/mail-smtp_pool/.gitlab-ci.yml b/vendor/gems/mail-smtp_pool/.gitlab-ci.yml index dee865f3cd6c8..260bc1aaa1fe1 100644 --- a/vendor/gems/mail-smtp_pool/.gitlab-ci.yml +++ b/vendor/gems/mail-smtp_pool/.gitlab-ci.yml @@ -1,28 +1,10 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "mail-smtp_pool" + gem_path_prefix: "vendor/gems/" -.rspec: - cache: - key: mail-smtp_pool-ruby - paths: - - vendor/gems/mail-smtp_pool/vendor/ruby - before_script: - - cd vendor/gems/mail-smtp_pool - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec +rspec: + parallel: + matrix: + - RUBY_VERSION: ["3.0"] # 3.1 & 3.2 aren't supported yet diff --git a/vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml b/vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml index 1b10debb1b9f8..d10559587492d 100644 --- a/vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml +++ b/vendor/gems/microsoft_graph_mailer/.gitlab-ci.yml @@ -1,32 +1,5 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -.rspec: - cache: - key: microsoft_graph_mailer-ruby - paths: - - vendor/gems/microsoft_graph_mailer/vendor/ruby - before_script: - - cd vendor/gems/microsoft_graph_mailer - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec - -rspec-3.1: - image: "ruby:3.1" - extends: .rspec +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "microsoft_graph_mailer" + gem_path_prefix: "vendor/gems/" diff --git a/vendor/gems/omniauth-azure-oauth2/.gitlab-ci.yml b/vendor/gems/omniauth-azure-oauth2/.gitlab-ci.yml index 816b868915f2a..b49143ebd3318 100644 --- a/vendor/gems/omniauth-azure-oauth2/.gitlab-ci.yml +++ b/vendor/gems/omniauth-azure-oauth2/.gitlab-ci.yml @@ -1,36 +1,5 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -.rspec: - cache: - key: omniauth-azure-oauth2 - paths: - - vendor/gems/omniauth-azure-oauth2/vendor/ruby - before_script: - - cd vendor/gems/omniauth-azure-oauth2 - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec - -rspec-3.1: - image: "ruby:3.1" - extends: .rspec - -rspec-3.2: - image: "ruby:3.2" - extends: .rspec +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "omniauth-azure-oauth2" + gem_path_prefix: "vendor/gems/" diff --git a/vendor/gems/omniauth-gitlab/.gitlab-ci.yml b/vendor/gems/omniauth-gitlab/.gitlab-ci.yml index a802029c00802..10382723643eb 100644 --- a/vendor/gems/omniauth-gitlab/.gitlab-ci.yml +++ b/vendor/gems/omniauth-gitlab/.gitlab-ci.yml @@ -1,36 +1,5 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -.rspec: - cache: - key: omniauth-gitlab-ruby - paths: - - vendor/gems/omniauth-gitlab/vendor/ruby - before_script: - - cd vendor/gems/omniauth-gitlab - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec - -rspec-3.1: - image: "ruby:3.1" - extends: .rspec - -rspec-3.2: - image: "ruby:3.2" - extends: .rspec +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "omniauth-gitlab" + gem_path_prefix: "vendor/gems/" diff --git a/vendor/gems/omniauth-salesforce/.gitlab-ci.yml b/vendor/gems/omniauth-salesforce/.gitlab-ci.yml index 15e7392e46b7d..bd630fbdcd0b1 100644 --- a/vendor/gems/omniauth-salesforce/.gitlab-ci.yml +++ b/vendor/gems/omniauth-salesforce/.gitlab-ci.yml @@ -1,36 +1,5 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -.rspec: - cache: - key: omniauth-salesforce - paths: - - vendor/gems/omniauth-salesforce/vendor/ruby - before_script: - - cd vendor/gems/omniauth-salesforce - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec - -rspec-3.1: - image: "ruby:3.1" - extends: .rspec - -rspec-3.2: - image: "ruby:3.2" - extends: .rspec +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "omniauth-salesforce" + gem_path_prefix: "vendor/gems/" diff --git a/vendor/gems/omniauth_crowd/.gitlab-ci.yml b/vendor/gems/omniauth_crowd/.gitlab-ci.yml index ddc5d2fa5c304..9265f7a04a000 100644 --- a/vendor/gems/omniauth_crowd/.gitlab-ci.yml +++ b/vendor/gems/omniauth_crowd/.gitlab-ci.yml @@ -1,36 +1,5 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -.rspec: - cache: - key: omniauth_crowd - paths: - - vendor/gems/omniauth_crowd/vendor/ruby - before_script: - - cd vendor/gems/omniauth_crowd - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-document # Bundler is not installed with the image - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install -j $(nproc) - script: - - bundle exec rspec - -rspec-2.7: - image: "ruby:2.7" - extends: .rspec - -rspec-3.0: - image: "ruby:3.0" - extends: .rspec - -rspec-3.1: - image: "ruby:3.1" - extends: .rspec - -rspec-3.2: - image: "ruby:3.2" - extends: .rspec +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "omniauth_crowd" + gem_path_prefix: "vendor/gems/" diff --git a/vendor/gems/sidekiq-reliable-fetch/.gitlab-ci.yml b/vendor/gems/sidekiq-reliable-fetch/.gitlab-ci.yml index fdf9ccdeb55b0..9df016874477e 100644 --- a/vendor/gems/sidekiq-reliable-fetch/.gitlab-ci.yml +++ b/vendor/gems/sidekiq-reliable-fetch/.gitlab-ci.yml @@ -1,71 +1,54 @@ -workflow: - rules: - - if: $CI_MERGE_REQUEST_ID - -default: - image: ruby:3.0 - -before_script: - - cd vendor/gems/sidekiq-reliable-fetch - - ruby -v - - which ruby - - gem install bundler - - bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby - - bundle config set with 'development' # This is set to 'deployment' otherwise - - bundle config set --local frozen 'true' # Disallow Gemfile.lock changes on CI - - bundle config # Show bundler configuration - - bundle install --jobs $(nproc) "${FLAGS[@]}" - -variables: - REDIS_URL: "redis://redis" +include: + - local: gems/gem.gitlab-ci.yml + inputs: + gem_name: "sidekiq-reliable-fetch" + gem_path_prefix: "vendor/gems/" rspec: - stage: test - coverage: '/LOC \((\d+\.\d+%)\) covered.$/' - script: - - bundle exec rspec + extends: + - .with_redis + parallel: + matrix: + - RUBY_VERSION: ["3.0", "3.1"] # 3.2 isn't supported yet + +.with_redis: services: - redis:alpine - artifacts: - expire_in: 31d - when: always - paths: - - coverage/ + variables: + REDIS_URL: "redis://redis" -.integration: - stage: test +.reliability: + extends: + - .with_redis + - .ruby_matrix script: - cd tests/reliability - bundle exec ruby reliability_test.rb - services: - - redis:alpine integration_semi: - extends: .integration + extends: .reliability variables: JOB_FETCHER: semi integration_reliable: - extends: .integration + extends: .reliability variables: JOB_FETCHER: reliable -kill_interruption: - stage: test +.interruption: + extends: + - .with_redis + - .ruby_matrix script: - cd tests/interruption - - bundle exec ruby test_kill_signal.rb - services: - - redis:alpine + - bundle exec ruby "test_${SIGNAL}_signal.rb" -term_interruption: - stage: test - script: - - cd tests/interruption - - bundle exec ruby test_term_signal.rb - services: - - redis:alpine +kill_interruption: + extends: .interruption + variables: + SIGNAL: kill -# rubocop: -# script: -# - bundle exec rubocop +term_interruption: + extends: .interruption + variables: + SIGNAL: term -- GitLab