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

Repository files navigation

⚠️ Deprecation Warning ⚠️

On February 1, 2022, this uploader will be fully sunset and no longer function

We recommend all users migrate to the uploader to prevent any breakages in usage. You can learn more about our deprecation plan and the new uploader on our blog.


Codecov Bash Uploader

Upload reports to Codecov for almost every supported language.

codecov

Deployed Version

Running the bash uploader


# All CI
bash <(curl -s https://codecov.io/bash)# Pipe to bash (Jenkins)
curl -s https://codecov.io/bash | bash -s - -t token
# ^ add your extra config here# No bash method
curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
./.codecov

⚠️ Verifying the bash uploader

As an additional layer of security, users may wish to check the script against the provided SHASUMs.

curl -fLso codecov https://codecov.io/bash;
VERSION=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);foriin 1 256 512
do
shasum -a $i -c --ignore-missing <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM")done
./codecov

or for older versions of shasum

curl -fLso codecov https://codecov.io/bash;
VERSION=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);foriin 1 256 512
do
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM"| grep -w "codecov")done
./codecov

Languages

Codecov supports many languages, you can find a full list here: https://docs.codecov.io/docs/supported-languages

Other Usage

Below are most commonly used settings. View full list of commands to see the full list of commands.

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

When running the codecov-bash uploader on Alpine Linux, you are likely to run into a parsing issue because of the default shell. To be able to upload reports, you need to issue the following commands.

after_success:
- apk -U add git curl bash findutils
- bash -c '/bin/bash <(curl -s https://codecov.io/bash)'

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

CompanySupportedToken Required
Travis CIYes Build StatusFOSSA StatusPrivate only
Azure PipelinesYesPrivate only
CircleCIYesPrivate only
CodeshipYesPublic & Private
JenkinsYesPublic & Private
SemaphoreYesPublic & Private
TeamCity.YesPublic & Private
drone.ioYesPublic & Private
AppVeyorYesPrivate only
BambooYesPublic & Private
BitbucketYesPublic & Private
BitriseYesPublic & Private
buddybuildYesPublic & Private
BuildkiteYesPublic & Private
HerokuYesPublic & Private
WerckerYesPublic & Private
ShippableYesPublic & Private
Gitlab CIYesPublic & Private
BuildkiteYesPublic & Private
GitHub ActionsYesPrivate only
Cirrus CIYesPublic & Private
AWS CodeBuildYesPublic & Private
gitYes (as a fallback)Public & Private

Caveats

  1. Jenkins: Unable to find reports? Try PWD=WORKSPACE bash <(curl -s https://codecov.io/bash)

Development

To automatically update the hash files after a change to the Codecov uploader script, run

./install.sh

which will add the pre-commit hooks. You can also update the hash files manually via:

foriin 1 256 512;do shasum -a "${i}" codecov >"SHA${i}SUM";done

and add the change to your pull request.

License

FOSSA Status

About

Global coverage report uploader for Codecov

Topics

Resources

Security policy

Stars

234 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages