Skip to content

Commit

Permalink
Fix coverage upload to codecov being broken (#5487)
Browse files Browse the repository at this point in the history
**Context:** Fix codecov coverage upload breaking for tests

**Description of the Change:**
Codecov recently changed their API where a token has to be specified
during coverage upload. Previously this was not needed for public repos.

According to their docs, this token should still not be needed for
forks, so it should be fine for us, however, the token is needed for PRs
within the same repo.

**Benefits:**
Fixes codecov upload.

**Possible Drawbacks:**

**Related GitHub Issues:**
  • Loading branch information
rashidnhm authored Apr 9, 2024
1 parent 5b318ce commit a38b24d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/interface-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Unit Test - All Interfaces
on:
workflow_call:
secrets:
codecov_token:
description: The codecov token to use when uploading coverage files
required: true
inputs:
branch:
description: The PennyLane branch to checkout and run unit tests for
Expand Down Expand Up @@ -567,7 +571,7 @@ jobs:
uses: actions/download-artifact@v3

- name: Upload to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.codecov_token }}
fail_ci_if_error: true # upload errors should be caught early
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ env:
jobs:
tests:
uses: ./.github/workflows/interface-unit-tests.yml
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
with:
branch: ${{ github.ref }}

Expand Down

0 comments on commit a38b24d

Please sign in to comment.