Skip to content

Commit afdc33f

Browse files
authored
Add code coverage report (#192)
* Add code coverage report * update branches
1 parent 825cd40 commit afdc33f

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/code-coverage.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Code Coverage Report
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
name: CI Build
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: 8.0.x
23+
24+
- name: Restore Dependencies
25+
run: dotnet restore serilog-sinks-splunk.sln
26+
27+
- name: Build
28+
run: dotnet build serilog-sinks-splunk.sln --configuration Release --no-restore
29+
30+
- name: Test
31+
run: dotnet test serilog-sinks-splunk.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
32+
33+
- name: Code Coverage Report
34+
uses: irongut/[email protected]
35+
with:
36+
filename: coverage/**/coverage.cobertura.xml
37+
badge: true
38+
fail_below_min: false
39+
format: markdown
40+
hide_branch_rate: false
41+
hide_complexity: true
42+
indicators: true
43+
output: both
44+
thresholds: '60 80'
45+
46+
- name: Add Coverage PR Comment
47+
uses: marocchino/sticky-pull-request-comment@v2
48+
if: github.event_name == 'pull_request'
49+
with:
50+
recreate: true
51+
path: code-coverage-results.md

0 commit comments

Comments
 (0)