Skip to content

Code coverage

Code coverage #8

Workflow file for this run

name: Unit Test With Coverage
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
SAMPLES_FOLDER: "../../../../samples"
OUTPUT_SAMPLES_FOLDER: "../../../../samples/out"
OUTPUT_SINGLE_CASES_FOLDER: "../../../../samples/out/single_cases"
LOCAL_ENV: "false"
DELTA: "0.00001"
DECIMAL_PRECISION: "5"
RUN_DWG_WRITER_SINGLE_CASES_TEST: "false"
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 --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: ${{ github.token }}
- name: Print code coverage
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"