Skip to content

Commit b82807c

Browse files
authored
chore: add coverage upload to Codecov (#781)
1 parent 4cd92d9 commit b82807c

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

Diff for: .github/workflows/build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ jobs:
6666
run: yarn install --frozen-lockfile
6767
- name: Run Unit Tests
6868
run: yarn test
69+
- name: Push code coverage to codecov
70+
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # [email protected]
71+
with:
72+
# Need to specify the token here, as the codecov action requires it for protected branches.
73+
# If not set, this error is shown: `Token required because branch is protected`
74+
token: ${{ secrets.CODECOV_TOKEN }}
75+
# Do not fail the build if codecov fails to report the coverage.
76+
fail_ci_if_error: false
77+
flags: unit-tests
6978

7079
job_e2e_test:
7180
name: ${{ matrix.wizard }} E2E Tests
@@ -101,3 +110,12 @@ jobs:
101110
run: yarn install --frozen-lockfile
102111
- name: Run End-to-End Tests
103112
run: yarn test:e2e ${{ matrix.wizard }}
113+
- name: Push code coverage to codecov
114+
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # [email protected]
115+
with:
116+
# Need to specify the token here, as the codecov action requires it for protected branches.
117+
# If not set, this error is shown: `Token required because branch is protected`
118+
token: ${{ secrets.CODECOV_TOKEN }}
119+
# Do not fail the build if codecov fails to report the coverage.
120+
fail_ci_if_error: false
121+
flags: e2e-tests

Diff for: codecov.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Reference: https://docs.codecov.com/docs/codecovyml-reference
2+
3+
codecov:
4+
# Codecov should wait for all other statuses to pass before sending its status.
5+
require_ci_to_pass: true
6+
notify:
7+
# Codecov will wait for all CI statuses to complete before sending its status.
8+
# Note: Codecov considers all non-codecov statuses to be CI statuses.
9+
wait_for_ci: true
10+
11+
coverage:
12+
# The coverage percentage that should be reached before the build is considered successful.
13+
# Note: This is set to a low value, as the test coverage is not high yet.
14+
# When adding more test coverage, consider increasing this value.
15+
range: 40...100

Diff for: e2e-tests/jest.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config({
55
});
66

77
export default {
8+
collectCoverage: true,
89
testTimeout: 360000,
910
testEnvironment: 'node',
1011
testMatch: ['**/*.test.ts'],

0 commit comments

Comments
 (0)