Compare commits

...

7 Commits
v0.3 ... v0.4.1

Author SHA1 Message Date
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
“ibrahim0814”
e749576e48 Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 13:10:14 -07:00
“ibrahim0814”
4a87a38546 remove debug statements 2019-08-07 13:09:57 -07:00
Ibrahim Ali
d7c531ac59 add flags documentation 2019-08-07 13:08:23 -07:00
“ibrahim0814”
b8cc1b68aa add debug statements 2019-08-07 12:42:49 -07:00
“ibrahim0814”
1cb9bf4ff5 add flags 2019-08-07 12:34:25 -07:00
3 changed files with 24 additions and 3 deletions

View File

@@ -10,10 +10,11 @@ Inside your `.github/workflows/workflow.yml` file:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/codecov-action@v0.3
- uses: actions/codecov-action@v0.4
with:
token: ${{secrets.CODECOV_TOKEN}} #for private repos
file: ./coverage.xml #optional
flags: unittests #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.
@@ -40,18 +41,20 @@ jobs:
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v0.2
uses: codecov/codecov-action@v0.4
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml
flags: unittests
```
## Arguments
| Argument | Description |
| Input | Description |
| :---: | :---: |
| `token` | Used to authorize coverage report uploads |
| `file` | Location of the coverage report |
| `flags` | Flag upload to group coverage metrics |
## License

View File

@@ -8,6 +8,9 @@ inputs:
file:
description: 'Path to coverage file to upload'
required: false
flags:
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
required: false
branding:
color: 'red'
icon: 'umbrella'
@@ -17,3 +20,4 @@ runs:
args:
- ${{ inputs.token }}
- ${{ inputs.file }}
- ${{ inputs.flags }}

View File

@@ -5,14 +5,28 @@ set -eu
if [ $# -eq 0 ]
then
bash <(curl -s https://codecov.io/bash)
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" ]
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" ]
then
bash <(curl -s https://codecov.io/bash) -F $INPUT_FLAGS -f $INPUT_FILE
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
exit 1
fi