Unverified Commit 408cee85 authored by per1234's avatar per1234 Committed by GitHub

[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.
parent bec94dba
...@@ -74,13 +74,14 @@ jobs: ...@@ -74,13 +74,14 @@ jobs:
with: with:
file: ./coverage_unit.txt file: ./coverage_unit.txt
flags: unit flags: unit
fail_ci_if_error: true fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}
- name: Send legacy tests coverage to Codecov - name: Send legacy tests coverage to Codecov
if: > if: >
runner.os == 'Linux' && runner.os == 'Linux' &&
github.event_name == 'push' github.event_name == 'push'
uses: codecov/codecov-action@v2.0.2 uses: codecov/codecov-action@v2
with: with:
file: ./coverage_legacy.txt file: ./coverage_legacy.txt
flags: unit flags: unit
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment