Codecov uses a Yaml-style configuration methodology.
There are two primary locations for the Codecov Yaml: the Team Yaml and the Repository Yaml. Each of them play an important role in how to configure Codecov.
Looking for all possible YAML configurations?
See the full codecov.yml Reference page.
The default configuration for all projects in Codecov is demonstrated below. You may override any of these configurations in your own Team/Repository Yaml.
codecov require_ci_to_passyes coverage precision2 rounddown range"70...100" status projectyes patchyes changesno parsers gcov branch_detection conditionalyes loopyes methodno macrono comment layout"reach,diff,flags,tree" behaviordefault require_changesno
Codecov provides a user interface to adjust a "team yaml", which overrides the default settings in Codecov. It is applied to all repositories in the team. Only team administrators can adjust the team yaml in Codecov. All changes are stored in history.
The team yaml (seen in the black box above) can be found in your account center
Each repository may have their own unique Codecov Yaml. The contents of the Repository Yaml are stored in a file, checked into
.codecov.yml in the project root or any subdirectory.
All configurations in the Repository Yaml will override the Team Yaml. The Team Yaml is not replaced, but updated with the Repository Yaml.
# Team Yaml coverage rounddown precision5 # Repository Yaml coverage roundup range0..10 # Used in Codecov after updating coverage roundup range0..10 precision5
Looking to pass or fail a pull request / merge request based on coverage?
Please see our "Commit Status" feature for passing or failing a pull request based on code coverage thresholds
Validate your repository yaml by posting the content to Codecov for analysis.
curl --data-binary @codecov.yml https://codecov.io/validate
# PowerShell Sample Invoke-RestMethod -Uri https://codecov.io/validate -Body (Get-Content -Raw -LiteralPath .\.codecov.yml) -Method post
Codecov will use the default branch for your repository as the "master" copy of the repositories Codecov Yaml. The default branch, if not otherwise stated, is the
master branch. You can change the Codecov default branch in your Yaml.
The default branch is used to identify:
- Which branch to cache the repository yaml for UI changes.
- Which branch is the first branch on the repository dashboard in Codecov.
Codecov will always use the current yaml on the branch being tested by default. If you would like to restrict changes to the yaml, and always use the yaml on a specific branch, you may declare the branch as shown below.
codecov: strict_yaml_branch: master # only use the latest copy on master branch
Codecov will reject reports that are over 12 hours old according to the timestamp in the report. This is to prevent reports that may have been accidently checked into
To disable this functionality please add the following to your
Yes. You can name the file either
.codecov.yml. The file can be placed anywhere in your repository.
The Codecov Yaml file is the single-point of configuration, providing the developers with a transparent and version controlled file to adjust all Codecov settings.
No. Review our default yaml, which all projects use. However, if you need to customize your project in Codecov, or add new notifications, then the yaml is required.
Head over to your repository settings page; click the Yaml tab. You will find the Create new secret string section in the UI. Information on how to create and use these strings is found in the app.