Skip to content

Commit

Permalink
add coverage reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
simontorres committed Jul 26, 2024
1 parent 05121f1 commit 7014251
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,34 @@ jobs:
- name: Run Tests
run: |
tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
- name: Upload coverage to artifacts
if: ${{ contains(matrix.toxenv,'-cov') }}
uses: actions/upload-artifacts@v4
with:
name: coverage_${{ matrix.toxenv }}.xml
path: coverage.xml
if-no-files-found: error

- uses: codecov/codecov-action@v4
upload-coverage-report:
needs: ['tests']
permissions:
contents: none
runs-on: ubuntu-latest
name: Upload Coverage
steps:
- name: Download coverage artifacts
uses: actions/download-artifacts@v4
with:
path: coverage
pattern: coverage_*
merge-multiple: true
- name: Upload to Codecov
if: ${{ hashFiles('coverage/') != ''}}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
fail_ci_if_error: true # optional (default = false)
verbose: true


0 comments on commit 7014251

Please sign in to comment.