-
Notifications
You must be signed in to change notification settings - Fork 7
267 lines (248 loc) · 10.3 KB
/
ci.yml
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *' # Monthly
jobs:
test_ubuntu:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ruby-version: [ '2.3', '2.5', '2.7', '3.0',
'jruby-9.1.17.0', 'jruby-9.3.4.0']
gemfile: [ gherkin9, gherkin10, gherkin11, gherkin12, gherkin13, gherkin14,
gherkin15, gherkin16, gherkin17, gherkin18, gherkin19, gherkin20,
gherkin21, gherkin22, gherkin23, gherkin24, gherkin25, gherkin26,
gherkin27, gherkin28, gherkin29 ]
exclude:
# Requires at least Ruby 2.5
- ruby-version: 2.3
gemfile: gherkin27
- ruby-version: jruby-9.1.17.0
gemfile: gherkin27
- ruby-version: 2.3
gemfile: gherkin28
- ruby-version: jruby-9.1.17.0
gemfile: gherkin28
# Requires at least Ruby 3.0
- ruby-version: 2.3
gemfile: gherkin29
- ruby-version: 2.5
gemfile: gherkin29
- ruby-version: 2.7
gemfile: gherkin29
- ruby-version: jruby-9.1.17.0
gemfile: gherkin29
- ruby-version: jruby-9.3.4.0
gemfile: gherkin29
runs-on: ${{ matrix.os }}
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: testing/gemfiles/${{ matrix.gemfile }}.gemfile
JRUBY_OPTS: '-J-Djdk.io.File.enableADS=true' # Because of a JDK bug that might get fixed at some point
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run CI Rake task
run: bundle exec rake cuke_modeler:test_everything
- name: Push code coverage to Coveralls (conditional)
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: "./reports/coverage/lcov/lcov.info"
parallel: true
flag-name: run-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ matrix.gemfile }}
if: matrix.ruby-version != '2.3' && matrix.ruby-version != 'jruby-9.1.17.0'
test_macos:
strategy:
fail-fast: false
matrix:
# TODO: Split the MacOS job into two jobs ('test_macos_older' and 'test_macos_newer') with different OS
# portions of the matrix instead of having one job with clunky exclusions?
os: [macos-latest, macos-13]
ruby-version: [ '2.3', '2.5', '2.7', '3.0',
'jruby-9.1.17.0', 'jruby-9.3.4.0']
gemfile: [ gherkin9, gherkin10, gherkin11, gherkin12, gherkin13, gherkin14,
gherkin15, gherkin16, gherkin17, gherkin18, gherkin19, gherkin20,
gherkin21, gherkin22, gherkin23, gherkin24, gherkin25, gherkin26,
gherkin27, gherkin28, gherkin29 ]
exclude:
# Requires at least Ruby 2.5
- ruby-version: 2.3
gemfile: gherkin27
- ruby-version: jruby-9.1.17.0
gemfile: gherkin27
- ruby-version: 2.3
gemfile: gherkin28
- ruby-version: jruby-9.1.17.0
gemfile: gherkin28
# Requires at least Ruby 3.0
- ruby-version: 2.3
gemfile: gherkin29
- ruby-version: 2.5
gemfile: gherkin29
- ruby-version: 2.7
gemfile: gherkin29
- ruby-version: jruby-9.1.17.0
gemfile: gherkin29
- ruby-version: jruby-9.3.4.0
gemfile: gherkin29
# Note: GitHub Actions 'include' can't override any matrix values. It can only add them. So an exhaustive
# list of exclusions has to be used instead if we want to work with just one job matrix.
# Newer versions of Ruby (>=2.6) can handle ARM, so they can run on the latest MacOS instead of an older one
- os: macos-13
ruby-version: 2.7
- os: macos-13
ruby-version: 3.0
# Older versions of Ruby (<2.6) need AMD, so they can only run on an older MacOS instead of the latest one
- os: macos-latest
ruby-version: 2.3
- os: macos-latest
ruby-version: 2.5
# These JRuby versions are not available on MacOS 14 (which is currently the latest MacOS available), so they can only run on an older one
- os: macos-latest
ruby-version: jruby-9.1.17.0
- os: macos-latest
ruby-version: jruby-9.3.4.0
# Just not worth it to get these working and no additional and meaningful proof is provided by these
# combinations, given the other combinations that are being tested.
# Hits some kind of Java issue
- os: macos-13
ruby-version: jruby-9.1.17.0
runs-on: ${{ matrix.os }}
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: testing/gemfiles/${{ matrix.gemfile }}.gemfile
JRUBY_OPTS: '-J-Djdk.io.File.enableADS=true' # Because of a JDK bug that might get fixed at some point
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run CI Rake task
run: bundle exec rake cuke_modeler:test_everything
- name: Push code coverage to Coveralls (conditional)
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: "./reports/coverage/lcov/lcov.info"
parallel: true
flag-name: run-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ matrix.gemfile }}
if: matrix.ruby-version != '2.3' && matrix.ruby-version != 'jruby-9.1.17.0'
test_windows:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
ruby-version: [ '2.3', '2.5', '2.7', '3.0',
'jruby-9.1.17.0', 'jruby-9.3.4.0']
gemfile: [ gherkin9, gherkin10, gherkin11, gherkin12, gherkin13, gherkin14,
gherkin15, gherkin16, gherkin17, gherkin18, gherkin19, gherkin20,
gherkin21, gherkin22, gherkin23, gherkin24, gherkin25, gherkin26,
gherkin27, gherkin28, gherkin29 ]
exclude:
# Requires at least Ruby 2.5
- ruby-version: 2.3
gemfile: gherkin27
- ruby-version: jruby-9.1.17.0
gemfile: gherkin27
- ruby-version: 2.3
gemfile: gherkin28
- ruby-version: jruby-9.1.17.0
gemfile: gherkin28
# Requires at least Ruby 3.0
- ruby-version: 2.3
gemfile: gherkin29
- ruby-version: 2.5
gemfile: gherkin29
- ruby-version: 2.7
gemfile: gherkin29
- ruby-version: jruby-9.1.17.0
gemfile: gherkin29
- ruby-version: jruby-9.3.4.0
gemfile: gherkin29
# Just not worth it to get these working and no additional and meaningful proof is provided by these
# combinations, given the other combinations that are being tested.
# Problems building FFI native extensions during gem installation
- os: windows-latest
ruby-version: '2.3'
# Hits some kind of Java bug
- os: windows-latest
ruby-version: jruby-9.3.4.0
gemfile: gherkin23
- os: windows-latest
ruby-version: jruby-9.3.4.0
gemfile: gherkin22
- os: windows-latest
ruby-version: jruby-9.3.4.0
gemfile: gherkin20
- os: windows-latest
ruby-version: jruby-9.3.4.0
gemfile: gherkin18
- os: windows-latest
ruby-version: jruby-9.3.4.0
gemfile: gherkin15
runs-on: ${{ matrix.os }}
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: testing/gemfiles/${{ matrix.gemfile }}.gemfile
JRUBY_OPTS: '-J-Djdk.io.File.enableADS=true' # Because of a JDK bug that might get fixed at some point
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run CI Rake task
run: bundle exec rake cuke_modeler:test_everything
- name: Push code coverage to Coveralls (conditional)
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: "./reports/coverage/lcov/lcov.info"
parallel: true
flag-name: run-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ matrix.gemfile }}
if: matrix.ruby-version != '2.3' && matrix.ruby-version != 'jruby-9.1.17.0'
test_finish:
needs: [ test_macos, test_ubuntu, test_windows ]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
check_documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run documentation check
run: bundle exec rake cuke_modeler:check_documentation
lint_code:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run RuboCop
run: bundle exec rake cuke_modeler:rubocop