Compare commits

...

63 Commits
v0.4 ... v1.0.0

Author SHA1 Message Date
Ibrahim Ali
e3f7b8baf8 Update README.md 2019-08-08 10:10:05 -07:00
“ibrahim0814”
4af6f0743e delete debug output 2019-08-08 09:42:59 -07:00
“ibrahim0814”
5c880506b5 env vars 2019-08-08 09:22:55 -07:00
“ibrahim0814”
a3a7edcc61 revert back to original 2019-08-08 09:21:49 -07:00
“ibrahim0814”
f93f6bdcae test env var 2019-08-08 08:39:08 -07:00
“ibrahim0814”
35b9267ca9 check what shows up for env 2019-08-08 08:24:15 -07:00
“ibrahim0814”
39a99a4e84 test ci env var 2019-08-08 08:19:32 -07:00
“ibrahim0814”
e0cc6d49d9 readme 2019-08-07 23:46:42 -07:00
“ibrahim0814”
96d1c9a15d readme 2019-08-07 23:44:17 -07:00
“ibrahim0814”
ee0d391ad0 clean up comments 2019-08-07 23:40:42 -07:00
“ibrahim0814”
bd3230c275 correct logic for token requirement 2019-08-07 23:00:45 -07:00
Ibrahim Ali
c7a04fdde5 Merge pull request #3 from codecov/thomasrockhu-patch-1
Better error message
2019-08-07 22:43:29 -07:00
Thomas Hu
efe83d2996 Revert "Remove options without a provided token"
This reverts commit db5a766c55.
2019-08-08 01:42:54 -04:00
Thomas Hu
db5a766c55 Remove options without a provided token
Remove options without a token
2019-08-08 01:39:13 -04:00
Thomas Hu
1f99174e83 Better error message 2019-08-08 01:36:45 -04:00
“ibrahim0814”
93d126a749 readme 2019-08-07 22:15:28 -07:00
“ibrahim0814”
4546e138ba readme 2019-08-07 21:47:36 -07:00
“ibrahim0814”
125cedf806 readme 2019-08-07 21:45:22 -07:00
“ibrahim0814”
6f489c7a78 readme 2019-08-07 21:44:55 -07:00
“ibrahim0814”
fc175be7b5 readme 2019-08-07 21:43:58 -07:00
“ibrahim0814”
a166a95c4a readme 2019-08-07 21:40:59 -07:00
“ibrahim0814”
dd94ace224 add contributing section 2019-08-07 21:38:13 -07:00
“ibrahim0814”
a8f7ad31ff readme 2019-08-07 21:33:14 -07:00
“ibrahim0814”
ed370e2ded readme 2019-08-07 21:30:18 -07:00
“ibrahim0814”
dd098b2f6b shift to token required 2019-08-07 21:20:10 -07:00
“ibrahim0814”
d2c4464978 readme 2019-08-07 21:03:14 -07:00
“ibrahim0814”
97fe500537 readme 2019-08-07 21:02:44 -07:00
“ibrahim0814”
111c74ca11 readme 2019-08-07 20:56:18 -07:00
“ibrahim0814”
edbb6f8e5d rem header comments 2019-08-07 20:41:31 -07:00
“ibrahim0814”
7d121a89c0 rem header comments 2019-08-07 20:40:25 -07:00
“ibrahim0814”
159fdf6e54 modify input description 2019-08-07 20:36:21 -07:00
“ibrahim0814”
4fb042f123 readme 2019-08-07 20:26:06 -07:00
“ibrahim0814”
0766dd1553 readme 2019-08-07 20:24:56 -07:00
“ibrahim0814”
e0683efc0b add header comments 2019-08-07 20:21:41 -07:00
“ibrahim0814”
1b38d5e8b4 readme 2019-08-07 20:10:44 -07:00
“ibrahim0814”
2793f27b99 readme 2019-08-07 20:07:45 -07:00
“ibrahim0814”
afda60d339 readme 2019-08-07 19:41:47 -07:00
“ibrahim0814”
f21e0e6d14 readme 2019-08-07 19:33:51 -07:00
“ibrahim0814”
55d06088fa readme 2019-08-07 19:29:56 -07:00
“ibrahim0814”
7461079497 readme 2019-08-07 19:29:11 -07:00
“ibrahim0814”
eda3e0f75c readme 2019-08-07 19:28:35 -07:00
“ibrahim0814”
c7f04ba6f0 readme 2019-08-07 19:27:57 -07:00
“ibrahim0814”
67896f6476 readme 2019-08-07 19:25:37 -07:00
“ibrahim0814”
1e6057f6d0 readme 2019-08-07 19:24:28 -07:00
“ibrahim0814”
25df614d11 readme 2019-08-07 19:23:31 -07:00
“ibrahim0814”
3ee0aad0bf readme 2019-08-07 19:18:32 -07:00
“ibrahim0814”
93ee40a7a2 readme 2019-08-07 19:17:51 -07:00
“ibrahim0814”
d1914c14b8 move arguments section up 2019-08-07 18:44:06 -07:00
“ibrahim0814”
c2703ce7b6 readme 2019-08-07 18:40:03 -07:00
“ibrahim0814”
47224ae4e6 readme 2019-08-07 18:38:52 -07:00
“ibrahim0814”
413e76629d add argument uage 2019-08-07 18:35:56 -07:00
“ibrahim0814”
6625b1305d add name documentation info 2019-08-07 18:30:01 -07:00
“ibrahim0814”
77578a4d61 remove debug statements 2019-08-07 18:21:36 -07:00
“ibrahim0814”
2ce8445bdf puts docker args back in 2019-08-07 18:16:19 -07:00
“ibrahim0814”
22e73b5938 empty args list 2019-08-07 18:14:12 -07:00
“ibrahim0814”
f338553518 test without args 2019-08-07 18:11:55 -07:00
“ibrahim0814”
2ca1146dfd test token arg 2019-08-07 18:09:32 -07:00
“ibrahim0814”
e49c256d4a try using no args 2019-08-07 18:05:04 -07:00
“ibrahim0814”
baf6a7af4f fix yml error try 2 2019-08-07 17:04:13 -07:00
“ibrahim0814”
d2db6055ff Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 16:45:37 -07:00
“ibrahim0814”
9aebf8f59e add name input with debug cmds 2019-08-07 16:42:40 -07:00
Ibrahim Ali
e74d307e33 Update README.md 2019-08-07 13:19:04 -07:00
Ibrahim Ali
55c9c61f7e Update README.md 2019-08-07 13:17:40 -07:00
4 changed files with 49 additions and 32 deletions

View File

@@ -1,3 +1,5 @@
# Codecov @codecov
FROM alpine:3.10
WORKDIR /app

View File

@@ -1,22 +1,34 @@
<!-- <p align="center"><img src="./codecov-logo.png" /></p> -->
# Codecov GitHub Action
### Easily upload coverage reports to Codecov from GitHub Actions
## Usage
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number as a `step` within your `workflow.yml` file. 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 three additional inputs to customize the upload context.
Inside your `.github/workflows/workflow.yml` file:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/codecov-action@v0.3
- uses: actions/codecov-action@v1.0.0
with:
token: ${{secrets.CODECOV_TOKEN}} #for private repos
token: ${{secrets.CODECOV_TOKEN}} #required
file: ./coverage.xml #optional
flags: unittests #optional
name: codecov-umbrella #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 for your specific repo on codecov.io. A token is *not* required for public 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).
## Arguments
Codecov's Action currently supports four inputs from the user: `token`, `file`, `flags`, and `name`. These inputs, along with their descriptions and usage contexts, are listed in the table below:
| Input | Description | Usage |
| :---: | :---: | :---: |
| `token` | Used to authorize coverage report uploads | *Required* |
| `file` | Location of the coverage report | Optional
| `flags` | Flag upload under a certain group | Optional
| `name` | Custom defined name for the upload | Optional
### Example `workflow.yml` with Codecov Action
@@ -28,35 +40,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
version: 3.7
- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v0.2
uses: codecov/codecov-action@v1.0.0
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
```
## Contributing
## Arguments
| Input | Description |
| :---: | :---: |
| `token` | Used to authorize coverage report uploads |
| `file` | Location of the coverage report |
| `flags` | Flag upload to group coverage metrics |
Contributions are welcome! Check out the [Contribution Guide](CONTRIBUTING.md).
## 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).

View File

@@ -1,9 +1,12 @@
name: 'Codecov'
description: 'GitHub action that uploads coverage reports for your repository to codecov.io'
author: 'Ibrahim Ali @ Codecov'
description: 'GitHub Action that uploads coverage reports for your repository to codecov.io'
author: 'Ibrahim Ali <@ibrahim0814> | Codecov'
inputs:
name:
description: 'User defined upload name. Visible in Codecov UI'
required: false
token:
description: 'Set the repository token'
description: 'Repository upload token - get it from codecov.io'
required: false
file:
description: 'Path to coverage file to upload'
@@ -18,6 +21,8 @@ runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.name }}
- ${{ inputs.token }}
- ${{ inputs.file }}
- ${{ inputs.flags }}
- ${{ inputs.flags }}

View File

@@ -1,32 +1,38 @@
#!/bin/bash
# Codecov @codecov
set -eu
if [ $# -eq 0 ]
then
bash <(curl -s https://codecov.io/bash)
echo "Please provide an upload token from codecov.io"
exit 1
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_FLAGS" != "x" ] && [ "x$INPUT_NAME" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE -F $INPUT_FLAGS -n $INPUT_NAME
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE -F $INPUT_FLAGS
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_NAME" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE -n $INPUT_NAME
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_NAME" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -n $INPUT_NAME -F $INPUT_FLAGS
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -F $INPUT_FLAGS
elif [ "x$INPUT_FLAGS" != "x" ] && [ "x$INPUT_FILE" != "x" ]
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_NAME" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -F $INPUT_FLAGS -f $INPUT_FILE
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -n $INPUT_NAME
elif [ "x$INPUT_TOKEN" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN
elif [ "x$INPUT_FILE" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -f $INPUT_FILE
elif [ "x$INPUT_FLAGS" != "x" ]
then
bash <(curl -s https://codecov.io/bash) -F $INPUT_FLAGS
else
echo "Please provide an upload token from codecov.io with valid arguments"
exit 1
fi