Skip to content

Commit

Permalink
add option to generate test coverage report without codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Jun 9, 2024
1 parent c4b5480 commit 8a31636
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,31 @@ jobs:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage data
if: ${{ (success() || failure()) && contains(matrix.coverage, 'report') && matrix.pytest == 'true' }}
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.os }}-${{ matrix.toxenv }}
path: coverage.xml
if-no-files-found: ignore

coverage:
name: test coverage
needs:
- tox
if: inputs.coverage == 'report'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python -Im pip install --upgrade coverage[toml]
- run: python -Im coverage combine
- run: python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY

0 comments on commit 8a31636

Please sign in to comment.