Skip to content

Commit a4dc6cc

Browse files
drone-ahzgosalvez
andauthored
allow setting errors to ignore for genhtml (#292)
* allow setting errors to ignore for genhtml * Update index.js.map --------- Co-authored-by: Zennon Gosalvez <1798166+zgosalvez@users.noreply.github.com>
1 parent c2a8c97 commit a4dc6cc

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
@@ -112,6 +112,13 @@ async function genhtml(coverageFiles, tmpPath) {
112112
const artifactPath = path.resolve(tmpPath, 'html').trim();
113113
const args = [...coverageFiles, '--rc', 'lcov_branch_coverage=1'];
114114

115+
const ignoreErrors = core.getInput('genhtml-ignore-errors', { required: false }).trim();
116+
117+
if (ignoreErrors != '') {
118+
args.push('--ignore-errors');
119+
args.push(ignoreErrors);
120+
}
121+
115122
args.push('--output-directory');
116123
args.push(artifactPath);
117124

@@ -149,6 +156,13 @@ async function mergeCoverages(coverageFiles, tmpPath) {
149156
args.push('--output-file');
150157
args.push(mergedCoverageFile);
151158

159+
const ignoreErrors = core.getInput('genhtml-ignore-errors', { required: false }).trim();
160+
161+
if (ignoreErrors != '') {
162+
args.push('--ignore-errors');
163+
args.push(ignoreErrors);
164+
}
165+
152166
await exec.exec('lcov', [...args, '--rc', 'lcov_branch_coverage=1']);
153167

154168
return mergedCoverageFile;

0 commit comments

Comments
 (0)