Compare commits

...

10 Commits

Author SHA1 Message Date
ibrahim0814
e34ee48524 remove sample coverage file 2020-03-04 22:37:01 -08:00
Ibrahim Ali
d7c91c57ee Merge pull request #53 from armano2/branch-support
Add support for pull requests and tokenless uploads
2020-03-04 22:24:12 -08:00
ibrahim0814
d9faadf52a more documentation updates 2020-03-04 22:22:38 -08:00
ibrahim0814
c70450d006 revert alt exec cmd 2020-03-04 22:02:07 -08:00
ibrahim0814
a6d365dd4c syntax error fix 2020-03-04 21:59:13 -08:00
ibrahim0814
94278ffe1b test alternate exec cmd 2020-03-04 21:57:29 -08:00
ibrahim0814
ebea5cacdf add more documentation notes 2020-03-04 19:59:17 -08:00
ibrahim0814
6a65fa4d50 add github run id env variable 2020-03-04 19:11:12 -08:00
ibrahim0814
4623a4dc3d add sample coverage files 2020-03-04 18:55:36 -08:00
ibrahim0814
c98408608b add functionality for tokenless 2020-03-04 18:30:14 -08:00
6 changed files with 33534 additions and 39 deletions

View File

@@ -5,19 +5,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# - name: Setup Python
# uses: actions/setup-python@master
# - name: Generate coverage report
# run: |
# pip install pytest
# pip install pytest-cov
# pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: ./
with:
token: ${{secrets.CODECOV_TOKEN}}
#commenting out token because tokenless uploads are now supported
#token: ${{secrets.CODECOV_TOKEN}}
flags: unittest
name: codecov-1

View File

@@ -1,13 +1,15 @@
# Codecov GitHub Action
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v1.0.5-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov)
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v1-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov)
### Easily upload coverage reports to Codecov from GitHub Actions
>The latest release of this Action adds support for macOS and Windows builds!
>The latest release of this Action adds support for macOS + Windows builds and tokenless uploads for public repos!
## 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 up to four additional inputs to customize the upload context.
To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v1` is recommended) as a `step` within your `workflow.yml` file.
If you have a *private repository*, 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 up to four additional inputs to customize the upload context. **For public repositories, no token is needed**
Inside your `.github/workflows/workflow.yml` file:
@@ -16,11 +18,11 @@ steps:
- uses: actions/checkout@master
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} #required
file: ./coverage.xml #optional
flags: unittests #optional
name: codecov-umbrella #optional
fail_ci_if_error: true #optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ./coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
```
>**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). Keep in mind that secrets are *not* available to forks of repositories.
@@ -28,9 +30,11 @@ steps:
Codecov's Action currently supports five inputs from the user: `token`, `file`, `flags`,`name`, and `fail_ci_if_error`. These inputs, along with their descriptions and usage contexts, are listed in the table below:
>**Update**: We've removed the `yml` paramter with the latest release of this action. Please put your custom codecov yaml file at the root of the repo because other locations will no longer be supported in the future.
| Input | Description | Usage |
| :---: | :---: | :---: |
| `token` | Used to authorize coverage report uploads | *Required* |
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
| `file` | Path to the coverage report(s) | Optional
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.) | Optional
| `name` | Custom defined name for the upload | Optional

View File

@@ -6,8 +6,8 @@ inputs:
description: 'User defined upload name. Visible in Codecov UI'
required: false
token:
description: 'Repository upload token - get it from codecov.io'
required: true
description: 'Repository upload token - get it from codecov.io. Required only for private repositories'
required: false
file:
description: 'Path to coverage file to upload'
required: false

33521
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -50,14 +50,18 @@ try {
};
options.env = {
CODECOV_TOKEN: `${token}`,
GITHUB_ACTION: process.env.GITHUB_ACTION,
GITHUB_RUN_ID: process.env.GITHUB_RUN_ID,
GITHUB_REF: process.env.GITHUB_REF,
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY,
GITHUB_SHA: process.env.GITHUB_SHA,
GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF || ''
};
if(token){
options.env.CODECOV_TOKEN = token
}
const execArgs = ["codecov.sh"];
if (file) {
execArgs.push(

View File

@@ -12,8 +12,8 @@
"url": "git+https://github.com/codecov/codecov-action.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"author": "Ibrahim Ali",
"license": "MIT",
"bugs": {
"url": "https://github.com/codecov/codecov-action/issues"
},
@@ -24,5 +24,6 @@
"@zeit/ncc": "^0.20.5",
"fs": "0.0.1-security",
"request": "^2.88.0"
}
},
"devDependencies": {}
}