Skip to content

Commit d714788

Browse files
committed
allow setting errors to ignore for genhtml
1 parent 5989987 commit d714788

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ inputs:
1212
minimum-coverage:
1313
description: 'The minimum coverage to pass the check. Optional. Default: `0` (always passes)'
1414
default: 0
15+
genhtml-ignore-errors:
16+
description: errors genhtml should ignore. See https://man.archlinux.org/man/genhtml.1.en for more information
17+
default:
1518
github-token:
1619
description: 'Set the GitHub token to have the action comment the coverage summary in the pull request. This token is provided by Actions, you do not need to create your own token. Optional. Default: ``'
1720
working-directory:

dist/main/index.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ async function genhtml(coverageFiles, tmpPath) {
107107
const artifactPath = path.resolve(tmpPath, 'html').trim();
108108
const args = [...coverageFiles, '--rc', 'lcov_branch_coverage=1'];
109109

110+
const ignoreErrors = core.getInput('genhtml-ignore-errors', { required: false }).trim();
111+
112+
if (ignoreErrors != '') {
113+
args.push('--ignore-errors');
114+
args.push(ignoreErrors);
115+
}
116+
110117
args.push('--output-directory');
111118
args.push(artifactPath);
112119

@@ -144,6 +151,13 @@ async function mergeCoverages(coverageFiles, tmpPath) {
144151
args.push('--output-file');
145152
args.push(mergedCoverageFile);
146153

154+
const ignoreErrors = core.getInput('genhtml-ignore-errors', { required: false }).trim();
155+
156+
if (ignoreErrors != '') {
157+
args.push('--ignore-errors');
158+
args.push(ignoreErrors);
159+
}
160+
147161
await exec.exec('lcov', [...args, '--rc', 'lcov_branch_coverage=1']);
148162

149163
return mergedCoverageFile;

0 commit comments

Comments
 (0)