Skip to content

Commit

Permalink
chore(ci): retry codecov upload if it fails (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek authored Apr 5, 2023
1 parent b53a965 commit 609e8b2
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,23 @@ jobs:
- name: run unit tests
run: make test.unit

# We're using a retry mechanism for codecov to ensure we do get the reports
# uploaded. The alternative is to use fail_ci_if_error: false, but that
# somewhat defeats the purpose of uploading those reports. Why bother uploading
# if we don't care if the upload's successful?
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: steps.detect_if_should_run.outputs.result == 'true'
uses: Wandalen/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: unit-test
files: unit.coverage.out
verbose: true
action: codecov/codecov-action@v3
with: |
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: unit-test
files: unit.coverage.out
verbose: true
attempt_limit: 3
attempt_delay: 30000

setup-integration-tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -120,15 +129,23 @@ jobs:
TEST_RUN: ${{ matrix.test }}
NCPU: 1

# We're using a retry mechanism for codecov to ensure we do get the reports
# uploaded. The alternative is to use fail_ci_if_error: false, but that
# somewhat defeats the purpose of uploading those reports. Why bother uploading
# if we don't care if the upload's successful?
- name: Upload coverage to Codecov
if: steps.detect_if_should_run.outputs.result == 'true'
uses: codecov/codecov-action@v3
uses: Wandalen/wretry.action@v1.0.36
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: integration-test
files: integration.coverage.out
verbose: true
action: codecov/codecov-action@v3
with: |
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: integration-test
files: integration.coverage.out
verbose: true
attempt_limit: 3
attempt_delay: 30000

integration-tests-passed:
needs: integration-tests
Expand Down

0 comments on commit 609e8b2

Please sign in to comment.