-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from codecov/node-action
Convert action from docker to javascript
- Loading branch information
Showing
11 changed files
with
34,694 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# react / gatsby | ||
public/ | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ The following is a set of guidelines for contributing to this repository, which | |
|
||
## 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. | ||
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. Our Node action uses the Actions toolkit to make system calls that allow us to run Codecov's bash uploader inside of Node. Essentially what we're doing in this action is downloading Codecov's bash uploader script from codecov.io/bash, saving it as a file in the current directory, executing the file via `exec` calls, then removing the script from the current directory. | ||
|
||
## PRs and Support | ||
## PRs, Issues, 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 [email protected] | ||
Feel free to clone, modify code and request a PR to this repository. All PRs and issues will be reviewed by the Codecov team. If your PR/issue has been sitting for a while or if you have any questions, ping us at [email protected] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,51 @@ | ||
# Codecov GitHub Action | ||
|
||
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v1.0.3-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov) | ||
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v1.0.4-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov) | ||
### Easily upload coverage reports to Codecov from GitHub Actions | ||
|
||
## 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 three additional inputs to customize the upload context. | ||
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. | ||
|
||
Inside your `.github/workflows/workflow.yml` file: | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: codecov/codecov-action@v1.0.3 | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} #required | ||
token: ${{ secrets.CODECOV_TOKEN }} #required | ||
file: ./coverage.xml #optional | ||
flags: unittests #optional | ||
name: codecov-umbrella #optional | ||
yml: ./codecov.yml #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](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). | ||
|
||
## Arguments | ||
|
||
Codecov's Action currently supports four inputs from the user: `token`, `file`, `flags`, and `name`. These inputs, along with their descriptions and usage contexts, are listed in the table below: | ||
Codecov's Action currently supports five inputs from the user: `token`, `file`, `flags`,`name`, and `yml`. These inputs, along with their descriptions and usage contexts, are listed in the table below: | ||
|
||
| Input | Description | Usage | | ||
| :---: | :---: | :---: | | ||
| `token` | Used to authorize coverage report uploads | *Required* | | ||
| `file` | Location of the coverage report | Optional | ||
| `flags` | Flag upload under a certain group | Optional | ||
| `name` | Custom defined name for the upload | Optional | ||
| `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 build | Optional | ||
| `yml` | Path to codecov.yml config file | Optional | ||
|
||
### Example `workflow.yml` with Codecov Action | ||
> **Note**: This is a Docker based action and will only run on Linux based systems (e.g Ubuntu). Windows and macOS builds are currently not supported. | ||
>**Note**: The latest release of this Action adds support for macOS and Windows builds! | ||
|
||
```yaml | ||
name: Example workflow for Codecov | ||
on: [push] | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup Python | ||
|
@@ -52,14 +57,14 @@ jobs: | |
pip install pytest | ||
pip install pytest-cov | ||
pytest --cov=./ --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
if: runner.os == 'Linux' | ||
uses: codecov/[email protected] | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
flags: unittests | ||
name: codecov-umbrella | ||
name: codecov-umbrella | ||
yml: ./codecov.yml | ||
``` | ||
## Contributing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.