-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (47 loc) · 1.45 KB
/
code-coverage.yml
File metadata and controls
57 lines (47 loc) · 1.45 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
name: Code Coverage Report
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
coverage:
name: Generate Coverage Report
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore src/EChamado/EChamado.sln
- name: Build
run: dotnet build src/EChamado/EChamado.sln --configuration Release --no-restore
- name: Test with Coverage
run: |
dotnet test src/EChamado/EChamado.sln --configuration Release \
--no-build \
--verbosity normal \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=cobertura \
/p:CoverletOutput=./TestResults/
- name: Generate Coverage Report
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.10
with:
reports: '**/coverage.cobertura.xml'
targetdir: 'coveragereport'
reporttypes: 'Html;Badges'
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coveragereport
- name: Add Coverage Comment to PR
if: github.event_name == 'pull_request'
uses: 5monkeys/cobertura-action@master
with:
path: '**/coverage.cobertura.xml'
minimum_coverage: 70
fail_below_threshold: true