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
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
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.
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:
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.
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
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.
1. Check out our recipe list for common configuration questions.
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.
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.
Updated about 1 month ago