A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.codecov.io/docs/common-recipe-list below:

Common Configurations

We've made a list of the commonly asked tasks and created a recipe guide on how to do them by adjusting your codecov.yml.

📘

Changing one of these common configurations?

When modifying the Codecov YAML, please validate the new YAML using curl -X POST --data-binary @codecov.yml https://codecov.io/validate

I want to:

By default, Codecov will only show git diff coverage checks on a PR.

"Project coverage" checks and "project coverage" reporting is not available for Private Repos on the Codecov team plan.

For all other private repos, and for all public repos, here's how you can also show project coverage checks on a PR.

coverage:
  status:
    project: #add everything under here, more options at https://docs.codecov.com/docs/commit-status
      default:
        # basic
        target: auto #default
        threshold: 0%
        base: auto 

Set status checks to block coverage values on my pull requests

coverage:
  status:
    project:
      default:
        target: 80%    # the required coverage value
        threshold: 1%  # the leniency in hitting the target

Set blocking coverage targets so that each PR must increase coverage

coverage:
  status:
    project:
      default:
        target: auto  # auto compares coverage to the previous base commit

Relax my coverage target, because I have flaky tests

coverage:
  status:
    project:
      default:
        target: auto
        # adjust accordingly based on how flaky your tests are
        # this allows a 10% drop from the previous base commit coverage
        threshold: 10%

Set blocking coverage so that new code must be fully tested

coverage:
  status:
    patch:
      default:
        target: 100%

See status checks but prevent them from blocking

coverage:
  status:
    project:
      default:
        informational: true
    patch:
      default:
        informational: true

Change the format of the pull request comment

comment:
  layout: "diff, flags, files"  # Remove items here to change the format

By default, Codecov only shows coverage changes on the git diff on the pull request comment.

"Project coverage" checks and "project coverage" reporting is not available for Private Repos on the Codecov team plan.

For all other private repos, and for all public repos, here's how you can also show project coverage on a PR comment.

comment:                  #this is a top-level key
  layout: " diff, flags, files"
  behavior: default
  require_changes: false  # if true: only post the comment if coverage changes
  require_base: false        # [true :: must have a base report to post]
  require_head: true       # [true :: must have a head report to post]
  hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]]
  1. Show the comment only on coverage changes
comment:
  require_changes: true

Show the Codecov status without waiting for other status checks to complete or pass

codecov:
  require_ci_to_pass: false

Send notifications as soon as possible, even if the CI has not completed or a manual CI workflow step is required.

codecov:
  notify:
    wait_for_ci: false

Isolate coverage based on the coverage report uploads

flags:
  projectA:
    paths: 
      - src/projectA/
  projectB:
    paths:
      - src/projectB/
  
# To see status checks based on flags
coverage:
  status:
    project:
      default:
        flags:
          - projectA
          - projectB
      projectA:
        flags:
          - projectA
      projectB:
        flags:
          - projectB

You will need to assign a flag to each coverage report uploaded. We strongly do not recommend using multiple flags on the same report. Instead, upload the report twice.

##Your Codecov Uploader approach here
##See more at https://docs.codecov.com/docs/codecov-uploader

./codecov  -f coverage.xml -F projectA
./codecov  -f coverage.xml -F projectB

Disable PR comments from Codecov

By default, GitHub Check Run Annotations are enabled, and look like the following in your Pull Request:

While these annotations provide a helpful "at a glance" view of uncovered lines of code, GitHub's default styling rules for annotations can lead to excessive visual clutter. To disable these annotations you have three options:

  1. Temporarily: Toggle the visibility of all annotations by pressing the A key. This will immediately hide all annotations.
  2. Permanently: Update (or create) a codecov.yml in the root of your repository and paste the following lines into it:
github_checks:
	annotations: false
  1. Alternatively: If the information presented by the annotation is meaningful, but causes too much visual clutter, we recommend disabling Check Run Annotations using the YAML snippet above and installing the Codecov Browser Extension instead.

With the Codecov Browser Extension installed, covered and uncovered lines of code in the Pull Request will look as follows:

Updated over 1 year ago


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4