You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Easily upload coverage reports to Codecov from GitHub Actions
4
+
### Easily upload coverage reports to Codecov from GitHub Actions
5
5
6
6
>The latest release of this Action adds support for tokenless uploads from GitHub Actions!
7
7
8
8
## Usage
9
9
10
-
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v1` is recommended) as a `step` within your `workflow.yml` file.
10
+
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v1` is recommended) as a `step` within your `workflow.yml` file.
11
11
12
12
If you have a *private repository*, this Action also requires you to [provide an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) from [codecov.io](https://www.codecov.io) (tip: in order to avoid exposing your token, store it as a `secret`). Optionally, you can choose to include up to four additional inputs to customize the upload context. **For public repositories, no token is needed**
>**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.
27
+
>**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.
28
28
29
29
## Arguments
30
30
31
-
Codecov's Action currently supports five inputs from the user: `token`, `file`, `flags`,`name`, and `fail_ci_if_error`. These inputs, along with their descriptions and usage contexts, are listed in the table below:
31
+
Codecov's Action currently supports five inputs from the user: `token`, `file`, `flags`,`name`, and `fail_ci_if_error`. These inputs, along with their descriptions and usage contexts, are listed in the table below:
32
32
33
33
>**Update**: We've removed the `yml` parameter with the latest release of this action. Please put your custom codecov yaml file at the root of the repo because other locations will no longer be supported in the future.
34
34
@@ -37,6 +37,7 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
37
37
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
38
38
| `file` | Path to the coverage report(s) | Optional
39
39
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional
40
+
| `env_vars` | Environment variables to tag the upload with. Multiple env variables can be separated with commas (e.g. `OS,PYTHON`) | Optional
40
41
| `name` | Custom defined name for the upload | Optional
41
42
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
42
43
@@ -49,11 +50,14 @@ jobs:
49
50
run:
50
51
runs-on: ${{ matrix.os }}
51
52
strategy:
52
-
matrix:
53
+
matrix:
53
54
os: [ubuntu-latest, macos-latest, windows-latest]
55
+
env:
56
+
OS: ${{ matrix.os }}
57
+
PYTHON: '3.7'
54
58
steps:
55
59
- uses: actions/checkout@master
56
-
- name: Setup Python
60
+
- name: Setup Python
57
61
uses: actions/setup-python@master
58
62
with:
59
63
python-version: 3.7
@@ -62,19 +66,20 @@ jobs:
62
66
pip install pytest
63
67
pip install pytest-cov
64
68
pytest --cov=./ --cov-report=xml
65
-
- name: Upload coverage to Codecov
69
+
- name: Upload coverage to Codecov
66
70
uses: codecov/codecov-action@v1
67
71
with:
68
72
token: ${{ secrets.CODECOV_TOKEN }}
69
73
file: ./coverage.xml
70
74
flags: unittests
75
+
env_vars: OS,PYTHON
71
76
name: codecov-umbrella
72
77
fail_ci_if_error: true
73
78
```
74
79
## Contributing
75
80
76
81
Contributions are welcome! Check out the [Contribution Guide](CONTRIBUTING.md).
77
82
78
-
## License
83
+
## License
79
84
80
85
The code in this project is released under the [MIT License](LICENSE).
0 commit comments