-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (31 loc) · 1.03 KB
/
cov.yml
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
name: Coverage
on:
push:
branches: [ main ]
paths: [ 'lib/**', 'tests/**', '.github/workflows/cov.yml' ]
tags: '*'
pull_request:
branches: [ main ]
paths: [ 'lib/**', 'tests/**', '.github/workflows/cov.yml' ]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.x'
- name: Install dependencies
run: dotnet tool install -g dotnet-reportgenerator-globaltool
- name: Perform tests and generate coverage
run: dotnet test --verbosity normal --collect:"XPlat Code Coverage" tests
- name: Consolidate tests reports
run: reportgenerator "-reports:tests/**/coverage.cobertura.xml" "-targetdir:coveragereport" -reporttypes:cobertura
- name: Publish coverage report to codecov
uses: codecov/codecov-action@v3
with:
files: ./coveragereport/Cobertura.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true