-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR: Split codecov action into with & without token with retry logic
- Loading branch information
1 parent
dfb61c0
commit 3d1632e
Showing
1 changed file
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|