-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 1.87 KB
/
master-pr.yml
File metadata and controls
64 lines (61 loc) · 1.87 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
53
54
55
56
57
58
59
60
61
62
63
64
name: Pull Request - master
permissions:
pull-requests: write
on:
pull_request:
branches: [ master ]
paths-ignore:
- '.github/**'
- '.editorconfig'
- '.gitignore'
- '.gitattributes'
- 'CONTRIBUTING.md'
- 'LICENSE.txt'
- 'NuGet.config'
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup .NET 10.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore solution
run: dotnet restore
- name: Build solution
run: dotnet build --configuration Debug --no-restore -p:ContinuousIntegrationBuild=true
- name: Test solution
run: dotnet test --configuration Debug --no-build -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:UseSourceLink=true -p:CoverletOutput=../../coverage/
- name: Create code coverage summary
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: ./coverage/*.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: '90 95'
- name: Create code coverage HTML report
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.9
with:
reports: ./coverage/*.xml
targetdir: report
reporttypes: HtmlInline
- name: Upload code coverage HTML report as artifact
uses: actions/upload-artifact@v4
with:
name: CodeCoverageReport
path: report
- name: Add code coverage summary to PR
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: code-coverage-results.md
- name: Add code coverage summary to job summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY