Skip to content

Code coverage

Code coverage #3

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
with:
submodules: true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --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}}%"