-
-
Notifications
You must be signed in to change notification settings - Fork 268
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
136 lines (127 loc) · 4.18 KB
/
.gitlab-ci.yml
File metadata and controls
136 lines (127 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# 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
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
#stages:
# - test
#sast:
# stage: test
#include:
# - template: Security/SAST.gitlab-ci.yml
default:
image: ruby
variables:
BUNDLE_INSTALL_FLAGS: "--quiet --jobs=$(nproc) --retry=3"
BUNDLE_FROZEN: "false" # No lockfile!
BUNDLE_GEMFILE: Appraisal.root.gemfile
K_SOUP_COV_DEBUG: true
K_SOUP_COV_DO: true
K_SOUP_COV_HARD: true
K_SOUP_COV_MIN_BRANCH: 52
K_SOUP_COV_MIN_LINE: 82
K_SOUP_COV_VERBOSE: true
K_SOUP_COV_FORMATTERS: "tty"
K_SOUP_COV_MULTI_FORMATTERS: true
K_SOUP_COV_COMMAND_NAME: "RSpec Coverage"
workflow:
rules:
# For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID'
# For the ` main ` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# For tags, create a pipeline.
- if: '$CI_COMMIT_TAG'
.test_template-current: &test_definition-current
image: ruby:${RUBY_VERSION}
stage: test
script:
# || true so we don't fail here, because it'll probably work even if the gem update fails
- gem update --silent --system > /dev/null 2>&1 || true
- mkdir -p vendor/bundle
- bundle config set path 'vendor/bundle'
- chmod +t -R vendor/bundle
- chmod o-w -R vendor/bundle
# Setup appraisal2
- bundle install
# Bundle a specific appraisal
- bundle exec appraisal unlocked_deps bundle install
# Light smoke test
- bundle exec appraisal unlocked_deps bin/rake --tasks
# Run tests, skipping those that won't work in CI
- >
bundle exec appraisal unlocked_deps \
bin/rspec spec \
--tag \~ci_skip \
--format progress \
--format RspecJunitFormatter
cache:
key: ${CI_JOB_IMAGE}
paths:
- vendor/ruby
.test_template-legacy: &test_definition-legacy
image: ruby:${RUBY_VERSION}
stage: test
script:
# RUBYGEMS_VERSION because we support EOL Ruby still...
# || true so we don't fail here, because it'll probably work even if the gem update fails
- gem install rubygems-update -v ${RUBYGEMS_VERSION} || true
# Actually updates both RubyGems and Bundler!
- update_rubygems
- mkdir -p vendor/bundle
- bundle config set path 'vendor/bundle'
- chmod +t -R vendor/bundle
- chmod o-w -R vendor/bundle
# Setup appraisal2
- bundle install
# Bundle a specific appraisal
- bundle exec appraisal ${APPRAISAL} bundle install
# Light smoke test
- bundle exec appraisal ${APPRAISAL} bin/rake --tasks
# Run tests, skipping those that won't work in CI
- >
bundle exec appraisal unlocked_deps \
bin/rspec spec \
--tag \~ci_skip \
--format progress \
--format RspecJunitFormatter
cache:
key: ${CI_JOB_IMAGE}
paths:
- vendor/ruby
ruby-current:
variables:
K_SOUP_COV_DO: true
<<: *test_definition-current
parallel:
matrix:
- RUBY_VERSION: ["3.2", "3.3", "3.4"]
ruby-ruby3_1:
variables:
RUBYGEMS_VERSION: "3.6.9"
APPRAISAL: ruby_3_1
K_SOUP_COV_DO: false
<<: *test_definition-legacy
parallel:
matrix:
- RUBY_VERSION: ["3.1"]
ruby-ruby3_0:
variables:
RUBYGEMS_VERSION: "3.5.23"
APPRAISAL: ruby_3_0
K_SOUP_COV_DO: false
<<: *test_definition-legacy
parallel:
matrix:
- RUBY_VERSION: ["3.0"]
ruby-ruby2_7:
variables:
RUBYGEMS_VERSION: "3.4.22"
APPRAISAL: ruby_2_7
K_SOUP_COV_DO: false
<<: *test_definition-legacy
parallel:
matrix:
- RUBY_VERSION: ["2.7"]