mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-08 16:16:24 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48bb5e4ec3 | ||
|
|
a4dba2e03e | ||
|
|
c1b452a1b8 | ||
|
|
6905df41d5 | ||
|
|
052454207d | ||
|
|
0be151486e | ||
|
|
4b3f2da728 | ||
|
|
03b2817fb6 | ||
|
|
6fdf86f06b | ||
|
|
7c7db8b859 | ||
|
|
044d93a92c | ||
|
|
caffaa27c7 | ||
|
|
902f207325 | ||
|
|
72a27786b2 | ||
|
|
30fe6d4bec | ||
|
|
68ee090395 | ||
|
|
ce00a5b662 | ||
|
|
1f8bbdf5bb | ||
|
|
47b142b183 | ||
|
|
95bbe7b4bf | ||
|
|
8e51ca4502 | ||
|
|
0fa1095987 | ||
|
|
02da153e67 |
13
CONTRIBUTING.md
Normal file
13
CONTRIBUTING.md
Normal 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
21
LICENSE
Normal 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.
|
||||
41
README.md
41
README.md
@@ -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)
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user