Integrating Codecov with Codeship

Integrations

Reading Time: 2 minutes

At Codeship, we’re pleased to be able to integrate with several third-party products across a variety of areas to ensure your CI/CD workflows are that much smoother. For example, Codecov is an automated code-coverage service that helps you enforce standards of code quality and transparency with your engineering team.

Getting started with Codecov and Codeship is fast and easy. Their documentation does a great job of providing more information, in addition to the setup instructions below. Let’s begin with the Codeship Pro setup.

Getting Started with Codecov and Codeship Pro

First of all, 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, 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.

Codeship Basic

Moving onto the Codeship Basic setup, let’s begin by adding an upload token. You’ll need to add your CODECOV_TOKEN 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.

Subscribe via Email

Over 60,000 people from companies like Netflix, Apple, Spotify and O'Reilly are reading our articles.
Subscribe to receive a weekly newsletter with articles around Continuous Integration, Docker, and software development best practices.



We promise that we won't spam you. You can unsubscribe any time.

Join the Discussion

Leave us some comments on what you think about this topic or if you like to add something.