-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.24 KB
/
coverage-report.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build with Markdown Report
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build-and-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Run tests
run: dotnet test --no-restore --no-build --collect:"XPlat Code Coverage"
- name: ReportGenerator
uses: danielpalme/[email protected]
with:
reports: coverage.cobertura.xml
targetdir: ${{github.workspace}}/report
reporttypes: MarkdownSummary
- name: Upload reports
uses: actions/upload-artifact@v2
if: ${{always()}}
with:
name: 'Code Coverage'
path: |
${{github.workspace}}/report
- name: Comments on PR with coverage report results
uses: marocchino/sticky-pull-request-comment@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
recreate: true
header: Coverage Report
path: ${{github.workspace}}/report/SummaryGithub.md