-
Notifications
You must be signed in to change notification settings - Fork 21
88 lines (76 loc) · 2.23 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Tests
on:
push:
branches:
- main
pull_request:
merge_group:
jobs:
rspec:
strategy:
fail-fast: false
matrix:
ruby: ['3.1.6', '3.2.5', '3.3.6']
rails: ['7.1.5', '7.2.2', '8.0.0']
runs-on: ubuntu-latest
name: Testing with Ruby ${{ matrix.ruby }} and Rails ${{ matrix.rails }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install gems
env:
RAILS_VERSION: ${{ matrix.rails }}
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Run RSpec
env:
SIMPLECOV: '0'
run: make rspec
quality-checks:
runs-on: ubuntu-latest
name: Code quality, test coverage and documentation checks
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.6
- name: Install gems
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Run Rubocop
run: make ruby-lint
- name: Download CodeClimate reporter
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run RSpec
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
SIMPLECOV: '1'
run: make rspec
- name: Report coverage to CodeClimate
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GIT_BRANCH: ${{ steps.extract_branch.outputs.branch }}
GIT_COMMIT_SHA: ${{ github.sha }}
run: ./cc-test-reporter after-build -t simplecov
- name: Run Nanoc Check
run: make nanoc-check-all
- name: Run Guide Check
run: make slim-lint
permit-merge:
name: Permit merge
needs: [rspec, quality-checks]
runs-on: ubuntu-latest
steps:
- run: "echo 'All checks passed ✅'"