Skip to content

Bump coverlet.collector from 6.0.4 to 8.0.0 #53

Bump coverlet.collector from 6.0.4 to 8.0.0

Bump coverlet.collector from 6.0.4 to 8.0.0 #53

Workflow file for this run

name: Test
on: [push, pull_request]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Install ReportGenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Check Code Coverage
run: |
reportgenerator -reports:"**/coverage.cobertura.xml" -targetdir:"coverage-report" -reporttypes:"JsonSummary"
$json = Get-Content "coverage-report/Summary.json" | ConvertFrom-Json
$lineRate = [math]::Round($json.summary.linecoverage, 2)
Write-Host "Line Coverage: $lineRate%"
if ($lineRate -lt 95) {
Write-Error "Code coverage ($lineRate%) is below the required threshold of 95%"
exit 1
}
shell: pwsh
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
files: '**/coverage.cobertura.xml'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}