-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.72 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
name: Test
on: push
jobs:
test:
runs-on: ubuntu-22.04
name: Ruby ${{ matrix.ruby-version }}
strategy:
matrix:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Install cc-test-reporter
run: |
curl -Lo cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x cc-test-reporter
- run: ./cc-test-reporter before-build
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- run: bundle exec rake
env:
CC_TEST_REPORTER_ID: dummy # https://github.com/codeclimate/test-reporter/issues/495
- name: Format coverage
run: ./cc-test-reporter format-coverage --input-type simplecov --output 'codeclimate-${{ matrix.ruby-version }}.json'
- uses: actions/upload-artifact@v4
with:
name: coverages-ruby-${{ matrix.ruby-version }}
path: codeclimate-${{ matrix.ruby-version }}.json
upload-coverage:
runs-on: ubuntu-22.04
needs: test
steps:
- uses: actions/download-artifact@v4
with:
pattern: coverages-*
merge-multiple: true
- name: Install cc-test-reporter
run: |
curl -Lo cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x cc-test-reporter
- name: Upload coverage
run: ./cc-test-reporter sum-coverage --output - codeclimate-*.json | ./cc-test-reporter upload-coverage --debug --input -
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}