Skip to content

Commit 8a31636

Browse files
author
hildebrind
committed
add option to generate test coverage report without codecov
1 parent c4b5480 commit 8a31636

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/tox.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,31 @@ jobs:
229229
uses: codecov/codecov-action@v4
230230
with:
231231
token: ${{ secrets.CODECOV_TOKEN }}
232+
233+
- name: Upload coverage data
234+
if: ${{ (success() || failure()) && contains(matrix.coverage, 'report') && matrix.pytest == 'true' }}
235+
uses: actions/upload-artifact@v4
236+
with:
237+
name: coverage-data-${{ matrix.os }}-${{ matrix.toxenv }}
238+
path: coverage.xml
239+
if-no-files-found: ignore
240+
241+
coverage:
242+
name: test coverage
243+
needs:
244+
- tox
245+
if: inputs.coverage == 'report'
246+
runs-on: ubuntu-latest
247+
steps:
248+
- uses: actions/checkout@v4
249+
- uses: actions/download-artifact@v4
250+
with:
251+
pattern: coverage-data-*
252+
merge-multiple: true
253+
- uses: actions/setup-python@v5
254+
with:
255+
python-version: "3.12"
256+
- run: python -Im pip install --upgrade coverage[toml]
257+
- run: python -Im coverage combine
258+
- run: python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
259+

0 commit comments

Comments
 (0)