1+ # You can override the included template(s) by including variable overrides
2+ # SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
3+ # Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
4+ # Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
5+ # Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
6+ # Note that environment variables can be set in several places
7+ # See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
8+ # stages:
9+ # - test
10+ # sast:
11+ # stage: test
12+ # include:
13+ # - template: Security/SAST.gitlab-ci.yml
14+
115default :
2- image : ruby:3.2
16+ image : ruby
317
418variables :
519 BUNDLE_INSTALL_FLAGS : " --quiet --jobs=$(nproc) --retry=3"
620 BUNDLE_FROZEN : " false" # No lockfile!
21+ BUNDLE_GEMFILE : Appraisal.root.gemfile
722 K_SOUP_COV_DEBUG : true
823 K_SOUP_COV_DO : true
924 K_SOUP_COV_HARD : true
1025 K_SOUP_COV_MIN_BRANCH : 100
1126 K_SOUP_COV_MIN_LINE : 100
1227 K_SOUP_COV_VERBOSE : true
13- K_SOUP_COV_FORMATTERS : " html,xml,rcov,lcov,json, tty"
28+ K_SOUP_COV_FORMATTERS : " tty"
1429 K_SOUP_COV_MULTI_FORMATTERS : true
1530 K_SOUP_COV_COMMAND_NAME : " RSpec Coverage"
1631
1732workflow :
1833 rules :
1934 # For merge requests, create a pipeline.
2035 - if : ' $CI_MERGE_REQUEST_IID'
21- # For default branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
36+ # For the ` main ` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
2237 - if : ' $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
2338 # For tags, create a pipeline.
2439 - if : ' $CI_COMMIT_TAG'
@@ -27,10 +42,25 @@ workflow:
2742 image : ruby:${RUBY_VERSION}
2843 stage : test
2944 script :
30- - gem update --silent --system
31- - bundle config --local path vendor
45+ # || true so we don't fail here, because it'll probably work even if the gem update fails
46+ - gem update --silent --system > /dev/null 2>&1 || true
47+ - mkdir -p vendor/bundle
48+ - bundle config set path 'vendor/bundle'
49+ - chmod +t -R vendor/bundle
50+ - chmod o-w -R vendor/bundle
51+ # Setup appraisal2
3252 - bundle install
33- - bundle exec rake
53+ # Bundle a specific appraisal
54+ - bundle exec appraisal unlocked_deps bundle install
55+ # Light smoke test
56+ - bundle exec appraisal unlocked_deps bin/rake --tasks
57+ # Run tests, skipping those that won't work in CI
58+ - >
59+ bundle exec appraisal unlocked_deps \
60+ bin/rspec spec \
61+ --tag \~ci_skip \
62+ --format progress \
63+ --format RspecJunitFormatter
3464 cache :
3565 key : ${CI_JOB_IMAGE}
3666 paths :
@@ -40,21 +70,35 @@ workflow:
4070 image : ruby:${RUBY_VERSION}
4171 stage : test
4272 script :
43- # Because we support EOL Ruby still...
44- - gem install rubygems-update -v ${RUBYGEMS_VERSION}
73+ # RUBYGEMS_VERSION because we support EOL Ruby still...
74+ # || true so we don't fail here, because it'll probably work even if the gem update fails
75+ - gem install rubygems-update -v ${RUBYGEMS_VERSION} || true
4576 # Actually updates both RubyGems and Bundler!
4677 - update_rubygems
47- - bundle config --local path vendor
78+ - mkdir -p vendor/bundle
79+ - bundle config set path 'vendor/bundle'
80+ - chmod +t -R vendor/bundle
81+ - chmod o-w -R vendor/bundle
82+ # Setup appraisal2
4883 - bundle install
49- - bundle exec rake test
84+ # Bundle a specific appraisal
85+ - bundle exec appraisal ${APPRAISAL} bundle install
86+ # Light smoke test
87+ - bundle exec appraisal ${APPRAISAL} bin/rake --tasks
88+ # Run tests, skipping those that won't work in CI
89+ - >
90+ bundle exec appraisal unlocked_deps \
91+ bin/rspec spec \
92+ --tag \~ci_skip \
93+ --format progress \
94+ --format RspecJunitFormatter
5095 cache :
5196 key : ${CI_JOB_IMAGE}
5297 paths :
5398 - vendor/ruby
5499
55100ruby-current :
56101 variables :
57- BUNDLE_GEMFILE : gemfiles/omnibus.gemfile
58102 K_SOUP_COV_DO : true
59103 << : *test_definition-current
60104 parallel :
@@ -64,7 +108,7 @@ ruby-current:
64108ruby-ruby3_1 :
65109 variables :
66110 RUBYGEMS_VERSION : " 3.6.9"
67- BUNDLE_GEMFILE : gemfiles/vanilla.gemfile
111+ APPRAISAL : ruby_3_1
68112 K_SOUP_COV_DO : false
69113 << : *test_definition-legacy
70114 parallel :
@@ -74,7 +118,7 @@ ruby-ruby3_1:
74118ruby-ruby3_0 :
75119 variables :
76120 RUBYGEMS_VERSION : " 3.5.23"
77- BUNDLE_GEMFILE : gemfiles/vanilla.gemfile
121+ APPRAISAL : ruby_3_0
78122 K_SOUP_COV_DO : false
79123 << : *test_definition-legacy
80124 parallel :
@@ -84,7 +128,7 @@ ruby-ruby3_0:
84128ruby-ruby2_7 :
85129 variables :
86130 RUBYGEMS_VERSION : " 3.4.22"
87- BUNDLE_GEMFILE : gemfiles/vanilla.gemfile
131+ APPRAISAL : ruby_2_7
88132 K_SOUP_COV_DO : false
89133 << : *test_definition-legacy
90134 parallel :
0 commit comments