forked from geminabox/geminabox
-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (82 loc) · 2.68 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
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
name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby-version: [2.3.8, 2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.6, 3.1.4, 3.2.2]
gem-version: [3.3.15]
include:
- ruby-version: 2.3.8
gem-version: 2.7.11
- ruby-version: 2.4.10
gem-version: 2.7.11
- ruby-version: 2.5.9
gem-version: 2.7.11
# Test with RubyGems 2.5.0 as it is specified in gemspec
- ruby-version: 2.3.8
gem-version: 2.5.0
continue-on-error: true
- ruby-version: 2.4.10
gem-version: 2.5.0
continue-on-error: true
- ruby-version: 2.5.9
gem-version: 2.5.0
continue-on-error: true
- ruby-version: 2.6.10
gem-version: 2.5.0
continue-on-error: true
- ruby-version: 2.7.8
gem-version: 2.5.0
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Use RubyGems with the specific version
env:
gemver: ${{ matrix.gem-version }}
run: |
gem update --system $gemver
gem --version
- name: Run tests
env:
MINITEST_REPORTER: SpecReporter
run: bundle exec rake
continue-on-error: ${{ matrix.continue-on-error }}
- name: Workaround for coverage report to CodeClimate with jq
if: startsWith(matrix.ruby-version, '3.2.')
run: |
jq 'map_values(. | map_values(if type=="object" then map_values(.lines) else . end))' coverage/.resultset.json > coverage/.resultset_workaround.json
diff -uw coverage/.resultset.json coverage/.resultset_workaround.json || true
- name: Send coverage report to CodeClimate
if: startsWith(matrix.ruby-version, '3.2.')
continue-on-error: true
uses: paambaati/[email protected]
with:
coverageLocations: ${{ github.workspace }}/coverage/.resultset_workaround.json:simplecov
env:
CC_TEST_REPORTER_ID: 9b585696c2187df640c9fe468b29a1e8cd5ea766a867b2c6f22b7e25d648155b
rubocop:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: 3.2.2
- name: Run RuboCop
run: |
bundle add rubocop --version 1.55.0
bundle add rubocop-minitest --version 0.20.1
bundle add rubocop-rake --version 0.6.0
bundle exec rubocop