-
Notifications
You must be signed in to change notification settings - Fork 31
52 lines (49 loc) · 1.43 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
name: test
on: [push, pull_request]
jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
engine: cruby-jruby
min_version: 2.5
build:
needs: ruby-versions
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
strategy:
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- ruby: mswin
os: windows-latest
exclude:
- ruby: 2.5
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run test
run: bundle exec rake test
timeout-minutes: 3
continue-on-error: ${{ startsWith(matrix.ruby, 'jruby') }}
- name: Build package
id: build
shell: bash
run: |
if ruby -e 'exit RUBY_VERSION>="3.0."'; then
bundle exec rake build
set pkg/*.gem
echo pkg=$1 >> $GITHUB_OUTPUT
fi
- name: Install gem
run: |
gem install ${{ steps.build.outputs.pkg }}
ruby -rresolv -e 'puts $LOADED_FEATURES.grep(/resolv/)'
ruby -rresolv -e 'puts Resolv::VERSION'
if: ${{ steps.build.outputs.pkg }}
continue-on-error: ${{ startsWith(matrix.ruby, 'jruby') }}