Skip to content

Commit

Permalink
coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Sep 21, 2024
1 parent 5921707 commit 2403ecf
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,42 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version-file: .python-version-default
- uses: hynek/setup-cached-uv@v2

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

- name: Combine coverage & fail if it's <100%.
run: |
uv tool install 'coverage[toml]>7'
coverage combine
coverage html --skip-covered --skip-empty --show-missing
# Report and write to summary.
coverage report --skip-covered --skip-empty --show-missing --format=markdown >> $GITHUB_STEP_SUMMARY
## Report again and fail if under 100%.
#coverage report --fail-under=100
- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
#if: ${{ failure() }}

- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_COVERAGE_FILES: true

- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 2403ecf

Please sign in to comment.