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
+
1
15
default :
2
- image : ruby:3.2
16
+ image : ruby
3
17
4
18
variables :
5
19
BUNDLE_INSTALL_FLAGS : " --quiet --jobs=$(nproc) --retry=3"
6
20
BUNDLE_FROZEN : " false" # No lockfile!
21
+ BUNDLE_GEMFILE : Appraisal.root.gemfile
7
22
K_SOUP_COV_DEBUG : true
8
23
K_SOUP_COV_DO : true
9
24
K_SOUP_COV_HARD : true
10
25
K_SOUP_COV_MIN_BRANCH : 100
11
26
K_SOUP_COV_MIN_LINE : 100
12
27
K_SOUP_COV_VERBOSE : true
13
- K_SOUP_COV_FORMATTERS : " html,xml,rcov,lcov,json, tty"
28
+ K_SOUP_COV_FORMATTERS : " tty"
14
29
K_SOUP_COV_MULTI_FORMATTERS : true
15
30
K_SOUP_COV_COMMAND_NAME : " RSpec Coverage"
16
31
17
32
workflow :
18
33
rules :
19
34
# For merge requests, create a pipeline.
20
35
- 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.).
22
37
- if : ' $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
23
38
# For tags, create a pipeline.
24
39
- if : ' $CI_COMMIT_TAG'
@@ -27,10 +42,25 @@ workflow:
27
42
image : ruby:${RUBY_VERSION}
28
43
stage : test
29
44
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
32
52
- 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
34
64
cache :
35
65
key : ${CI_JOB_IMAGE}
36
66
paths :
@@ -40,21 +70,35 @@ workflow:
40
70
image : ruby:${RUBY_VERSION}
41
71
stage : test
42
72
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
45
76
# Actually updates both RubyGems and Bundler!
46
77
- 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
48
83
- 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
50
95
cache :
51
96
key : ${CI_JOB_IMAGE}
52
97
paths :
53
98
- vendor/ruby
54
99
55
100
ruby-current :
56
101
variables :
57
- BUNDLE_GEMFILE : gemfiles/omnibus.gemfile
58
102
K_SOUP_COV_DO : true
59
103
<< : *test_definition-current
60
104
parallel :
@@ -64,7 +108,7 @@ ruby-current:
64
108
ruby-ruby3_1 :
65
109
variables :
66
110
RUBYGEMS_VERSION : " 3.6.9"
67
- BUNDLE_GEMFILE : gemfiles/vanilla.gemfile
111
+ APPRAISAL : ruby_3_1
68
112
K_SOUP_COV_DO : false
69
113
<< : *test_definition-legacy
70
114
parallel :
@@ -74,7 +118,7 @@ ruby-ruby3_1:
74
118
ruby-ruby3_0 :
75
119
variables :
76
120
RUBYGEMS_VERSION : " 3.5.23"
77
- BUNDLE_GEMFILE : gemfiles/vanilla.gemfile
121
+ APPRAISAL : ruby_3_0
78
122
K_SOUP_COV_DO : false
79
123
<< : *test_definition-legacy
80
124
parallel :
@@ -84,7 +128,7 @@ ruby-ruby3_0:
84
128
ruby-ruby2_7 :
85
129
variables :
86
130
RUBYGEMS_VERSION : " 3.4.22"
87
- BUNDLE_GEMFILE : gemfiles/vanilla.gemfile
131
+ APPRAISAL : ruby_2_7
88
132
K_SOUP_COV_DO : false
89
133
<< : *test_definition-legacy
90
134
parallel :
0 commit comments