Skip to content

Commit

Permalink
ci: fix main coverage badge generation
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed May 15, 2024
1 parent 7ddb8b0 commit a7e4315
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
if git show ${{ inputs.coverage-branch }}:${{ inputs.coverage-report }} > /tmp/main-coverage.txt; then
coverage report --skip-covered --skip-empty --show-missing --format=diff --base-coverage-report=/tmp/main-coverage.txt --base-revision=${{ inputs.base-branch }} --fail-under=base >> /tmp/report.md || status=$?
else
coverage report --skip-covered --skip-empty --show-missing --format=diff --base-revision=main >> /tmp/report.md || status=$?
coverage report --skip-covered --skip-empty --show-missing --format=diff --base-revision=${{ inputs.base-branch }} >> /tmp/report.md || status=$?
fi
cat /tmp/report.md >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -119,12 +119,13 @@ jobs:
- uses: actions/checkout@v4
with:
repository: aphp/foldedtensor
sparse-checkout-cone-mode: false
sparse-checkout: |
.github/workflows/generate_badge.py
- name: Combine coverage and generate the report and the badge
run: |
python -Im pip install --upgrade "git+https://github.com/percevalw/coveragepy.git[toml]"
python -Im pip install --upgrade "git+https://github.com/percevalw/coveragepy.git#egg=coverage[toml]"
python -Im coverage combine
coverage report --show-missing > /tmp/main-coverage.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
uses: ./.github/workflows/coverage.yml
with:
base-branch: main
coverage-data-pattern: coverage-data-*.xml
coverage-data-pattern: coverage-data-*
coverage-report: coverage.txt
coverage-badge: coverage.svg
coverage-branch: coverage
Expand Down

0 comments on commit a7e4315

Please sign in to comment.