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.
Only select repositories
and choose your repo (you can also use the All repositories
option instead). After that, click the .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).https://app.codecov.io/gh/{YOUR_ORG}
(e.g., https://app.codecov.io/gh/my-team-org
).Step 1: Generate and upload coverage reports in your CI
, as it is already set up in your repo.CODECOV_TOKEN
secret as instructed but there.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.