Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

codecov/codecov-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codecov Global Uploader

Upload reports to Codecov for almost every supported language.

Deployed Version


All CI

bash <(curl -s https://codecov.io/bash)

Jenkins

curl -s https://codecov.io/bash | bash


------

### Languages
> [Python](https://github.com/codecov/example-python), [C#/.net](https://github.com/codecov/example-csharp), [Java](https://github.com/codecov/example-java), [Node/Javascript/Coffee](https://github.com/codecov/example-node),
> [C/C++](https://github.com/codecov/example-c), [D](https://github.com/codecov/example-d), [Go](https://github.com/codecov/example-go), [Groovy](https://github.com/codecov/example-groovy), [Kotlin](https://github.com/codecov/example-kotlin),
> [PHP](https://github.com/codecov/example-php), [R](https://github.com/codecov/example-r), [Scala](https://github.com/codecov/example-scala), [Xtern](https://github.com/codecov/example-xtend), [Xcode](https://github.com/codecov/example-xcode), [Lua](https://github.com/codecov/example-lua) and more...


### Usage
> Below are most commonly used settings. [View full list of commands](https://github.com/codecov/codecov-bash/blob/master/codecov#L56) to see the full list of commands.

```yaml
# public repo on Travis CI
after_success:
  - bash <(curl -s https://codecov.io/bash)
# private repo
after_success:
  - bash <(curl -s https://codecov.io/bash) -t your-repository-upload-token
# Flag build types
after_success:
  - bash <(curl -s https://codecov.io/bash) -F unittests
# Include environment variables to store per build
after_success:
  - bash <(curl -s https://codecov.io/bash) -e TOX_ENV,CUSTOM_VAR

Prevent build failures

If Codecov fails to upload reports, you can ensure the CI build does not fail by adding a catch-all:

bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"

CI Providers

Company Supported Token Required
Travis CI Yes Build Status Private only
CircleCI Yes Circle CI Private only
Codeship Yes Public & Private
Jenkins Yes Public & Private
Semaphore Yes Public & Private
drone.io Yes Public & Private
AppVeyor No. See Codecov Python. Private only
Wercker Yes Public & Private
Magnum CI Yes Public & Private
Shippable Yes Public & Private
Gitlab CI Yes Public & Private
snap ci Yes Public & Private
git Yes (as a fallback) Public & Private
Buildbot coming soon buildbot/buildbot#1671
Bamboo coming soon
Solano Labs coming soon
Bitrise coming soon

Using Travis CI? Uploader is compatible with sudo: false which can speed up your builds. 👍

Caveats

Jenkins 2 and Pipelines

The branch environment variable is not presented and needs to be included manually :frown:

bash <(curl -s https://codecov.io/bash) -B ${env.BRANCH_NAME}

Failure to do this results in every commit being on the master branch

Strange bash behavior

Bash does not respect multiple spaces with arguments

# FAILES because of double space here:
#                                                      v
- bash <(curl -s https://codecov.io/bash) -X coveragepy  -B master
+ bash <(curl -s https://codecov.io/bash) -X coveragepy -B master