Skip to content

Commit

Permalink
chore: add codecov publish retries since it often fails (#1355)
Browse files Browse the repository at this point in the history
* chore: add codecov publish retries since it often fails
- codecov seems to fail quite often and it requires to retry the entire workflow to republish the test results, adding a retry plugin seems like a good fit

* chore: update jest reporters config
  • Loading branch information
ghiscoding authored Jan 19, 2024
1 parent a3878ae commit 2aaefd3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2 # codecov-bash seems to require this
fetch-depth: 0

- name: Set NodeJS
uses: actions/setup-node@v4
Expand Down Expand Up @@ -82,8 +82,13 @@ jobs:

- name: Upload Jest coverage to Codecov
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
uses: codecov/codecov-action@v3
uses: wandalen/wretry.action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: test/jest-coverage
verbose: true
action: codecov/codecov-action@v3
with: |
fail_ci_if_error: true
verbose: true
directory: test/jest-coverage
token: ${{ secrets.CODECOV_TOKEN }}
attempt_limit: 5
attempt_delay: 10000
7 changes: 4 additions & 3 deletions test/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config: Config.InitialOptions = {
rootDir: '../',
globalSetup: '<rootDir>/test/jest-global-setup.ts',
cacheDirectory: '<rootDir>/test/.jest-cache',
collectCoverage: false,
collectCoverage: true,
collectCoverageFrom: [
'packages/**/*.ts',
'!**/dist/**',
Expand All @@ -24,10 +24,11 @@ const config: Config.InitialOptions = {
'<rootDir>/node_modules/'
],
coverageReporters: [
'clover',
'json',
'lcov',
'text',
'html'
'html',
['text', { skipFull: true }],
],
moduleFileExtensions: [
'json',
Expand Down

0 comments on commit 2aaefd3

Please sign in to comment.