-
-
Notifications
You must be signed in to change notification settings - Fork 231
63 lines (55 loc) · 1.55 KB
/
tests.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
name: tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: ${{ matrix.ruby }}
runs-on: ubuntu-latest
env:
COVERAGE_RUBY_VERSION: 2.6
BUNDLE_PATH: vendor/bundle
strategy:
fail-fast: false
matrix:
ruby:
- 2.6
- 2.7
- '3.0' # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
- 3.1
- 3.2
- 3.3
- jruby
- truffleruby
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Restore cache
uses: actions/cache@v4
with:
path: ${{ env.BUNDLE_PATH }}
key: ruby-${{ matrix.ruby }}-gems-${{ hashFiles('config.gemspec', 'gemfiles/**') }}
restore-keys: |
ruby-${{ matrix.ruby }}-gems-
- name: Prepare environment
run: |
sudo apt-get -y install libsqlite3-dev libxslt1-dev
- name: Install
run: |
bundle install
bundle exec appraisal install
- name: Test
run: bundle exec appraisal rspec
- name: Publish code coverage
if: startsWith(env.RUBY_VERSION, env.COVERAGE_RUBY_VERSION)
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: bundle exec appraisal rspec