Compare commits

...

23 Commits
v0.2.1 ... v0.3

Author SHA1 Message Date
“ibrahim0814”
48bb5e4ec3 name, description edits 2019-08-07 12:09:55 -07:00
“ibrahim0814”
a4dba2e03e add documentation for file path 2019-08-07 12:01:44 -07:00
“ibrahim0814”
c1b452a1b8 manage file uploads 2019-08-07 11:49:18 -07:00
“ibrahim0814”
6905df41d5 correct conditionals 2019-08-07 11:44:00 -07:00
“ibrahim0814”
052454207d add debug echo statements 2019-08-07 11:41:02 -07:00
“ibrahim0814”
0be151486e add file conditionals 2019-08-07 11:39:29 -07:00
“ibrahim0814”
4b3f2da728 use default args 2019-08-07 11:18:32 -07:00
“ibrahim0814”
03b2817fb6 input at top 2019-08-07 11:15:48 -07:00
“ibrahim0814”
6fdf86f06b test null condition 2019-08-07 11:11:16 -07:00
“ibrahim0814”
7c7db8b859 file path test 2019-08-07 11:05:50 -07:00
“ibrahim0814”
044d93a92c Merge branch 'master' of github.com:codecov/codecov-github-action 2019-08-07 10:52:00 -07:00
“ibrahim0814”
caffaa27c7 add file path param 2019-08-07 10:51:41 -07:00
Ibrahim Ali
902f207325 delete improvements section 2019-08-07 10:21:52 -07:00
“ibrahim0814”
72a27786b2 readme 2019-08-07 08:14:31 -07:00
“ibrahim0814”
30fe6d4bec spelling 2019-08-07 08:13:13 -07:00
“ibrahim0814”
68ee090395 change email 2019-08-07 08:12:13 -07:00
“ibrahim0814”
ce00a5b662 readme 2019-08-07 08:10:22 -07:00
“ibrahim0814”
1f8bbdf5bb add pr section in contrib guide 2019-08-07 08:09:29 -07:00
“ibrahim0814”
47b142b183 add example workflow file 2019-08-07 07:59:10 -07:00
“ibrahim0814”
95bbe7b4bf add contributing guidelines 2019-08-07 07:38:37 -07:00
Ibrahim Ali
8e51ca4502 add license link 2019-08-07 06:40:15 -07:00
Ibrahim Ali
0fa1095987 Create LICENSE 2019-08-07 06:38:39 -07:00
Ibrahim Ali
02da153e67 Update README.md 2019-08-07 06:28:17 -07:00
5 changed files with 86 additions and 10 deletions

13
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,13 @@
# Contribution Guide
:tada: Thanks for taking the time to contribute! :tada:
The following is a set of guidelines for contributing to this repository, which is hosted in the [Codecov Organization](https://github.com/codecov) on GitHub.
## What does this repo do?
This repo is a GitHub Action, meaning it integrates with the GitHub Actions CI/CD pipeline. It's meant to take formatted reports with code coverage stats and upload them to codecov.io. What's essentially happening in the background is that Actions is spinning up a Linux Docker container with the contents of this repository. Inside that container, we then call a shell scipt that runs Codecov's Bash uploader.
## PRs and Support
Feel free to clone, modify code and request a PR to this repository. All PRs will be reviewed by the Codecov team. If your PR has been sitting for a while or if you have any questions, ping us at support@codecov.io

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Codecov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,7 +1,7 @@
<!-- <p align="center"><img src="./codecov-logo.png" /></p> -->
# Codecov GitHub Action
### Easily upload coverage reports to Codecov from Github Actions
### Easily upload coverage reports to Codecov from GitHub Actions
## Usage
@@ -10,19 +10,50 @@ Inside your `.github/workflows/workflow.yml` file:
```yaml
steps:
- uses: actions/checkout@master
- uses: actions/codecov-action@v0.2
- uses: actions/codecov-action@v0.3
with:
token: ${{secrets.CODECOV_TOKEN}}
token: ${{secrets.CODECOV_TOKEN}} #for private repos
file: ./coverage.xml #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.
### Example `workflow.yml` with Codecov Action
```yaml
name: Example workflow for Codecov
on: [push]
jobs:
run:
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
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml
```
>**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.
## Arguments
| Argument | Description |
| :---: | :---: |
| `token` | Used to authorize coverage report uploads |
| `file` | Location of the coverage report |
## License
The code in this project is released under the MIT License
The code in this project is released under the [MIT License](LICENSE)

View File

@@ -1,10 +1,13 @@
name: 'Codecov'
description: 'GitHub action that uploads coverage reports for your repository to codecov.io'
author: 'Ib @ Codecov'
author: 'Ibrahim Ali @ Codecov'
inputs:
token:
description: 'Set the repository token'
required: false
file:
description: 'Path to coverage file to upload'
required: false
branding:
color: 'red'
icon: 'umbrella'
@@ -13,3 +16,4 @@ runs:
image: 'Dockerfile'
args:
- ${{ inputs.token }}
- ${{ inputs.file }}

View File

@@ -3,9 +3,16 @@
set -eu
if [ $# -eq 0 ]
then
bash <(curl -s https://codecov.io/bash)
else
bash <(curl -s https://codecov.io/bash) -t $1
then
bash <(curl -s https://codecov.io/bash)
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" ]
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
fi