mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e74d307e33 | ||
|
|
55c9c61f7e | ||
|
|
e749576e48 | ||
|
|
4a87a38546 | ||
|
|
d7c531ac59 | ||
|
|
b8cc1b68aa | ||
|
|
1cb9bf4ff5 |
@@ -10,10 +10,11 @@ Inside your `.github/workflows/workflow.yml` file:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- uses: actions/codecov-action@v0.3
|
- uses: actions/codecov-action@v0.4
|
||||||
with:
|
with:
|
||||||
token: ${{secrets.CODECOV_TOKEN}} #for private repos
|
token: ${{secrets.CODECOV_TOKEN}} #for private repos
|
||||||
file: ./coverage.xml #optional
|
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.
|
>**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
|
pytest --cov=./ --cov-report=xml
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v0.2
|
uses: codecov/codecov-action@v0.4
|
||||||
with:
|
with:
|
||||||
token: ${{secrets.CODECOV_TOKEN}}
|
token: ${{secrets.CODECOV_TOKEN}}
|
||||||
file: ./coverage.xml
|
file: ./coverage.xml
|
||||||
|
flags: unittests
|
||||||
```
|
```
|
||||||
|
|
||||||
## Arguments
|
## Arguments
|
||||||
|
|
||||||
| Argument | Description |
|
| Input | Description |
|
||||||
| :---: | :---: |
|
| :---: | :---: |
|
||||||
| `token` | Used to authorize coverage report uploads |
|
| `token` | Used to authorize coverage report uploads |
|
||||||
| `file` | Location of the coverage report |
|
| `file` | Location of the coverage report |
|
||||||
|
| `flags` | Flag upload to group coverage metrics |
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ inputs:
|
|||||||
file:
|
file:
|
||||||
description: 'Path to coverage file to upload'
|
description: 'Path to coverage file to upload'
|
||||||
required: false
|
required: false
|
||||||
|
flags:
|
||||||
|
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
|
||||||
|
required: false
|
||||||
branding:
|
branding:
|
||||||
color: 'red'
|
color: 'red'
|
||||||
icon: 'umbrella'
|
icon: 'umbrella'
|
||||||
@@ -17,3 +20,4 @@ runs:
|
|||||||
args:
|
args:
|
||||||
- ${{ inputs.token }}
|
- ${{ inputs.token }}
|
||||||
- ${{ inputs.file }}
|
- ${{ inputs.file }}
|
||||||
|
- ${{ inputs.flags }}
|
||||||
@@ -5,14 +5,28 @@ set -eu
|
|||||||
if [ $# -eq 0 ]
|
if [ $# -eq 0 ]
|
||||||
then
|
then
|
||||||
bash <(curl -s https://codecov.io/bash)
|
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" ]
|
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ]
|
||||||
then
|
then
|
||||||
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN -f $INPUT_FILE
|
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" ]
|
elif [ "x$INPUT_TOKEN" != "x" ]
|
||||||
then
|
then
|
||||||
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN
|
bash <(curl -s https://codecov.io/bash) -t $INPUT_TOKEN
|
||||||
elif [ "x$INPUT_FILE" != "x" ]
|
elif [ "x$INPUT_FILE" != "x" ]
|
||||||
then
|
then
|
||||||
bash <(curl -s https://codecov.io/bash) -f $INPUT_FILE
|
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
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user