fix: coverlet.collector is integrated by test runner #2
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: Unit Test with .NET | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET tools | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Restore NuGet dependencies | |
run: | | |
dotnet restore ./src/Plana.sln | |
- name: Build | |
run: | | |
dotnet build ./src/Plana.sln --no-restore --configuration=Release | |
- name: Test | |
run: | | |
dotnet test ./src/Plana.sln --no-restore --verbosity=normal --collect="XPlat Code Coverage" --results-directory=./coverage | |
- name: Publish Coverage | |
uses: irongut/CodeCoverageSummary@v1.3.0 | |
with: | |
filename: coverage/**/coverage.cobertura.xml | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: "60 80" | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
recreate: true | |
path: code-coverage-results.md |