Skip to content

Commit 91daa53

Browse files
committed
Merge coverages before being sent
1 parent 9b4e1fe commit 91daa53

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

.github/workflows/test.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Test
22
on: [push]
33
jobs:
4-
unit-test:
4+
test:
55
runs-on: macOS-12
66
strategy:
77
fail-fast: false
@@ -17,8 +17,33 @@ jobs:
1717
with:
1818
ruby-version: ${{ matrix.ruby-version }}
1919
bundler-cache: true
20-
- uses: paambaati/[email protected]
20+
- name: Install cc-test-reporter
21+
run: |
22+
curl -Lo cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64
23+
chmod +x cc-test-reporter
24+
- run: ./cc-test-reporter before-build
2125
env:
2226
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
27+
- run: bundle exec rake
28+
- name: Format coverage
29+
run: |
30+
./cc-test-reporter format-coverage --input-type simplecov --output 'codeclimate-${{ matrix.ruby-version }}.json' coverage/.resultset.json
31+
- uses: actions/upload-artifact@v3
2332
with:
24-
coverageCommand: bundle exec rake
33+
name: coverages
34+
path: codeclimate-${{ matrix.ruby-version }}.json
35+
upload-coverage:
36+
runs-on: ubuntu-20.04
37+
needs: test
38+
steps:
39+
- uses: actions/download-artifact@v3
40+
with:
41+
name: coverages
42+
- name: Install cc-test-reporter
43+
run: |
44+
curl -Lo cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
45+
chmod +x cc-test-reporter
46+
- name: Upload coverage
47+
run: ./cc-test-reporter sum-coverage --output - codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input -
48+
env:
49+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

0 commit comments

Comments
 (0)