Skip to content

Commit

Permalink
ci: sort diff/miss columns in coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed May 15, 2024
1 parent 8b7d50f commit dadb498
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,28 @@ jobs:
# Report and write to summary.
echo '## Coverage Report' > /tmp/report.md
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 }} --precision=${{ inputs.precision }} --fail-under=base >> /tmp/report.md || status=$?
if git show "${{ inputs.coverage-branch }}:${{ inputs.coverage-report }}" > /tmp/main-coverage.txt; then
coverage report \
--skip-covered \
--skip-empty \
--show-missing \
--precision="${{ inputs.precision }}" \
--sort=-diff \
--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=${{ inputs.base-branch }} --precision=${{ inputs.precision }} >> /tmp/report.md || status=$?
coverage report \
--skip-covered \
--skip-empty \
--show-missing \
--precision="${{ inputs.precision }}" \
--sort=-miss \
--format=diff \
--base-revision="${{ inputs.base-branch }}" \
>> /tmp/report.md || status=$?
fi
cat /tmp/report.md >> $GITHUB_STEP_SUMMARY
Expand Down

0 comments on commit dadb498

Please sign in to comment.