Skip to content

Code coverage

Code coverage #1

Workflow file for this run

name: Unit Test With Coverage
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=opencover --no-build --verbosity normal ACadSharp.Tests/
- name: Create Test Coverage Badge
uses: simon-k/[email protected]
id: create_coverage_badge
with:
label: Unit Test Coverage
color: brightgreen
path: ACadSharp.Tests/TestResults/coverage.opencover.xml
gist-filename: code-coverage.json
gist-id: 1234567890abcdef1234567890abcdef
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
- name: Print code coverage
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"