From 819a05380bde3cdd9177ee8d39015344d7e157da Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 13 Aug 2021 00:11:41 -0700 Subject: [PATCH 1/2] [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. --- .github/workflows/test-go-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml index 51681ba80c0..071f222441b 100644 --- a/.github/workflows/test-go-task.yml +++ b/.github/workflows/test-go-task.yml @@ -80,7 +80,7 @@ jobs: if: > runner.os == 'Linux' && github.event_name == 'push' - uses: codecov/codecov-action@v2.0.2 + uses: codecov/codecov-action@v2 with: file: ./coverage_legacy.txt flags: unit From 05fa64cf4db7f73959683e3647cc61ca5af109b9 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 13 Aug 2021 00:16:01 -0700 Subject: [PATCH 2/2] [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. --- .github/workflows/test-go-task.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml index 071f222441b..179967ba01a 100644 --- a/.github/workflows/test-go-task.yml +++ b/.github/workflows/test-go-task.yml @@ -74,7 +74,7 @@ jobs: with: file: ./coverage_unit.txt flags: unit - fail_ci_if_error: true + fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }} - name: Send legacy tests coverage to Codecov if: > @@ -84,3 +84,4 @@ jobs: with: file: ./coverage_legacy.txt flags: unit + fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}