Skip to content

chore: Bump coverlet.collector from 6.0.4 to 10.0.0 #217

chore: Bump coverlet.collector from 6.0.4 to 10.0.0

chore: Bump coverlet.collector from 6.0.4 to 10.0.0 #217

Workflow file for this run

# Code Coverage Workflow
# Runs tests with coverage and uploads to Codecov
# Documentation: https://docs.codecov.com/docs
name: Code Coverage
permissions:
contents: read
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
coverage:
name: Generate Coverage Report
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: |
cd TerminplanerApi
dotnet restore
- name: Build API
run: |
cd TerminplanerApi
dotnet build --configuration Release --no-restore
- name: Run tests with coverage
run: |
dotnet test TerminplanerApi.Tests/TerminplanerApi.Tests.csproj \
--configuration Release \
--verbosity normal \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage
- name: List coverage files
run: find ./coverage -name "*.xml" -type f
# Upload to Codecov (requires CODECOV_TOKEN secret to be set)
# After installing Codecov from GitHub Marketplace, the token will be available
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage/**/coverage.cobertura.xml
fail_ci_if_error: false
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ./coverage/**/coverage.cobertura.xml
retention-days: 30