forked from ruby/setup-ruby
-
Notifications
You must be signed in to change notification settings - Fork 2
334 lines (310 loc) · 10 KB
/
test.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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
name: Test this action
on:
pull_request:
push:
branches-ignore:
- v1
tags-ignore:
- '*'
paths-ignore:
- README.md
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-arm-oss, windows-2019, windows-2022 ]
ruby: [
'1.9', '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', ruby-head,
jruby, jruby-head,
truffleruby, truffleruby-head,
truffleruby+graalvm, truffleruby+graalvm-head
]
include:
- { os: windows-2019, ruby: mingw }
- { os: windows-2019, ruby: mswin }
- { os: windows-2022, ruby: mingw }
- { os: windows-2022, ruby: mswin }
- { os: windows-2022, ruby: ucrt }
exclude:
# https://github.com/ruby/setup-ruby/issues/496
- { os: ubuntu-22.04, ruby: '2.2' }
# Too old, fails to compile on macos-arm-oss
- { os: macos-arm-oss, ruby: '1.9' }
- { os: macos-arm-oss, ruby: '2.0' }
- { os: macos-arm-oss, ruby: '2.1' }
- { os: macos-arm-oss, ruby: '2.2' }
- { os: macos-arm-oss, ruby: '2.3' }
- { os: macos-arm-oss, ruby: '2.4' }
- { os: macos-arm-oss, ruby: '2.5' }
# Windows
- { os: windows-2019, ruby: '1.9' }
- { os: windows-2019, ruby: '3.3' }
- { os: windows-2019, ruby: debug }
- { os: windows-2019, ruby: truffleruby }
- { os: windows-2019, ruby: truffleruby-head }
- { os: windows-2019, ruby: truffleruby+graalvm }
- { os: windows-2019, ruby: truffleruby+graalvm-head }
- { os: windows-2022, ruby: '1.9' }
- { os: windows-2022, ruby: '3.3' }
- { os: windows-2022, ruby: debug }
- { os: windows-2022, ruby: truffleruby }
- { os: windows-2022, ruby: truffleruby-head }
- { os: windows-2022, ruby: truffleruby+graalvm }
- { os: windows-2022, ruby: truffleruby+graalvm-head }
name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: ruby -v
- name: PATH
shell: pwsh
run: |
# Show PATH with Powershell
$f, $r = $env:PATH.split([IO.Path]::PathSeparator); $r
- name: build compiler
run: |
ruby -e "puts 'build compiler: ' + RbConfig::CONFIG.fetch('CC_VERSION_MESSAGE', 'unknown').lines.first"
- name: gcc and ridk version (mingw)
if: startsWith(matrix.os, 'windows')
run: |
$abi, $plat = $(ruby -e "STDOUT.write RbConfig::CONFIG['ruby_version'] + ' ' + RUBY_PLATFORM").split(' ')
if ($plat.Contains('mingw')) {
gcc --version
if ($abi -ge '2.4') {
ridk version
} else {
echo 'ridk is unavailable'
}
} elseif ($plat.Contains('mswin')) {
&"$env:VCPKG_INSTALLATION_ROOT\vcpkg" list
}
- name: RbConfig::CONFIG
run: ruby -rrbconfig -rpp -e 'pp RbConfig::CONFIG'
- name: RbConfig::MAKEFILE_CONFIG
run: ruby -rrbconfig -rpp -e 'pp RbConfig::MAKEFILE_CONFIG'
- name: Subprocess test
run: ruby test_subprocess.rb
- name: OpenSSL compiled version
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
- name: OpenSSL loaded version
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
if: matrix.ruby != '1.9'
- name: OpenSSL test
run: ruby -ropen-uri -e 'puts URI.send(:open, %{https://rubygems.org/}) { |f| f.read(1024) }'
- run: gem env
- name: C extension test
run: gem install json -v 2.2.0
- run: bundle --version
# This step is redundant with `bundler-cache: true` but is there to check a redundant `bundle install` still works
- run: bundle install
- run: bundle exec rake --version
- run: bundle exec rake
# Ensure the same bundle commands work in bash on Windows
- name: bundle install (bash)
run: bundle install
shell: bash
if: startsWith(matrix.os, 'windows')
- name: bundle exec rake --version (bash)
run: bundle exec rake --version
shell: bash
if: startsWith(matrix.os, 'windows')
- name: bundle exec rake (bash)
run: bundle exec rake
shell: bash
if: startsWith(matrix.os, 'windows')
- name: Test `gem github:` in a Gemfile
run: bundle install
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/gem_from_github.gemfile
- name: which ruby, bundle
shell: bash
run: which -a ruby bundle
- name: which rake
run: which -a rake
if: "!startsWith(matrix.os, 'windows')"
- name: where ruby, rake, bundle
if: startsWith(matrix.os, 'windows')
run: |
$ErrorActionPreference = 'Continue'
$where = 'ruby', 'rake', 'bundle'
foreach ($e in $where) {
$rslt = where.exe $e 2>&1 | Out-String
if ($rslt.contains($e)) { echo $rslt.Trim() }
else { echo "Can't find $e" }
echo ''
}
- name: bash test
shell: bash
run: echo ~ && bundle install
- name: Windows JRuby
if: startsWith(matrix.os, 'windows') && startsWith(matrix.ruby, 'jruby')
run: gem install sassc
testNoGemfile:
name: "Test with no Gemfile"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rm Gemfile
- uses: ./
with:
ruby-version: '2.6'
- run: ruby -v
testLatestRubygemsVersion:
name: "Test rubygems: latest upgrades the default RubyGems version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.6'
rubygems: latest
- run: ruby -e "exit(Gem.rubygems_version > Gem::Version.new('3.0.3'))"
testFixedRubygemsVersionUpgrades:
name: "Test rubygems: version upgrades RubyGems to that version if the default is older"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.6'
rubygems: 3.2.3
- run: gem --version | grep -F "3.2.3"
testFixedRubygemsVersionNoop:
name: "Test rubygems: version noops if the default is newer"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '3.1.0'
rubygems: 3.2.3
- run: gem --version | grep -F "3.3.3"
testUseBundlerFromRubyGemsUpdate:
name: "Test rubygems: version uses the Bundler installed by the rubygems update"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '3.1.0'
rubygems: 3.4.0
- run: gem --version | grep -F "3.4.0"
- run: bundle --version | grep -F "2.4.0"
testFixedBundlerVersionForOldRuby:
name: "Test bundler: 1.x for old Ruby"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.2'
bundler: 1.16.6
- run: bundle --version | grep -F "1.16.6" # And not 1.17.x from ~> 1
testMajorBundlerVersion:
name: "Test with a major Bundler version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.6'
bundler: 2
- run: bundle --version | grep -P "Bundler version 2\.\d+\.\d+"
testMinorBundlerVersion:
name: "Test with a minor Bundler version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.6'
bundler: 2.2
- run: bundle --version | grep -P "Bundler version 2\.2\.\d+"
testExactBundlerVersion:
name: "Test with an exact Bundler version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.6'
bundler: 2.2.3
- run: bundle --version | grep -F "Bundler version 2.2.3"
testBundlerPre:
name: "Test with a Bundler pre/rc version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.6'
bundler: 2.2.0.rc.2
- run: bundle --version | grep -F "Bundler version 2.2.0.rc.2"
testBundlerDev:
name: "Test BUNDLED WITH Bundler dev"
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler-dev.gemfile
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: ruby-head
bundler-cache: true
testDependencyOnBundler1:
name: "Test gemfile depending on Bundler 1"
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler1.gemfile
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.7'
bundler: 1
bundler-cache: true
- run: bundle --version | grep -F "Bundler version 1."
testGemfileMatrix:
strategy:
fail-fast: false
matrix:
gemfile: [ rails5, rails6 ]
name: "Test with ${{ matrix.gemfile }} gemfile"
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: '2.6'
bundler-cache: true
- run: bundle exec rails --version
testTruffleRubyNokogiri:
name: "Test installing a Gemfile with nokogiri on TruffleRuby"
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/nokogiri.gemfile
steps:
- uses: actions/checkout@v4
- uses: ./
with:
ruby-version: truffleruby-head
bundler-cache: true
- run: bundle list | grep nokogiri
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- run: yarn install
- run: yarn run package
- name: Check generated files are up to date
run: git diff --exit-code