Skip to content

Commit

Permalink
CI: Fix Codecov intermittently failing on coverage report upload
Browse files Browse the repository at this point in the history
The patch explicitly adds the use of the `with.token` option, as
confirmed by others to improve the behaviour even on public repos.

The token is not required for public repos, but it makes the workflow
less likely to randomly fail because of a limit in Codecov CI
capabilities [1]. However, the secret token doesn't always protect
against erratic behaviour [2-4].

[1] codecov/codecov-action#557 (comment)
[2] codecov/codecov-action#557 (comment)
[3] codecov/codecov-action#598 (comment)
[4] https://github.com/orgs/community/discussions/25701
  • Loading branch information
amotl committed Oct 3, 2022
1 parent 6492325 commit da27772
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,15 @@ jobs:
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v3
with:

# The token is not required for public repos, but it makes the workflow
# less likely to randomly fail because of a limit in Codecov CI
# capabilities [1]. However, the secret token doesn't always protect
# against erratic behaviour [2-4].
# [1] https://github.com/codecov/codecov-action/issues/557#issuecomment-1216749652
# [2] https://github.com/codecov/codecov-action/issues/557#issuecomment-1223737955
# [3] https://github.com/codecov/codecov-action/issues/598#issuecomment-1223307820
# [4] https://github.com/orgs/community/discussions/25701
token: ${{ secrets.CODECOV_TOKEN }}

fail_ci_if_error: true

0 comments on commit da27772

Please sign in to comment.