Skip to content

Coverage Report

Coverage Report #139

name: 'Coverage Report'
on:
workflow_run:
workflows: [ 'Tests' ]
types:
- completed
concurrency: coverage-report
permissions: { }
jobs:
report:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
permissions:
contents: read
actions: read
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
- name: Download Coverage Report Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: dotnet-coverage-on-${{ matrix.os }}
path: coverage
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
with:
filename: coverage/Cobertura.xml
badge: true
format: markdown
output: both
- name: Add platform info
shell: bash
run: |
echo -e "Platform: \`${{ matrix.os }}\` \n" >> code-coverage-results-${{ matrix.os }}.md
cat code-coverage-results.md >> code-coverage-results-${{ matrix.os }}.md
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
if: github.event.workflow_run.pull_requests[0].number
with:
recreate: true
path: code-coverage-results-${{ matrix.os }}.md
header: ${{ matrix.os }}
number: ${{ github.event.workflow_run.pull_requests[0].number }}
- name: Write coverage summary
shell: bash
run: |
cat code-coverage-results-${{ matrix.os }}.md >> $GITHUB_STEP_SUMMARY