diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 8799b38b..5546d196 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -144,6 +144,10 @@ 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 @@ -151,12 +155,31 @@ jobs: 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