Integrating CodeShip With Codecov for Code Coverage Reports

1 minute read

About Codecov

Codecov is an automated code coverage service. Starting with Codecov and CodeShip is fast and easy.

By using Codecov you can help enforce higher standards of code quality and transparency with your engineering team.

Their documentation does a great job of providing more information, in addition to the setup instructions below.

CloudBees CodeShip Pro

Adding Upload Token

To start, you need to add your CODECOV_TOKEN to the encrypted environment variables that you encrypt and include in your codeship-services.yml file.

Project Configuration

Once your Codecov upload token is loaded via your environment variables, you will need to add the Codecov reporting command as a new step in your codeship-steps.yml file.

After running your test commands, you can add:

- name: codecov service: YOURSERVICE command: bash -c "curl -s https://codecov.io/bash"

Note that this uses their universal uploader. They also provide language and framework-specific packages that you can integrate directly into your test suite if you prefer. View their language-specific documentation and examples for more specific information.

CloudBees CodeShip Basic

Adding Upload Token

To start, you need to add your CODECOV_TOKEN to your to your project’s environment variables.

You can do this by navigating to Project Settings and then clicking on the Environment tab.

Project Configuration

Once your Codecov upload token is loaded via your environment variables, you will need to add the Codecov reporting command in your test commands:

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

Note that this uses their universal uploader. They also provide language and framework-specific packages that you can integrate directly into your test suite if you prefer. View their language-specific documentation and examples for more specific information.