-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.42 KB
/
CodeCoverage.yaml
File metadata and controls
52 lines (41 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Code coverage
on:
push:
branches:
- master
workflow_dispatch:
env:
DOTNET_VERSION: '8.0'
jobs:
code-coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: >
dotnet test "tests/EffectiveResult.Tests/EffectiveResult.Tests.csproj" --configuration Release --no-build --collect:'XPlat Code Coverage' --settings coverlet.runsettings
- name: Move test results to accessible directory
run: |
mkdir TestResults
mv -v --backup=numbered tests/EffectiveResult.Tests/TestResults/*/*.* TestResults/
- name: Create Test Coverage Badge
uses: simon-k/dotnet-code-coverage-badge@v1.0.0
id: create_coverage_badge
with:
label: Unit Test Coverage
color: brightgreen
path: TestResults/coverage.opencover.xml
gist-filename: EffectiveResult-code-coverage.json
gist-id: 5ff54bc090435317ddc6be0b72289f04
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
- name: Print code coverage
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"