Skip to content

Commit

Permalink
Also test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kytta committed Sep 7, 2024
1 parent d432dba commit 58da7d1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,44 @@ jobs:

- name: Test
run: python -Im tox run --installpkg dist/*.whl -f py$(echo ${{ matrix.python-version }} | tr -d .)

- name: Upload coverage data
uses: actions/upload-artifact@v4
if: startsWith(matrix.os, 'ubuntu-')
with:
name: coverage-data-${{ matrix.python-version }}
path: .coverage.*
include-hidden-files: true
if-no-files-found: ignore

coverage:
name: Combine & check coverage
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x

- uses: astral-sh/setup-uv@v1
- run: uv pip install --system --upgrade coverage[toml] covdefaults
- uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true

- name: Combine coverage & report
run: |
python -Im coverage combine
python -Im coverage html --skip-covered --skip-empty || true
# Report and write to summary.
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: htmlcov
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ lint.select = [
addopts = "--tb=short --showlocals"

[tool.coverage.run]
parallel = true
plugins = [ "covdefaults" ]

[tool.mypy]
Expand Down

0 comments on commit 58da7d1

Please sign in to comment.