Skip to content

Commit 03275e9

Browse files
authored
chore: v1.1.1 (#32)
1 parent 9767879 commit 03275e9

9 files changed

+43
-35
lines changed

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
# 1.1.1
2+
3+
- docs: README and metadata updates
4+
- feat: improve failure message
5+
16
# 1.1.0
27

38
- feat: added support to exclude files
49

510
```yaml
6-
uses: VGVentures/very-good-coverage@v1.1.0
11+
uses: VeryGoodOpenSource/very_good_coverage@v1.1.0
712
with:
813
path: "./coverage/lcov.info"
914
min_coverage: 95

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
## Example usage
4545

4646
```yaml
47-
uses: VeryGoodOpenSource/very_good_coverage@v1.1.0
47+
uses: VeryGoodOpenSource/very_good_coverage@v1.1.1
4848
with:
4949
path: "./coverage/lcov.info"
5050
min_coverage: 95

dist/index.js

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sourcemap-register.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
const core = require("@actions/core");
2-
const minimatch = require("minimatch");
3-
const parse = require("lcov-parse");
1+
const core = require('@actions/core');
2+
const minimatch = require('minimatch');
3+
const parse = require('lcov-parse');
44

55
function run() {
6-
const lcovPath = core.getInput("path");
7-
const minCoverage = core.getInput("min_coverage");
8-
const excluded = core.getInput("exclude");
9-
const excludedFiles = excluded.split(" ");
6+
const lcovPath = core.getInput('path');
7+
const minCoverage = core.getInput('min_coverage');
8+
const excluded = core.getInput('exclude');
9+
const excludedFiles = excluded.split(' ');
1010

11-
parse(lcovPath, function (_, data) {
12-
if (typeof data === "undefined") {
13-
core.setFailed("parsing error!");
11+
parse(lcovPath, (_, data) => {
12+
if (typeof data === 'undefined') {
13+
core.setFailed('parsing error!');
1414
return;
1515
}
1616
let totalFinds = 0;
1717
let totalHits = 0;
18-
data.forEach(element => {
19-
if (shouldCalculateCoverageForFile(element["file"], excludedFiles)) {
18+
data.forEach((element) => {
19+
if (shouldCalculateCoverageForFile(element['file'], excludedFiles)) {
2020
totalHits += element['lines']['hit'];
2121
totalFinds += element['lines']['found'];
2222
}
2323
});
2424
const coverage = (totalHits / totalFinds) * 100;
2525
const isValidBuild = coverage >= minCoverage;
2626
if (!isValidBuild) {
27-
core.setFailed(`Coverage ${coverage} is below the minimum ${minCoverage} expected`);
27+
core.setFailed(`${coverage} is less than min_coverage ${minCoverage}`);
2828
}
2929
});
3030
}

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "very-good-coverage",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "A Github Action which helps enforce code coverage threshold using lcov",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)