From 13d548e2c76f1cfe082f3185d55529e91eac0386 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 2 Aug 2020 09:38:54 -0700 Subject: [PATCH 1/2] Use v1 ref of codecov/codecov-action GitHub Actions action Previously, the workflow pinned the outdated v1.0.2 ref. The requirement for an upload token has been removed since the 1.0.2 release. Removing the token input will provide several benefits: - Prevent failures when the workflow is run in forks, which won't have the CODECOV_TOKEN secret defined. - Allow configuring the workflow to be triggered by pull_request events, making it easy to evaluate the impact the pull request has on code coverage. The use of the v1 ref, rather than pinning a specific version allows the workflow to automatically benefit from ongoing development work on the action, while still preventing it from being affected by breaking changes. --- .github/workflows/test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 71aada3a107..692c47d0627 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -84,7 +84,7 @@ jobs: if: > matrix.operating-system == 'ubuntu-latest' && github.event_name == 'push' - uses: codecov/codecov-action@v1.0.2 + uses: codecov/codecov-action@v1 with: token: ${{secrets.CODECOV_TOKEN}} file: ./coverage_unit.txt @@ -98,7 +98,7 @@ jobs: if: > matrix.operating-system == 'ubuntu-latest' && github.event_name == 'push' - uses: codecov/codecov-action@v1.0.2 + uses: codecov/codecov-action@v1 with: token: ${{secrets.CODECOV_TOKEN}} file: ./coverage_legacy.txt @@ -112,7 +112,7 @@ jobs: if: > matrix.operating-system == 'ubuntu-latest' && github.event_name == 'push' - uses: codecov/codecov-action@v1.0.2 + uses: codecov/codecov-action@v1 with: token: ${{secrets.CODECOV_TOKEN}} file: ./coverage_integ.txt From 701e45d25306f51e2762133c0650d262ffdc5251 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 2 Aug 2020 09:44:24 -0700 Subject: [PATCH 2/2] Remove unnecessary token input from Codecov upload steps of test workflow With the modern versions of the codecov/codecov-action GitHub Actions action, the upload token is only required for private repositories. Now that we are using a modern version of the action, this input only has a harmful effect by causing the workflow to fail when run in forks and also preventing us from using Codecov to evaluate the impact on code coverage of pull requests. --- .github/workflows/test.yaml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 692c47d0627..31656a2bfcb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -77,43 +77,28 @@ jobs: run: task test-integration - name: Send unit tests coverage to Codecov - # Since secrets aren't available on forks, we only - # upload coverage on `push`. This might change if - # Codecov whitelists GitHub, lifting the need - # for a token. if: > matrix.operating-system == 'ubuntu-latest' && github.event_name == 'push' uses: codecov/codecov-action@v1 with: - token: ${{secrets.CODECOV_TOKEN}} file: ./coverage_unit.txt flags: unit - name: Send legacy tests coverage to Codecov - # Since secrets aren't available on forks, we only - # upload coverage on `push`. This might change if - # Codecov whitelists GitHub, lifting the need - # for a token. if: > matrix.operating-system == 'ubuntu-latest' && github.event_name == 'push' uses: codecov/codecov-action@v1 with: - token: ${{secrets.CODECOV_TOKEN}} file: ./coverage_legacy.txt flags: unit - name: Send integration tests coverage to Codecov - # Since secrets aren't available on forks, we only - # upload coverage on `push`. This might change if - # Codecov whitelists GitHub, lifting the need - # for a token. if: > matrix.operating-system == 'ubuntu-latest' && github.event_name == 'push' uses: codecov/codecov-action@v1 with: - token: ${{secrets.CODECOV_TOKEN}} file: ./coverage_integ.txt flags: integ