Codecov pipeline integration

Create Code Coverage Reports with Codefresh and Codecov

Codefresh has native integration for Codecov analysis. You need to first set up a new project in Codecov.

Set up a new project in Codecov

  • Sign up for a free account with Codecov.
  • Add a new project.

Getting a Token from Codecov

Getting a Token from Codecov
  • Note down the Token as you will need it to set up the Codecov integration in Codefresh.

Set up Codecov integration in Codefresh

IMPORTANT
The name assigned to the integration must be unique within the account. Using the same name for other integrations or Shared Configuration contexts within pipelines will result in conflicts.
For troubleshooting, see Error: context already exists.


  1. In the Codefresh UI, on the toolbar, click the Settings icon, and then from the sidebar, select Pipeline Integrations.
  2. Select Codecov and then click Configure.
  3. Click Add Codecov.
  4. Define the following:
    • Integration Name: Enter a name for the integration which is used to reference it in codefresh.yaml.
    • Token: Paste the token that you copied when you created the new Codecov project for this integration.
    • Url: The base URL for this integration. Do not add the trailing slash to the URL definition. For more information, see the official Codecov documentation.

Enter Token

Enter Token

Using Codecov in a CI pipeline

With the integration in place, you can reference it by name in any Codefresh pipeline by using the Codecov reporter step.

codefresh.yml

  codecov-report:
	stage: "prepare"
	title: Codecov report
	type: codecov-reporter:2.1.0
	arguments:
  	codecov_integration: my-codecov-integration

For more details see our Codecov example.

Integration Tests
Service containers in pipelines
Coveralls coverage reports example
Codacy coverage reports example
Creating test reports