-
Notifications
You must be signed in to change notification settings - Fork 29
111 lines (102 loc) · 3.13 KB
/
ci.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html
# Rails 4.2 is open ended, but people usually stopped at using it with 2.4
- ruby: "2.4"
rails: "4_2"
# Rails 5.0 requires 2.2.2 minimum, 2.4.x was maximum
- ruby: "2.4"
rails: "5_0"
# Rails 5.1 requires 2.2.2 minimum, 2.5.x was maximum
- ruby: "2.4"
rails: "5_1"
- ruby: "2.5"
rails: "5_1"
# Rails 5.2 requires 2.2.2 minimum, 2.6.x was maximum
- ruby: "2.4"
rails: "5_2"
- ruby: "2.5"
rails: "5_2"
- ruby: "2.6"
rails: "5_2"
# Rails 6.0 requires 2.5.x minimum, 2.7.x was maximum
- ruby: "2.5"
rails: "6_0"
- ruby: "2.6"
rails: "6_0"
- ruby: "2.7"
rails: "6_0"
# Rails 6.1 requires 2.5.x minimum and is open ended
- ruby: "2.5"
rails: "6_1"
- ruby: "2.6"
rails: "6_1"
- ruby: "2.7"
rails: "6_1"
- ruby: "3.0"
rails: "6_1"
- ruby: "3.1"
rails: "6_1"
- ruby: "3.2"
rails: "6_1"
# Rails 7.0 requires 2.7.x minimum and is open ended
- ruby: "2.7"
rails: "7_0"
- ruby: "3.0"
rails: "7_0"
- ruby: "3.1"
rails: "7_0"
- ruby: "3.2"
rails: "7_0"
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: ${{ matrix.rails == '4_2' && '1.17.3' || 'default' }}
bundler-cache: true
- name: Run tests
run: bundle exec rspec
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: coverage/coverage.json
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Run Rubocop
run: bundle exec rubocop
upload-coverage:
needs: tests
runs-on: ubuntu-latest
if: ${{ github.repository == 'jejacks0n/navigasmic' }}
steps:
- uses: actions/checkout@v4
- name: Download code coverage artifacts
uses: actions/[email protected]
with:
name: code-coverage-report
- name: Test & publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageLocations: ${{github.workspace}}/coverage.json:simplecov