Skip to content

Commit c202c03

Browse files
committed
ci: add unit test job and update coverage command in GitHub Actions workflow
1 parent 0b5c311 commit c202c03

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
env:
5151
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_KEY }}
5252
with:
53-
coverageCommand: yarn test --coverage --coverageReporters lcov
53+
coverageCommand: yarn test:coverage --coverageReporters lcov
5454
coverageLocations: |
5555
${{github.workspace}}/coverage/lcov.info:lcov
5656
# - name: Upload coverage to Codecov
@@ -62,6 +62,27 @@ jobs:
6262
# name: codecov-umbrella
6363
# fail_ci_if_error: true
6464

65+
test-comment:
66+
name: Unit tests
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- uses: actions/checkout@v3
71+
72+
- name: Setup
73+
uses: ./.github/actions/setup
74+
75+
- name: Run tests
76+
run: |
77+
yarn test:coverage --coverageReporters json-summary
78+
79+
- name: Test coverage comment
80+
id: coverageComment
81+
uses: MishaKav/jest-coverage-comment@main
82+
with:
83+
hide-comment: false
84+
coverage-summary-path: ./coverage/coverage-summary.json
85+
6586
build-library:
6687
runs-on: ubuntu-latest
6788
steps:

0 commit comments

Comments
 (0)