-
Notifications
You must be signed in to change notification settings - Fork 45
84 lines (69 loc) · 2.61 KB
/
ci.yml
File metadata and controls
84 lines (69 loc) · 2.61 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
name: CI
on:
- push
- pull_request
env:
JRUBY_OPTS: "-X+C" # temporarily force JRuby to compile, so Java exception trace will contain .rb lines
jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
min_version: 2.4
host:
needs: ruby-versions
name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
os:
- ubuntu-latest
- macos-latest
- windows-latest
include:
- { os: windows-latest , ruby: mingw }
- { os: windows-latest , ruby: mswin }
- { os: ubuntu-latest , ruby: jruby-9.4 }
- { os: ubuntu-latest , ruby: truffleruby-33 } # using stdlib implementation, only a smoke test
- { os: ubuntu-latest , ruby: truffleruby-head } # using truffleruby.rb
exclude:
- { os: macos-latest , ruby: 2.4 }
- { os: ubuntu-latest , ruby: 2.5 }
- { os: macos-latest , ruby: 2.5 }
- { os: windows-latest , ruby: head }
- { os: windows-latest , ruby: truffleruby }
- { os: windows-latest , ruby: truffleruby-head }
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake compile
# If strscan in Ruby's master has the same version of this strscan,
# "gem install pkg/*.gem" fails.
- run: bundle exec rake version:bump
if: >-
matrix.ruby == 'head' ||
matrix.ruby == 'mingw' ||
matrix.ruby == 'mswin'
- run: bundle exec rake build
- uses: actions/upload-artifact@v7
if: >-
matrix.os == 'ubuntu-latest' &&
(matrix.ruby == '3.3' || matrix.ruby == 'jruby')
with:
name: gem-${{ matrix.os }}-${{ matrix.ruby }}
path: pkg/
- run: bundle exec rake test
if: matrix.ruby != 'truffleruby-33'
- run: gem install --verbose --backtrace pkg/*.gem
- run: gem install test-unit-ruby-core test-unit
- name: Run tests on the installed gem
run: ruby run-test.rb ${TESTOPTS}
if: matrix.ruby != '2.4' && matrix.ruby != 'truffleruby-33' # strscan is a default gem from 2.5
- name: Smoke test for older truffleruby using stdlib
run: ruby -rstrscan -e 'puts $".grep(/strscan/); abort("failed") unless StringScanner.new("abc").scan(/a/) == "a"'
if: matrix.ruby == 'truffleruby-33'