Skip to content

Commit

Permalink
PR: Split codecov action into with & without token with retry logic
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzadlone committed May 3, 2023
1 parent dfb61c0 commit 3d1632e
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/code-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Setup Go environment explicitly
uses: actions/setup-go@v3
Expand All @@ -44,9 +42,29 @@ jobs:
- name: Generate full test coverage report using go-acc
run: make test:coverage

- name: Upload coverage to Codecov
- name: Upload coverage to Codecov without token, retry on failure
env:
codecov_secret: ${{ secrets.CODECOV_TOKEN }}
if: env.codecov_secret == ''
uses: Wandalen/[email protected]
with:
attempt_limit: 5
attempt_delay: 10000
action: codecov/codecov-action@v3
with: |
fail_ci_if_error: true
files: ./coverage.txt
flags: defra-tests
name: codecov-umbrella
verbose: true
- name: Upload coverage to Codecov with token
env:
codecov_secret: ${{ secrets.CODECOV_TOKEN }}
if: env.codecov_secret != ''
uses: codecov/codecov-action@v3
with:
token: ${{ env.codecov_secret }}
fail_ci_if_error: true
files: ./coverage.txt
flags: defra-tests
Expand Down

0 comments on commit 3d1632e

Please sign in to comment.