Quick Start

A quick start guide and collection of references for those that are brand new to codecov.

We've made getting started with Codecov as easy as possible. By the end of this guide, you will have:

  • Added Codecov to your repository
  • Uploaded coverage
  • Gained an understanding of the primary Codecov features

Ingredients List

Here are the things Codecov relies on to provide its service:

1. Connection to your code host account on GitHub, GitLab or Bitbucket. Codecov relies on Git-based codehosts to run.

2. Code coverage report(s) being generated by your test suite in the applicable programming language. Codecov ingests these reports to provide our product. The centrally supported code coverage report format is a .xml format.

3. Access to your source code at time of report upload. While Codecov does not upload or read your source code, we do need to be able to match the file structure of your repo to your report in order to process it.

4. A continuous integration provider. This will automatically run tests, generate coverage and upload that coverage to Codecov for every commit.

Getting Started

1. Sign up on Codecov and link either your GitHub, GitLab, or Bitbucket account.


GitHub third-party application access

If you are signing up via GitHub, you may need to request access from an admin to authorize Codecov as a third-party application.

An admin can approve this request in the "Third-party access" tab in the organization's settings page:

For more information see GitHub OAuth Admin Authorization or follow our video guide.

2. Once linked, Codecov will automatically sync all the repositories to which you have access.
A. For GitHub users, install the GitHub App Integration.

3. Below will show you where to find your repos once logged in. Clicking button #1 below will bring you to all of your repos not yet setup. Clicking button #2 on a repo you'd like to connect with Codecov will bring you to the repo setup page where you can find an upload command and token.

Not yet setup repo page, where you will find your repos upon initial loginNot yet setup repo page, where you will find your repos upon initial login

Not yet setup repo page, where you will find your repos upon initial login

4. For Gitlab and Bitbucket users, add a Team Bot so Codecov can push notifications and properly interact with repository providers.

5. Run your normal test suite to generate code coverage reports in a supported format (often an .xml format).

6. Use the Codecov Uploader and the repository upload token, to upload your coverage report(s) to Codecov.

7. Navigate back to the repository on Codecov, and you should see coverage information.


Not ready to use Codecov on your own repositories?

Try it out for yourself with the Codecov Tutorial to see what Codecov has to offer before adding it to your repos.

Advanced Usage

1. Check out our recipe list for common configuration questions.

2. Get Codecov comments on your Pull Requests: (GitLab/Bitbucket) use a Team Bot, (GitHub) use the codecov GitHub integration.

3. Enforce relative or absolute targets and thresholds during your CI build using the Codecov YAML

4. Use flags to categorize reports in a single repository. This is great for monorepos or projects that include different types of test coverage (e.g., unit, end to end, integration).

5. Use Codecov with the Sourcegraph Browser Extension. Note that on-premises versions of repository providers (e.g. GitHub Enterprise) are currently not supported with the Codecov Sourcegraph Browser Extension. Due to changes in SourceGraph's API, the extension is not currently usable with private repositories.

Common Questions

Do I need to setup a codecov.yml to get Codecov to function?
No, Codecov will work without a yaml under it's default settings Please see the About the Codecov yaml page for further information on the default settings and how to configure the yaml further.

What languages does Codecov support?
See Supported Languages

Will Codecov work with my CI provider?
See the List of CI Providers that work with Codecov out of the box, but all CI providers are able to be detected.

Additionally, you can read more about how Codecov fits in with your CI provider in the CI Provider Relationship

Will Codecov work with my repository provider?
Codecov works with Bitbucket, GitLab, and GitHub; and supports each provider's on-premises offering.

Did this page help you?