forked from rubyconfig/config
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (57 loc) · 1.64 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
64
65
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:
matrix:
ruby:
- 2.4
- 2.5
- 2.6
- 2.7
- jruby
- truffleruby
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup ruby ${{ matrix.ruby }}
uses: eregon/use-ruby-action@master
with:
ruby-version: ${{ matrix.ruby }}
- name: Restore cache
uses: actions/cache@v1
with:
path: ${{ env.BUNDLE_PATH }}
key: ruby-${{ matrix.ruby }}-gems-${{ hashFiles('*.gemspec') }}-${{ hashFiles('**/gemfiles/**') }}
restore-keys: |
ruby-${{ matrix.ruby }}-gems-
- name: Prepare environment
run: |
sudo apt-get -y install libsqlite3-dev libxslt1-dev
gem uninstall bundler -v '>= 2' -ax --force || true
gem install bundler -v '~>1.0' -N || true
echo "::set-env name=BUNDLER_VERSION::$(bundle -v | grep -o -P '\d+\.\d+.\d+')"
- 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/codeclimate-action@v2.3.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: bundle exec appraisal rspec