Skip to content

Commit

Permalink
Output total percentage coverage (#47)
Browse files Browse the repository at this point in the history
* Output total percentage coverage

* Consistent naming

Co-authored-by: Zennon Gosalvez <[email protected]>
  • Loading branch information
bartosz347 and zgosalvez authored Dec 30, 2022
1 parent 369eb1e commit 3da0a76
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For more information on these inputs, see the [Workflow syntax for GitHub Action
- `title-prefix`: A prefix before the title "LCOV of commit..." Optional. Default: ``

### Outputs
None.
- `total-coverage`: The total coverage from scanned files.

Sample comment:
![Screenshot](assets/comment.png)
Expand Down Expand Up @@ -57,4 +57,4 @@ jobs:
This is used in my opinionated [GitHub Actions: Flutter Workflows](https://github.com/zgosalvez/github-actions-flutter-workflows) repository along with other actions for a complete end-to-end DevOps experience.

## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)
The scripts and documentation in this project are released under the [MIT License](LICENSE)
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ inputs:
title-prefix:
description: 'A prefix before the title "LCOV of commit..." Optional. Default: ``'
required: false
outputs:
total-coverage:
description: 'The total coverage from scanned files.'

runs:
using: 'node16'
main: 'dist/main/index.js'
post: 'dist/post/index.js'
branding:
icon: umbrella
color: purple
color: purple
2 changes: 2 additions & 0 deletions dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ async function run() {
core.info("Note: This could happen even if github-token was provided in workflow file. It could be because your github token does not have permissions for commenting in target repo.")
}

core.setOutput("total-coverage", totalCoverage);

if (isFailure) {
throw Error(errorMessage);
}
Expand Down

0 comments on commit 3da0a76

Please sign in to comment.