-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (47 loc) · 1.22 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
name: Tests
on:
pull_request:
branches:
- main
- master
push:
branches:
- main
- master
jobs:
test:
name: Test
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
RUBY_VERSION: ["2.1", "2.2", "2.3", "2.6", "3"]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Ruby ${{ matrix.RUBY_VERSION }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.RUBY_VERSION }}
bundler-cache: true
# We haven't updated this repo for compatibility with Ruby 3.x, yet are
# actually using it in deploy-api with 3.x. We'll run the tests, but
# defer fixing the rubocop issues that arise
- name: Lint
if: ${{ matrix.RUBY_VERSION != '3' }}
run: bundle exec rake rubocop
- name: Run Tests
run: bundle exec rspec
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [test]
steps:
- run: exit 1
# see https://stackoverflow.com/a/67532120/4907315
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}