-
-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (31 loc) · 1.34 KB
/
Code-Coverage.yml
File metadata and controls
42 lines (31 loc) · 1.34 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
name: CodeCoverage
on:
push:
branches: [main]
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x' # Ersetzen Sie dies durch Ihre tatsächliche .NET SDK-Version
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude="[ByteBrusher.Records]*" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude="[ByteBrusher.Tests]*"
- name: Install ReportGenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Create Code Coverage Report
run: reportgenerator "-reports:**/TestResults/*/coverage.cobertura.xml" "-targetdir:coverage" -reporttypes:"Cobertura;HtmlInline_AzurePipelines"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # Optional: only required for private repos
directory: coverage/
files: Cobertura.xml
flags: unittests