codecov.yml Reference

🚧

Changing your YAML?

Changing your YAML? A reminder to always validate your YAML before you deploy https://api.codecov.io/validate

codecov:
  token: "<some token here>"
  bot: "codecov-io"
  ci:
    - "travis.org"
  strict_yaml_branch: "yaml-config"
  max_report_age: 24
  disable_default_path_fixes: no
  require_ci_to_pass: yes
  notify:
    after_n_builds: 2
    wait_for_ci: yes

The repository upload token

  • Type: String
  • Default: N/A

The username you want to use for Codecov operations


Additional CI provider URLs you want Codecov to recognize.


Specify a branch you want Codecov to always only read the YAML from


The age you want coverage reports to expire at, or if you want to disable this check. Expired reports will not be processed by codecov.


Should Codecov's default path fixes be disabled


Should Codecov wait for all other statuses to pass before sending its status.

  • Type: Boolean
  • Default: true

How many uploaded reports Codecov should wait to receive before sending statuses


Should Codecov wait for all CI statuses to complete before sending ours.
Note: Codecov considers all non-codecov statuses to be CI statuses

  • Type: Boolean
  • Default: true

If any uploads fail to process replace the regular coverage comment with a comment containing the number of uploads that failed.

  • Type: Boolean
  • Default: false

codecov:
  notify:
    manual_trigger: true

Codecov will trigger no notifications or statuses until explicitly told do so by the CLI. This setting is helpful if your CI upload pipeline uploads a variable number of coverage reports per commit, and you would prefer to get no notifications from Codecov until Codecov is told to do so (e.g., at the end of the CI process).

Note that this feature requires the use of Codecov's CLI, and no notifications will be triggered until the CLI's send-notifications command is executed in your CI run.

  • Type: Boolean
  • Default: false

component_management:
    default_rules:  # Dict. rules inherited by all components that don't define a tag for themselves.
    paths: # List. Path filters.
        - "specific_file.txt
      - "^some.*regex$"
      - "glob/*"
    flag_regexes: # List. Flags to be included in the component.
        - "fruit.*"
    statuses: # List. Status definitions.
    # These statuses are the same as for flag_management
    # Except they don't accept 'flags'
  individual_components:  # List. These are the actual components.
    - component_id: component_1  # String. Required.
        name: display_name_1    # String. Optional.
      # Individual components also accept paths, flag_regexes and statuses
    - component_id: other_component
    #...

More info: https://docs.codecov.com/docs/components

coverage:
  precision: 2
  round: down
  range: "70...100"
  notify:
    # notification blocks. See: https://docs.codecov.io/docs/codecovyml-reference#section-coverage-notify
  status:
    project:
    :
    changes:

What precision do you want the coverage value to be

  • Type: Range(0,5)
  • Default: 2

Which direction to you want to round the coverage value

  • Type: One of 'down', 'up', 'nearest'
  • Default: down

The value range where you want the value to be green


The standard notification settings are shown below, but it is recommend to view https://docs.codecov.io/docs/notifications for more information.

<notification_provider>: #see: ttps://docs.codecov.io/docs/notifications
  url: "https://hooks.example.com/hook/8675309"
  branches': 
    - master
    - dev
    - staging
  threshold': 1%
  flags: 
    - backend
    - frontend
  base: "parent"
  only_pulls: false
  paths: "*/**/*"

Note that the following notification providers are supported and will need to be defined in the YAML (see Notifications):

  • Gitter
  • IRC
  • Slack

More info: https://docs.codecov.io/docs/commit-status

coverage:
  status:
    project:
      default: # This can be anything, but it needs to exist as the name
        # basic settings
        target: auto
        threshold: 5%
        base: auto 
        # advanced settings
        branches: 
          - master
        if_ci_failed: error #success, failure, error, ignore
        only_pulls: false
        flags: 
          - frontend
        paths: 
          - src/frontend
        removed_code_behavior: off #removals_only, fully_covered_, adjust_base",

parsers:
  javascript:
    enable_partials: yes # default yes
  v1:
    include_full_missed_files: true  # default false
  gcov:
    branch_detection:
      conditional: yes
      loop: yes
      method: no
      macro: no
  cobertura:
  	handle_missing_conditions: true #default false
    partials_as_hits: true #default false

Controls how Codecov counts partial coverage hits in Jacoco

  • Type: map
parsers:
  jacoco:
    partials_as_hits: true #false by default

Unknown


Unknown


Controls how Codecov parses branch coverage in gcov reports. The coverage must exist in the uploaded report for us to parse it.

parsers:
  gcov:
    branch_detection:
      conditional: yes
      loop: yes
      method: no
      macro: no

Controls how Codecov parses partial coverage in Golang reports. The coverage must exist in the uploaded report for us to parse it.

  • Type: map
parsers:
  go:
    partials_as_hits: true #false by default

Controls how Codecov parses partial coverage in Cobertura reports. The coverage must exist in the uploaded report for us to parse it.

  • Type: map
parsers:
  cobertura:
    partials_as_hits: true # false by default
    handle_missing_conditons: true # false by default

ignore:
  - "path/to/folder"  # ignore folders and all its contents
  - "test_*.rb"       # wildcards accepted
  - "**/*.py"         # glob accepted

fixes:
  - "before/::after/"  # move path   e.g., "before/path" => "after/path"
  - "::after/"         # move root   e.g., "path/" => "after/path/"
  - "before/::"        # reduce root e.g., "before/path/" => "path/"

flags:
  projectA:  
    paths:
      - projectA/src
     carryforward: false #default -- false
  projectB:
    paths:
      - projectB/src
     carryforward: true

comment:
  layout: "diff, flags, files"
  behavior: default
  require_changes: false  # if true: only post the comment if coverage changes

Toggle the sending of notifications through the Codecov Slack App

slack_app: false

_checks:
  annotations: false

  • How to disable archiving - In your codecov.yml, set the following line to false as follows:
codecov:
  archive:
    uploads: false

Specify whether to use Checks annotations or normal statuses. Checks are enabled by default and can be modified on the top level in your codecov.yml.

  • Type: Boolean
  • Default: true
  • More Info: Checks