mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-10 13:07:25 +00:00
add 'config' input to specify path to codecov.yml
This commit is contained in:
parent
a3a6becb2c
commit
9759b41f87
3 changed files with 17 additions and 4 deletions
11
README.md
11
README.md
|
|
@ -23,6 +23,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)
|
||||||
|
config: ./path/to/codecov.yml # optional
|
||||||
```
|
```
|
||||||
>**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.
|
||||||
|
|
||||||
|
|
@ -35,10 +36,11 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
|
||||||
| Input | Description | Usage |
|
| Input | Description | Usage |
|
||||||
| :---: | :---: | :---: |
|
| :---: | :---: | :---: |
|
||||||
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
|
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
|
||||||
| `file` | Path to the coverage report(s) | Optional
|
| `file` | Path to the coverage report(s) | Optional |
|
||||||
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional
|
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional |
|
||||||
| `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 |
|
||||||
|
| `config` | Path to codecov.yml config file | Optional |
|
||||||
|
|
||||||
### Example `workflow.yml` with Codecov Action
|
### Example `workflow.yml` with Codecov Action
|
||||||
|
|
||||||
|
|
@ -70,6 +72,7 @@ jobs:
|
||||||
flags: unittests
|
flags: unittests
|
||||||
name: codecov-umbrella
|
name: codecov-umbrella
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
|
config: ./path/to/codecov.yml
|
||||||
```
|
```
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,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
|
||||||
|
config:
|
||||||
|
description: 'Path to codecov.yml config file'
|
||||||
|
required: false
|
||||||
branding:
|
branding:
|
||||||
color: 'red'
|
color: 'red'
|
||||||
icon: 'umbrella'
|
icon: 'umbrella'
|
||||||
|
|
|
||||||
7
index.js
7
index.js
|
|
@ -9,6 +9,7 @@ try {
|
||||||
const token = core.getInput("token");
|
const token = core.getInput("token");
|
||||||
const flags = core.getInput("flags");
|
const flags = core.getInput("flags");
|
||||||
const file = core.getInput("file");
|
const file = core.getInput("file");
|
||||||
|
const config = core.getInput("config");
|
||||||
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
@ -69,6 +70,12 @@ try {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config) {
|
||||||
|
execArgs.push(
|
||||||
|
"-y", `${config}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
execArgs.push(
|
execArgs.push(
|
||||||
"-n", `${name}`,
|
"-n", `${name}`,
|
||||||
"-F", `${flags}`
|
"-F", `${flags}`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue