mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
69 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
239febf655 | ||
|
|
089f66bf94 | ||
|
|
97477378d5 | ||
|
|
5aab34a5de | ||
|
|
7bd0b70f4c | ||
|
|
e1530fdc6a | ||
|
|
4093ac2f32 | ||
|
|
f1824ac807 | ||
|
|
3fbed96f43 | ||
|
|
54f44cc9f4 | ||
|
|
a74dfd1451 | ||
|
|
5bdef2c17a | ||
|
|
7d5dfa5490 | ||
|
|
5f38498d62 | ||
|
|
8b6b12970b | ||
|
|
283d2693b9 | ||
|
|
dade30aaa0 | ||
|
|
45781c3764 | ||
|
|
4ebd4afddb | ||
|
|
55d6a07412 | ||
|
|
becb93ba4e | ||
|
|
a7c76ea20b | ||
|
|
36d7ee02e2 | ||
|
|
2c9a90e8ef | ||
|
|
c76d967024 | ||
|
|
182414a4c5 | ||
|
|
1daf42f4a6 | ||
|
|
0445c85879 | ||
|
|
ec5dd54001 | ||
|
|
563896ed23 | ||
|
|
7051d617d5 | ||
|
|
e251b2328e | ||
|
|
9c8364c4b9 | ||
|
|
2ce6928a47 | ||
|
|
97889d423a | ||
|
|
f32c526fb6 | ||
|
|
f40be2e051 | ||
|
|
c838bce9ba | ||
|
|
a10ae7dc1c | ||
|
|
7b58dd4615 | ||
|
|
4c21e05017 | ||
|
|
c5e41a8c86 | ||
|
|
59ad392722 | ||
|
|
2df0a7632f | ||
|
|
b9325ac3dd | ||
|
|
1d594a8c0e | ||
|
|
d02c2109fe | ||
|
|
529a536f37 | ||
|
|
dba9e16939 | ||
|
|
6ebb0218c1 | ||
|
|
59241bde96 | ||
|
|
6228851670 | ||
|
|
5e530f4a66 | ||
|
|
f08bd0b1cb | ||
|
|
48269c03b1 | ||
|
|
abd3026ea7 | ||
|
|
076efa6234 | ||
|
|
ff34c520be | ||
|
|
703dcd27a4 | ||
|
|
e2ce2d2a09 | ||
|
|
d035c0b282 | ||
|
|
ef391107f0 | ||
|
|
912b097972 | ||
|
|
86a2fa8deb | ||
|
|
6004246f47 | ||
|
|
5d3f01ccdc | ||
|
|
2d80980946 | ||
|
|
fadbb25281 | ||
|
|
ad774549da |
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@@ -17,3 +17,11 @@ jobs:
|
|||||||
file: ./coverage/coverage-final.json
|
file: ./coverage/coverage-final.json
|
||||||
flags: unittest
|
flags: unittest
|
||||||
name: codecov-1
|
name: codecov-1
|
||||||
|
- name: Upload coverage to Codecov (verbose)
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
|
||||||
|
file: ./coverage/coverage-final.json
|
||||||
|
flags: unittest
|
||||||
|
name: codecov-1
|
||||||
|
verbose: true
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Codecov GitHub Action
|
# Codecov GitHub Action
|
||||||
|
|
||||||
[](https://github.com/marketplace/actions/codecov)
|
[](https://github.com/marketplace/actions/codecov)
|
||||||
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_shield)
|
||||||
### Easily upload coverage reports to Codecov from GitHub Actions
|
### Easily upload coverage reports to Codecov from GitHub Actions
|
||||||
|
|
||||||
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
|
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
|
||||||
@@ -24,6 +25,7 @@ steps:
|
|||||||
flags: unittests # optional
|
flags: unittests # optional
|
||||||
name: codecov-umbrella # optional
|
name: codecov-umbrella # optional
|
||||||
fail_ci_if_error: true # optional (default = false)
|
fail_ci_if_error: true # optional (default = false)
|
||||||
|
verbose: true # optional (default = false)
|
||||||
```
|
```
|
||||||
>**Note**: This assumes that you've set your Codecov token inside *Settings > Secrets* as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io). Keep in mind that secrets are *not* available to forks of repositories.
|
>**Note**: This assumes that you've set your Codecov token inside *Settings > Secrets* as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io). Keep in mind that secrets are *not* available to forks of repositories.
|
||||||
|
|
||||||
@@ -44,6 +46,7 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
|
|||||||
| `name` | Custom defined name for the upload | Optional
|
| `name` | Custom defined name for the upload | Optional
|
||||||
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
|
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
|
||||||
| `path_to_write_report` | Write upload file to path before uploading | Optional
|
| `path_to_write_report` | Write upload file to path before uploading | Optional
|
||||||
|
| `verbose` | Specify whether the Codecov output should be verbose | Optional
|
||||||
|
|
||||||
### Example `workflow.yml` with Codecov Action
|
### Example `workflow.yml` with Codecov Action
|
||||||
|
|
||||||
@@ -82,6 +85,7 @@ jobs:
|
|||||||
name: codecov-umbrella
|
name: codecov-umbrella
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
path_to_write_report: ./coverage/codecov_report.gz
|
path_to_write_report: ./coverage/codecov_report.gz
|
||||||
|
verbose: true
|
||||||
```
|
```
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -90,3 +94,6 @@ Contributions are welcome! Check out the [Contribution Guide](CONTRIBUTING.md).
|
|||||||
## License
|
## License
|
||||||
|
|
||||||
The code in this project is released under the [MIT License](LICENSE).
|
The code in this project is released under the [MIT License](LICENSE).
|
||||||
|
|
||||||
|
|
||||||
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_large)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: 'Codecov'
|
name: 'Codecov'
|
||||||
description: 'GitHub Action that uploads coverage reports for your repository to codecov.io'
|
description: 'GitHub Action that uploads coverage reports for your repository to codecov.io'
|
||||||
author: 'Ibrahim Ali <@ibrahim0814> | Codecov'
|
author: 'Ibrahim Ali <@ibrahim0814> & Thomas Hu <@thomasrockhu> | Codecov'
|
||||||
inputs:
|
inputs:
|
||||||
name:
|
name:
|
||||||
description: 'User defined upload name. Visible in Codecov UI'
|
description: 'User defined upload name. Visible in Codecov UI'
|
||||||
@@ -29,6 +29,9 @@ inputs:
|
|||||||
fail_ci_if_error:
|
fail_ci_if_error:
|
||||||
description: 'Specify whether or not CI build should fail if Codecov runs into an error during upload'
|
description: 'Specify whether or not CI build should fail if Codecov runs into an error during upload'
|
||||||
required: false
|
required: false
|
||||||
|
verbose:
|
||||||
|
description: 'Specify whether the Codecov output should be verbose'
|
||||||
|
required: false
|
||||||
branding:
|
branding:
|
||||||
color: 'red'
|
color: 'red'
|
||||||
icon: 'umbrella'
|
icon: 'umbrella'
|
||||||
|
|||||||
6350
dist/index.js
vendored
6350
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
15
index.js
15
index.js
@@ -13,6 +13,7 @@ try {
|
|||||||
const env_vars = core.getInput("env_vars");
|
const env_vars = core.getInput("env_vars");
|
||||||
const dir = core.getInput("directory");
|
const dir = core.getInput("directory");
|
||||||
const write_path = core.getInput("path_to_write_report");
|
const write_path = core.getInput("path_to_write_report");
|
||||||
|
const verbose = core.getInput("verbose");
|
||||||
|
|
||||||
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
||||||
|
|
||||||
@@ -29,8 +30,10 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
request({
|
request({
|
||||||
url: "https://codecov.io/bash",
|
json: false,
|
||||||
json: false
|
maxAttempts: 10,
|
||||||
|
timeout: 3000,
|
||||||
|
url: "https://codecov.io/bash"
|
||||||
}, (error, response, body) => {
|
}, (error, response, body) => {
|
||||||
try {
|
try {
|
||||||
if (error && fail_ci) {
|
if (error && fail_ci) {
|
||||||
@@ -81,6 +84,8 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const execArgs = ["codecov.sh"];
|
const execArgs = ["codecov.sh"];
|
||||||
|
execArgs.push("-Q", "github-action");
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
execArgs.push(
|
execArgs.push(
|
||||||
"-f", `${file}`
|
"-f", `${file}`
|
||||||
@@ -124,6 +129,12 @@ try {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (verbose) {
|
||||||
|
execArgs.push(
|
||||||
|
"-v"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
exec.exec("bash", execArgs, options)
|
exec.exec("bash", execArgs, options)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (fail_ci) {
|
if (fail_ci) {
|
||||||
|
|||||||
2327
package-lock.json
generated
2327
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codecov-action",
|
"name": "codecov-action",
|
||||||
"version": "1.0.12",
|
"version": "1.0.15",
|
||||||
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
"description": "Upload coverage reports to Codecov from GitHub Actions",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -22,18 +22,18 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/codecov/codecov-action#readme",
|
"homepage": "https://github.com/codecov/codecov-action#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.0",
|
"@actions/core": "^1.2.6",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.4",
|
||||||
"@types/jest": "^26.0.4",
|
"@types/jest": "^26.0.15",
|
||||||
"@zeit/ncc": "^0.22.3",
|
"@zeit/ncc": "^0.22.3",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
"jest": "^26.1.0",
|
"jest": "^26.6.3",
|
||||||
"jest-junit": "^10.0.0",
|
"jest-junit": "^12.0.0",
|
||||||
"request": "^2.88.0",
|
"request": "^2.88.2",
|
||||||
"requestretry": "^4.1.1",
|
"requestretry": "^4.1.1",
|
||||||
"ts-jest": "^26.1.1",
|
"ts-jest": "^26.4.4",
|
||||||
"typescript": "^3.9.6",
|
"typescript": "^4.0.5",
|
||||||
"yarn": "^1.22.4"
|
"yarn": "^1.22.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {}
|
"devDependencies": {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user