-
Notifications
You must be signed in to change notification settings - Fork 47
36 lines (31 loc) · 1.08 KB
/
ruby.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
name: Ruby
on:
push:
branches: [ master ]
pull_request:
jobs:
complete:
if: always()
needs: [test]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7', '3.0']
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Remove test outputs for tests to generate
run: rm -fr spec/output
- name: Run Rspec tests
run: bundle exec rspec
- name: Check test outputs contain no diffs
run: git add spec/output && git status && git diff --staged --exit-code -- spec/output || (echo "Test outputs contain changes. Run 'make' locally and check that the changes are desired. If they're desired, commit them as part of the change." && exit 1)