Skip to content

Commit de737e7

Browse files
committed
Initial commit
0 parents  commit de737e7

File tree

14 files changed

+20456
-0
lines changed

14 files changed

+20456
-0
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.eslintrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"env": {
3+
"commonjs": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": "eslint:recommended",
8+
"globals": {
9+
"Atomics": "readonly",
10+
"SharedArrayBuffer": "readonly"
11+
},
12+
"parserOptions": {
13+
"ecmaVersion": 2018
14+
},
15+
"rules": {
16+
}
17+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/** -diff linguist-generated=true

.gitignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
node_modules/
2+
3+
# Editors
4+
.vscode/
5+
.idea/
6+
*.iml
7+
8+
# Logs
9+
logs
10+
*.log
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
15+
# Runtime data
16+
pids
17+
*.pid
18+
*.seed
19+
*.pid.lock
20+
21+
# Directory for instrumented libs generated by jscoverage/JSCover
22+
lib-cov
23+
24+
# Coverage directory used by tools like istanbul
25+
coverage
26+
27+
# nyc test coverage
28+
.nyc_output
29+
30+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
31+
.grunt
32+
33+
# Bower dependency directory (https://bower.io/)
34+
bower_components
35+
36+
# node-waf configuration
37+
.lock-wscript
38+
39+
# Compiled binary addons (https://nodejs.org/api/addons.html)
40+
build/Release
41+
42+
# Other Dependency directories
43+
jspm_packages/
44+
45+
# TypeScript v1 declaration files
46+
typings/
47+
48+
# Optional npm cache directory
49+
.npm
50+
51+
# Optional eslint cache
52+
.eslintcache
53+
54+
# Optional REPL history
55+
.node_repl_history
56+
57+
# Output of 'npm pack'
58+
*.tgz
59+
60+
# Yarn Integrity file
61+
.yarn-integrity
62+
63+
# dotenv environment variables file
64+
.env
65+
66+
# next.js build output
67+
.next

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Zennon Gosalvez
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# GitHub Action — Report LCOV
2+
3+
This GitHub Action (written in JavaScript) allows you to leverage GitHub Actions to report the code coverage from LCOV files. This action includes:
4+
- Generating an HTML report as an artifact
5+
- Commenting on a pull request (if the workflow was triggered by this event)
6+
- Failing if a minimum coverage is not met
7+
8+
## Usage
9+
### Pre-requisites
10+
Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#common-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
11+
12+
### Inputs
13+
For more information on these inputs, see the [Workflow syntax for GitHub Actions](https://docs.github.com/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepswith)
14+
15+
- `coverage-files`: The coverage files to scan. For example, `coverage/lcov.*.info`
16+
- `artifact-name`: The GitHub artifact name of the generated HTML report. For example, `code-coverage-report`. _Note:_ When downloading, it will be extracted in an `html` directory
17+
- `minimum-coverage`: The minimum coverage to pass the check. Optional. Default: `0` (always passes)
18+
- `github-token`: Set the `${{ secrets.GITHUB_TOKEN }}` 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: ``
19+
20+
### Outputs
21+
None.
22+
23+
### Common workflow
24+
25+
Ideally, set this up as an initial job for your workflows. For example:
26+
```yaml
27+
on: push
28+
29+
name: Continuous Integration
30+
31+
jobs:
32+
harden_security:
33+
name: Harden Security
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
38+
- name: Ensure SHA pinned actions
39+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@v1.0.1 # Replace this
40+
```
41+
42+
### Flutter Workflows
43+
44+
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.
45+
46+
## License
47+
The scripts and documentation in this project are released under the [MIT License](LICENSE)

action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# https://github.com/actions/javascript-action
2+
3+
name: 'Report LCOV'
4+
description: 'Report the code coverage from LCOV files'
5+
author: 'Zennon Gosalvez'
6+
inputs:
7+
coverage-files:
8+
description: 'The coverage files to scan. For example, `coverage/lcov.*.info`'
9+
required: true
10+
artifact-name:
11+
description: 'The GitHub artifact name of the generated HTML report. For example, `code-coverage-report`. _Note:_ When downloading, it will be extracted in an `html` directory'
12+
required: true
13+
minimum-coverage:
14+
description: 'The minimum coverage to pass the check. Optional. Default: `0` (always passes)'
15+
default: 0
16+
github-token:
17+
description: 'Set the `${{ secrets.GITHUB_TOKEN }}` 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: ``'
18+
runs:
19+
using: 'node12'
20+
main: 'dist/index.js'
21+
branding:
22+
icon: umbrella
23+
color: purple

0 commit comments

Comments
 (0)