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].

The secret token doesn't always save from false positives though,
because GitHub Actions are supposedly buggy when handling secrets [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 835f4bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,18 @@ 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].
#
# The secret token doesn't always save from false positives though,
# because GitHub Actions are supposedly buggy when handling secrets [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 835f4bd

Please sign in to comment.