upload-coverage #133
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: upload-coverage | |
| on: | |
| workflow_run: | |
| workflows: [ test-with-coverage ] | |
| types: [ completed ] | |
| jobs: | |
| upload-coverage: | |
| if: > | |
| github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Download coverage artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| run-id: ${{ github.event.workflow_run.id }} | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| # The 'files' attribute consists of 'coverage/coverage.txt'. | |
| # The 'coverage' directory is created upon the download of the coverage artifact from previous step (it creates a directory with the name of the artifact). | |
| files: coverage/coverage.txt | |
| flags: unittests # optional | |
| fail_ci_if_error: true | |
| verbose: true |