Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add coverage upload to Codecov #781

Merged
merged 9 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ jobs:
run: yarn install --frozen-lockfile
- name: Run Unit Tests
run: yarn test
- name: Push code coverage to codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # [email protected]
with:
# Need to specify the token here, as the codecov action requires it for protected branches.
# If not set, this error is shown: `Token required because branch is protected`
token: ${{ secrets.CODECOV_TOKEN }}
# Do not fail the build if codecov fails to report the coverage.
fail_ci_if_error: false
flags: unit-tests

job_e2e_test:
name: ${{ matrix.wizard }} E2E Tests
Expand Down Expand Up @@ -101,3 +110,12 @@ jobs:
run: yarn install --frozen-lockfile
- name: Run End-to-End Tests
run: yarn test:e2e ${{ matrix.wizard }}
- name: Push code coverage to codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # [email protected]
with:
# Need to specify the token here, as the codecov action requires it for protected branches.
# If not set, this error is shown: `Token required because branch is protected`
token: ${{ secrets.CODECOV_TOKEN }}
# Do not fail the build if codecov fails to report the coverage.
fail_ci_if_error: false
flags: e2e-tests
15 changes: 15 additions & 0 deletions codecov.yml
philprime marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Reference: https://docs.codecov.com/docs/codecovyml-reference

codecov:
# Codecov should wait for all other statuses to pass before sending its status.
require_ci_to_pass: true
notify:
# Codecov will wait for all CI statuses to complete before sending its status.
# Note: Codecov considers all non-codecov statuses to be CI statuses.
wait_for_ci: true

coverage:
# The coverage percentage that should be reached before the build is considered successful.
# Note: This is set to a low value, as the test coverage is not high yet.
# When adding more test coverage, consider increasing this value.
range: 40...100
1 change: 1 addition & 0 deletions e2e-tests/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config({
});

export default {
collectCoverage: true,
testTimeout: 360000,
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
Expand Down
Loading