Skip to content

Commit fa6ac8a

Browse files
committed
Coverage: add detailed report to job summary
1 parent 67d37fe commit fa6ac8a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ jobs:
180180
echo "Creating coverage report..."
181181
# Create xml file for further processing; Create even if below minimum
182182
coverage xml --fail-under=0
183+
# Write markdown report to job summary
184+
coverage report --format=markdown -m >> $GITHUB_STEP_SUMMARY
183185
184186
# For future use in case we want to add a PR comment for 3rd party PRs which requires
185187
# a workflow with elevated PR write permissions. Move below steps into a separate job.
@@ -210,6 +212,11 @@ jobs:
210212
# Note: it appears fail below min is one off, use fail_under -1 here
211213
thresholds: '95 98'
212214

215+
- name: Add link to report badge
216+
run: |
217+
run_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}
218+
sed -i "1s|^\(!.*\)$|[\1]($run_url)|" code-coverage-results.md
219+
213220
- name: Add Coverage PR Comment
214221
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2.9.3
215222
# Create PR comment when the branch is on the repo, otherwise we lack PR write permissions

0 commit comments

Comments
 (0)