Skip to content

Commit bdd27ff

Browse files
committed
Initial
0 parents  commit bdd27ff

File tree

12,086 files changed

+1406662
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

12,086 files changed

+1406662
-0
lines changed

.eslintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": [
3+
"plugin:prettier/recommended"
4+
],
5+
"env": {
6+
"es6": true,
7+
"node": true
8+
},
9+
"parserOptions": {
10+
"ecmaVersion": 2018
11+
}
12+
}

.github/workflows/main.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
types: opened
6+
branches:
7+
- master
8+
push:
9+
branches:
10+
- master
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: '12.x'
20+
- run: npm ci
21+
- run: npm run lint
22+
- run: npm test
23+
- name: coverage
24+
if: github.event_name == 'pull_request'
25+
uses: ./
26+
with:
27+
path: coverage/cobertura-coverage.xml
28+
repo_token: ${{ secrets.GITHUB_TOKEN }}
29+
minimum_coverage: 75
30+

.gitignore

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
jspm_packages/
42+
43+
# TypeScript v1 declaration files
44+
typings/
45+
46+
# TypeScript cache
47+
*.tsbuildinfo
48+
49+
# Optional npm cache directory
50+
.npm
51+
52+
# Optional eslint cache
53+
.eslintcache
54+
55+
# Microbundle cache
56+
.rpt2_cache/
57+
.rts2_cache_cjs/
58+
.rts2_cache_es/
59+
.rts2_cache_umd/
60+
61+
# Optional REPL history
62+
.node_repl_history
63+
64+
# Output of 'npm pack'
65+
*.tgz
66+
67+
# Yarn Integrity file
68+
.yarn-integrity
69+
70+
# dotenv environment variables file
71+
.env
72+
.env.test
73+
74+
# parcel-bundler cache (https://parceljs.org/)
75+
.cache
76+
77+
# next.js build output
78+
.next
79+
80+
# nuxt.js build output
81+
.nuxt
82+
83+
# gatsby files
84+
.cache/
85+
public
86+
87+
# vuepress build output
88+
.vuepress/dist
89+
90+
# Serverless directories
91+
.serverless/
92+
93+
# FuseBox cache
94+
.fusebox/
95+
96+
# DynamoDB Local files
97+
.dynamodb/
98+
99+
!node_modules/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 5 Monkeys
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

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Cobertura action
2+
3+
![](https://github.com/5monkeys/cobertura-action/workflows/Test/badge.svg)
4+
5+
GitHub Action which parse a [XML cobertura report](http://cobertura.github.io/cobertura/) and display the metrics in a GitHub Pull Request.
6+
7+
Many coverage tools can be configured to output cobertura reports:
8+
9+
* [coverage.py](https://coverage.readthedocs.io/en/latest/cmd.html#xml-reporting)
10+
* [Istanbul](https://istanbul.js.org/docs/advanced/alternative-reporters/#cobertura)
11+
* [Maven](https://www.mojohaus.org/cobertura-maven-plugin/)
12+
* [simplecov](https://github.com/colszowka/simplecov/blob/master/doc/alternate-formatters.md#simplecov-cobertura)
13+
14+
## How it looks like
15+
16+
![alt text](img/comment.png "Pull request comment with metrics")
17+
18+
## Inputs
19+
20+
### `repo_token` **Required**
21+
22+
The GITHUB_TOKEN. See [details](https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret).
23+
24+
### `path`
25+
26+
The to the cobertura report. Defaults to `coverage.xml`.
27+
28+
### `skip_covered`
29+
30+
If files with 100% coverage should be ignored. Defaults to `true`.
31+
32+
### `minimum_coverage`
33+
34+
The minimum allowed coverage percentage as an integer.
35+
36+
### `show_line`
37+
38+
Show line rate as specific column.
39+
40+
### `show_branch`
41+
42+
Show branch rate as specific column.
43+
44+
## Example usage
45+
46+
```yaml
47+
on:
48+
pull_request:
49+
types: [opened]
50+
branches:
51+
- master
52+
jobs:
53+
coverage:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: 5monkeys/cobertura-action@master
57+
with:
58+
path: src/test.xml
59+
repo_token: ${{ secrets.GITHUB_TOKEN }}
60+
minimum_coverage: 75
61+
```

action.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'cobertura'
2+
description: Report cobertura coverage reports in Pull Requests
3+
inputs:
4+
repo_token:
5+
description: 'The GITHUB_TOKEN for this repo'
6+
required: true
7+
path:
8+
description: 'Path to the cobertura file.'
9+
required: true
10+
default: 'coverage.xml'
11+
skip_covered:
12+
description: 'If files with 100% should be skipped from report.'
13+
required: true
14+
default: true
15+
minimum_coverage:
16+
description: 'Minimum allowed coverage percentage as an integer.'
17+
required: true
18+
show_line:
19+
description: 'Show line rate as specific column.'
20+
required: true
21+
default: false
22+
show_branch:
23+
description: 'Show branch rate as specific column.'
24+
required: true
25+
default: false
26+
runs:
27+
using: 'node12'
28+
main: 'index.js'
29+
branding:
30+
icon: 'percent'
31+
color: 'green'

img/comment.png

89.9 KB
Loading

index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const core = require("@actions/core");
2+
const github = require("@actions/github");
3+
const { action } = require("./src/action");
4+
5+
action(github.context.payload).catch(error => {
6+
// Action threw an error. Fail the action with the error message.
7+
core.setFailed(error.message);
8+
});

node_modules/.bin/acorn

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

node_modules/.bin/atob

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

node_modules/.bin/escodegen

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

node_modules/.bin/esgenerate

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

node_modules/.bin/eslint

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

node_modules/.bin/eslint-config-prettier-check

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

node_modules/.bin/esparse

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

node_modules/.bin/esvalidate

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

node_modules/.bin/handlebars

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

node_modules/.bin/import-local-fixture

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

node_modules/.bin/is-ci

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

node_modules/.bin/jest

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

node_modules/.bin/jest-runtime

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

node_modules/.bin/js-yaml

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

node_modules/.bin/jsesc

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

node_modules/.bin/json5

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

node_modules/.bin/loose-envify

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

node_modules/.bin/mkdirp

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

node_modules/.bin/parser

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

node_modules/.bin/prettier

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

node_modules/.bin/rimraf

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

node_modules/.bin/sane

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

node_modules/.bin/semver

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

node_modules/.bin/sshpk-conv

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

node_modules/.bin/sshpk-sign

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

node_modules/.bin/sshpk-verify

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

node_modules/.bin/uglifyjs

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

node_modules/.bin/uuid

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

node_modules/.bin/watch

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

node_modules/.bin/which

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

0 commit comments

Comments
 (0)