Codecov is an online service for generating test coverage reports.
Scenario: You have forked a project that already had support for using Codecov in the GitHub Actions CI pipeline. Now you want to set up your fork to work with Codecov as well.
Given below are the steps for achieving the above, recommended to be done by someone who has admin access to the GitHub organization that contains the fork.
org/fork
is listed in the home page. If not, use the re-syncing
link to sync Codecov data with GitHub (and refresh the page afterward). Try again if it doesn't work the first time, as syncing might take some time.Add GitHub organization
link at the bottom of the dropdown list. Doing so will allow you to install the Codecov integration on your GitHub organization, which is same as the next step.All repositories
option instead).https://app.codecov.io/gh/{YOUR_ORG}
(e.g., https://app.codecov.io/gh/my-team-org
).Setup repo>
option for your fork, and follow the instructions for GitHub Actions. You will need to set up the CODECOV_TOKEN
secret as instructed but there is no need to update the workflow YAML file (as the repo you forked already has a YAML file containing the given code).https://app.codecov.io/gh/{YOUR_ORG}/{YOUR_FORK}/settings/badge
(e.g., https://app.codecov.io/gh/se-edu/addressbook-level3/settings/badge
) and update the appropriate page in your fork.You can control if CI still passes even if Codecov task fails using the line
fail_ci_if_error: true
or fail_ci_if_error: false
in .github/workflows/gradle.yml
, under the section related to Codecov.