forked from sparklemotion/nokogiri
-
Notifications
You must be signed in to change notification settings - Fork 0
287 lines (275 loc) · 8.24 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
name: ci
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: "0 8 * * 3" # At 08:00 on Wednesday # https://crontab.guru/#0_8_*_*_3
push:
branches:
- main
- v*.*.x
tags:
- v*.*.*
pull_request:
types: [opened, synchronize]
branches:
- '*'
jobs:
gumbo:
needs: ["rubocop"]
strategy:
fail-fast: false
matrix:
plat: ["ubuntu", "windows", "macos"]
runs-on: ${{matrix.plat}}-latest
steps:
- name: configure git crlf
if: matrix.plat == 'windows'
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- uses: actions/checkout@v2
with:
submodules: true
- uses: MSP-Greg/setup-ruby-pkgs@v1
with:
ruby-version: "3.0" # OK for now, until ruby 3.1 CI is stable
apt-get: "ragel"
brew: "ragel"
mingw: "ragel"
bundler-cache: true
- run: bundle exec rake gumbo:test
basic:
needs: ["rubocop"]
strategy:
fail-fast: false
matrix:
image: ["ubuntu", "ubuntu32"]
sys: ["enable"]
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:${{matrix.image}}
steps:
- uses: actions/checkout@v1 # v1 because of https://github.com/actions/checkout/issues/334
with:
submodules: true
- run: bundle install --local || bundle install
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test
linux:
needs: ["basic"]
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["2.6", "2.7", "3.0", "3.1"]
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v2
if: matrix.sys == 'disable'
with:
path: ports
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- run: bundle install --local || bundle install
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test
valgrind:
needs: ["linux"]
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["2.6", "2.7", "3.0", "3.1"]
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v2
if: matrix.sys == 'disable'
with:
path: ports
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- run: bundle install --local || bundle install
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test:valgrind
musl:
needs: ["basic"]
strategy:
fail-fast: false
matrix:
sys: ["enable"]
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:alpine
steps:
- uses: actions/checkout@v1 # v1 because of https://github.com/actions/checkout/issues/334
with:
submodules: true
# skip cache because of https://github.com/actions/cache/issues/675
- run: bundle install --local || bundle install
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test
musl-valgrind:
needs: ["musl"]
strategy:
fail-fast: false
matrix:
sys: ["disable"]
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:alpine
steps:
- uses: actions/checkout@v1 # v1 because of https://github.com/actions/checkout/issues/334
with:
submodules: true
# skip cache because of https://github.com/actions/cache/issues/675
- run: bundle install --local || bundle install
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test:valgrind
libxmlruby:
needs: ["basic"]
strategy:
fail-fast: false
matrix:
sys: ["enable"]
ruby: ["3.1"]
env:
BUNDLE_GEMFILE: "Gemfile-libxml-ruby"
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v2
if: matrix.sys == 'disable'
with:
path: ports
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- run: bundle install --local || bundle install
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test
libxmlruby-valgrind:
needs: ["libxmlruby"]
strategy:
fail-fast: false
matrix:
sys: ["disable"]
ruby: ["3.1"]
env:
BUNDLE_GEMFILE: "Gemfile-libxml-ruby"
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v2
if: matrix.sys == 'disable'
with:
path: ports
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- run: bundle install --local || bundle install
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test:valgrind
osx:
needs: ["basic"]
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["2.6", "2.7", "3.0", "3.1"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- uses: actions/cache@v2
if: matrix.sys == 'disable'
with:
path: ports
key: ports-macos-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test
windows:
needs: ["basic"]
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
ruby: ["2.6", "2.7", "3.0", "3.1", "mingw"]
runs-on: windows-2022
steps:
- name: configure git crlf
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- uses: actions/checkout@v2
with:
submodules: true
- uses: MSP-Greg/setup-ruby-pkgs@v1
with:
ruby-version: "${{matrix.ruby}}"
mingw: "libxml2 libxslt"
bundler-cache: true
- uses: actions/cache@v2
if: matrix.sys == 'disable'
with:
path: ports
key: ports-windows-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
- run: bundle exec rake test
jruby:
needs: ["basic"]
strategy:
fail-fast: false
matrix:
ruby: ["jruby-9.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- run: bundle exec rake compile
- run: bundle exec rake test
bsd:
continue-on-error: true # we're seeing VMs hang and fail the whole workflow
needs: ["basic"]
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
runs-on: macos-12
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: vmactions/[email protected]
with:
usesh: true
prepare: pkg install -y ruby devel/ruby-gems pkgconf libxml2 libxslt
run: |
gem install bundler
bundle install --local || bundle install
bundle exec rake compile -- --${{matrix.sys}}-system-libraries
bundle exec rake test