mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-23 20:27:02 +08:00
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
|
||||||
|
|||||||
@@ -25,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.
|
||||||
|
|
||||||
@@ -45,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
|
||||||
|
|
||||||
@@ -83,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
|
||||||
|
|
||||||
@@ -93,4 +96,4 @@ Contributions are welcome! Check out the [Contribution Guide](CONTRIBUTING.md).
|
|||||||
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)
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_large)
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|||||||
6342
dist/index.js
vendored
6342
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
7
index.js
7
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();
|
||||||
|
|
||||||
@@ -126,6 +127,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) {
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codecov-action",
|
"name": "codecov-action",
|
||||||
"version": "1.0.13",
|
"version": "1.0.14",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codecov-action",
|
"name": "codecov-action",
|
||||||
"version": "1.0.13",
|
"version": "1.0.14",
|
||||||
"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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user