Skip to content

Commit

Permalink
Add coverage comment even if it is decreasing
Browse files Browse the repository at this point in the history
Also clean-up the repo
  • Loading branch information
kalin-sa committed Jan 12, 2024
1 parent 96d249b commit e76f3ad
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 217 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
coverage/
.idea/
34 changes: 0 additions & 34 deletions .idea/workspace.xml

This file was deleted.

17 changes: 9 additions & 8 deletions dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23154,14 +23154,6 @@ async function main$1() {
const lcov = await parse$2(raw);
const baselcov = baseRaw && (await parse$2(baseRaw));
const newdelta = await delta(lcov, baselcov, options);
const threshold = parseFloat(covDecreaseThreshold);
if (newdelta < -1*threshold) {
console.info(`Coverage after merging is ${newdelta}% compare with baseline branch. Max coverage decrease should be ${threshold}%`);
if (shouldExitIfCoverageDecrease) {
console.info(`Exiting...`);
process.exit(1);
}
}

const body = diff(lcov, baselcov, options).substring(0, MAX_COMMENT_CHARS);

Expand All @@ -23184,6 +23176,15 @@ async function main$1() {
body: body,
});
}

const threshold = parseFloat(covDecreaseThreshold);
if (newdelta < -1*threshold) {
console.info(`Coverage after merging is ${newdelta}% compare with baseline branch. Max coverage decrease should be ${threshold}%`);
if (shouldExitIfCoverageDecrease) {
console.info(`Exiting...`);
process.exit(1);
}
}
}

main$1().catch(function(err) {
Expand Down
3 changes: 0 additions & 3 deletions gcov2lcov-action/.gitignore

This file was deleted.

31 changes: 0 additions & 31 deletions gcov2lcov-action/CHANGELOG.md

This file was deleted.

21 changes: 0 additions & 21 deletions gcov2lcov-action/LICENSE

This file was deleted.

74 changes: 0 additions & 74 deletions gcov2lcov-action/README.md

This file was deleted.

34 changes: 0 additions & 34 deletions gcov2lcov-action/action.yml

This file was deleted.

3 changes: 0 additions & 3 deletions gcov2lcov-action/testdata/go.mod

This file was deleted.

1 change: 0 additions & 1 deletion gcov2lcov-action/testdata/main.go

This file was deleted.

17 changes: 9 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ async function main() {
const lcov = await parse(raw)
const baselcov = baseRaw && (await parse(baseRaw))
const newdelta = await delta(lcov, baselcov, options)
const threshold = parseFloat(covDecreaseThreshold)
if (newdelta < -1*threshold) {
console.info(`Coverage after merging is ${newdelta}% compare with baseline branch. Max coverage decrease should be ${threshold}%`)
if (shouldExitIfCoverageDecrease) {
console.info(`Exiting...`)
process.exit(1)
}
}

const body = diff(lcov, baselcov, options).substring(0, MAX_COMMENT_CHARS)

Expand All @@ -93,6 +85,15 @@ async function main() {
body: body,
})
}

const threshold = parseFloat(covDecreaseThreshold)
if (newdelta < -1*threshold) {
console.info(`Coverage after merging is ${newdelta}% compare with baseline branch. Max coverage decrease should be ${threshold}%`)
if (shouldExitIfCoverageDecrease) {
console.info(`Exiting...`)
process.exit(1)
}
}
}

main().catch(function(err) {
Expand Down

0 comments on commit e76f3ad

Please sign in to comment.