[DO NOT REVIEW] Updating code coverage #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Coverage | |
permissions: | |
contents: read | |
pull-requests: write | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
continue-on-error: true | |
name: MSAL GitHub Actions | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Setup .NET 6.0.x | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 6.0.x | |
- name: Create code coverage report | |
run: | | |
dotnet tool install -g dotnet-reportgenerator-globaltool | |
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub;Cobertura' | |
- name: Write Coverage to Job Summary | |
shell: bash | |
run: | | |
cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
echo "COMMENT_CONTENT_ENV_VAR<<EOF" >> $GITHUB_ENV | |
echo $(cat CodeCoverage/SummaryGithub.md) >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Comment Coverage in PR | |
uses: actions/github-script@v7 | |
id: comment | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: process.env.COMMENT_CONTENT_ENV_VAR | |
}) |