|
| 1 | +title: "Codecov Integration" |
| 2 | +description: "Create Code Coverage Reports with Codefresh and Codecov" |
| 3 | +group: integrations |
| 4 | +toc: true |
| 5 | +--- |
| 6 | + |
| 7 | +Codefresh has native integration for[Codecov analysis](https://about.codecov.io/). |
| 8 | + |
| 9 | +To enable the analysis sign up for a free account with Codecov and add a new project. |
| 10 | + |
| 11 | +{% include image.html |
| 12 | +lightbox="true" |
| 13 | +file="/images/integrations/codecov/codecovtoken.png" |
| 14 | +url="/images/integrations/codecov/codecovtoken.png" |
| 15 | +max-width="60%" |
| 16 | +caption="Getting a Token from Codecov" |
| 17 | +alt="Getting a Token from Codecov" |
| 18 | +%} |
| 19 | + |
| 20 | +From this screen make sure you note down the Token as you will use it in Codefresh. |
| 21 | + |
| 22 | +Next, go into your Codefresh account settings and choose CodeCov from[integrations]({{https://g.codefresh.io/account-admin/account-conf/integration). Click the add integration button: |
| 23 | + |
| 24 | +{% include image.html |
| 25 | +lightbox="true" |
| 26 | +file="/images/integrations/codecov/codecovintegration.png" |
| 27 | +url="/images/integrations/codecov/codecovintegration.png" |
| 28 | +max-width="60%" |
| 29 | +caption="Enter Token" |
| 30 | +alt="Enter Token" |
| 31 | +%} |
| 32 | + |
| 33 | +Enter your token (see the previous section) and a name (user-defined) for this integration. The name should be unique for each integration that you add. |
| 34 | + |
| 35 | +Using Codecov in a Codefresh Pipeline: |
| 36 | + |
| 37 | +With the integration in place, you can use it by name in any Codefresh pipeline by using the[Codecov reporter step](https://codefresh.io/steps/step/codecov-reporter). |
| 38 | + |
| 39 | +`codefresh.yml` |
| 40 | + codecov-report: |
| 41 | +stage: "prepare" |
| 42 | +title: Codecov report |
| 43 | +type: codecov-reporter |
| 44 | +arguments: |
| 45 | + codecov_integration: my-codecov-integration |
| 46 | + |
| 47 | +For more details see our[Codecov example]({{https://codefresh.io/docs/docs/yaml-examples/examples/codecov-testing/). |
| 48 | + |
| 49 | +##What to read next |
| 50 | + |
| 51 | +-[Integration Tests]({{site.baseurl}}/docs/testing/integration-tests/) |
| 52 | +-[Service Containers]({{site.baseurl}}/docs/codefresh-yaml/service-containers/) |
| 53 | +-[Coveralls Example]({{site.baseurl}}/docs/yaml-examples/examples/coveralls-testing/) |
| 54 | +-[Codacy Example]({{site.baseurl}}/docs/yaml-examples/examples/codacy-testing/) |
| 55 | +-[Test Reports]({{site.baseurl}}/docs/testing/test-reports/) |