Skip to content

Commit 27f276b

Browse files
authored
Merge pull request #1 from viboo-AG/add-diff-coverage
Add support for diff coverage reporting
2 parents 7dbd48c + 34249d5 commit 27f276b

8 files changed

Lines changed: 1400 additions & 1307 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ jobs:
2020
thresholdNew: 0.8
2121
thresholdModified: 0.0
2222
coverageFile: coverage.xml
23+
diffCoverageFile: coverage-diff.json

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
token:
99
required: true
1010
description: 'github token'
11+
diffCoverageFile:
12+
required: false
13+
description: 'local path to a diff coverage xml file like the output of diff-cover coverage.xml'
1114
thresholdAll:
1215
required: false
1316
description: the coverage threshold for average over all files [0,1]

coverage-diff.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"report_name": "XML",
3+
"diff_name": "origin/develop...HEAD, staged and unstaged changes",
4+
"src_stats": {
5+
"src/coverage.ts": {
6+
"percent_covered": 69,
7+
"violation_lines": [],
8+
"covered_lines": [
9+
12,
10+
367,
11+
370,
12+
371,
13+
372,
14+
373,
15+
378,
16+
379,
17+
380,
18+
381
19+
],
20+
"violations": [
21+
[
22+
368,
23+
null
24+
]
25+
]
26+
}
27+
},
28+
"total_num_lines": 45,
29+
"total_num_violations": 34,
30+
"total_percent_covered": 24,
31+
"num_changed_lines": 95
32+
}

0 commit comments

Comments
 (0)