Skip to content

Commit

Permalink
Faster coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Feb 3, 2025
1 parent 95b93a7 commit 659358b
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,37 +58,42 @@ jobs:
if-no-files-found: ignore
if: runner.os == 'Linux'


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

steps:
- uses: actions/checkout@v4
- name: Download pre-built packages
uses: actions/download-artifact@v4
with:
persist-credentials: false
name: Packages
path: dist
- run: tar xf dist/*.tar.gz --strip-components=1
- uses: actions/setup-python@v5
with:
python-version-file: .python-version-default
cache: pip
- uses: hynek/setup-cached-uv@v2

- uses: actions/download-artifact@v4
- name: Download coverage data
uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true

- name: Combine coverage & fail if it's <100%.
run: |
python -Im pip install --upgrade coverage[toml]
uv tool install coverage
python -Im coverage combine
python -Im coverage html --skip-covered --skip-empty
coverage combine
coverage html --skip-covered --skip-empty
# Report and write to summary.
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
# Report again and fail if under 100%.
python -Im coverage report --fail-under=100
coverage report --fail-under=100
- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -117,6 +122,7 @@ jobs:
- run: python -c 'import doc2dash; print(doc2dash.__title__)'
- run: python -Im doc2dash --version


required-checks-pass:
name: Ensure everything required is passing for branch protection
if: always()
Expand Down

0 comments on commit 659358b

Please sign in to comment.