-
Notifications
You must be signed in to change notification settings - Fork 21
74 lines (61 loc) · 1.66 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
name: Test
on:
pull_request:
branches:
- '**'
push:
branches:
- main
jobs:
rspec:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.6', '2.7'] # TODO add 3.0 compat , '3.0']
hyrax: ['2.9.6', '3.6.0']
name: Run specs with ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2.1.3
with:
path: vendor/bundle
key: ${{ matrix.ruby }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1.59.1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup sqlite3
run: sudo apt-get install libsqlite3-dev
- name: Set Hyrax Version
run: |
bundle remove hyrax
bundle add hyrax -v ${{ matrix.hyrax }}
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install
- name: Migrate test database
run: bin/rails db:migrate RAILS_ENV=test
- name: Run rspec
run: bin/rspec
- name: Upload coverage results
uses: actions/upload-artifact@v2
with:
name: coverage-report-${{ matrix.ruby }}
path: coverage
coverage:
runs-on: ubuntu-latest
# This line will only run the coverage job if the test job passed
needs: rspec
steps:
- name: Download coverage report
uses: actions/download-artifact@v2
with:
name: coverage-report-2.7
path: coverage
- name: SimpleCov Check
uses: vigetlabs/simplecov-check@1.0
with:
minimum_coverage: 80
coverage_path: coverage/.last_run.json