Skip to content

Commit 408cee8

Browse files
authored
[skip changelog] Don't require Codecov upload success for test run in fork (#1397)
* [skip changelog] Use major version refs of action in "Test Go" workflow Use of the major version ref will cause the workflow to benefit from ongoing development to the actions up until such time as a new major release of an action is made, at which time we would need to evaluate whether any changes to the workflow are required by the breaking change that triggered the major release before updating the major ref (e.g., `uses: codecov/codecov-action@v3`). The previous pin to the patch version required an update to the workflow on every action release in order to keep it updated. * [skip changelog] Don't require Codecov upload success for test run in fork The "Test Go" workflow uploads code coverage data to Codecov. There will occasionally be spurious upload failures caused by transient network outages. These will typically succeed after the workflow is re-run, but the option to re-run is not offered when the workflow run passes. Because it's important that the data be complete, the `codecov/codecov-action` action is configured to fail the workflow run if the upload does not succeed. However, the upload will never be able to succeed for workflow runs in a fork where the owner has not set up Codecov. For this reason, the `fail_ci_if_error` input setting is made conditional upon the repository name. The result is: - Coverage data upload success is required for all workflow runs in the `arduino/arduino-cli` repository. - Uploads are attempted for workflow runs in forks (because the fork owner might have Codecov set up and want the data), but they are not required to succeed and will fail silently.
1 parent bec94db commit 408cee8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: .github/workflows/test-go-task.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ jobs:
7474
with:
7575
file: ./coverage_unit.txt
7676
flags: unit
77-
fail_ci_if_error: true
77+
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}
7878

7979
- name: Send legacy tests coverage to Codecov
8080
if: >
8181
runner.os == 'Linux' &&
8282
github.event_name == 'push'
83-
uses: codecov/codecov-action@v2.0.2
83+
uses: codecov/codecov-action@v2
8484
with:
8585
file: ./coverage_legacy.txt
8686
flags: unit
87+
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}

0 commit comments

Comments
 (0)