Skip to content

ci: upload coverage to Codecov and add the badge - #84

Draft
aryansk wants to merge 1 commit into
shauryagangrade:mainfrom
aryansk:ci/codecov-upload
Draft

ci: upload coverage to Codecov and add the badge#84
aryansk wants to merge 1 commit into
shauryagangrade:mainfrom
aryansk:ci/codecov-upload

Conversation

@aryansk

@aryansk aryansk commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Closes #64.

Problem

CI already runs coverage run -m pytest and uploads .coverage artifacts, but nothing aggregates or publishes the numbers — #24 asked for visible coverage tracking.

Change

  • The test job now emits coverage.xml (uv run coverage xml) after the coverage run.
  • Uploads it with codecov/codecov-action@v6 on every matrix job (main push + PR). fail_ci_if_error: false keeps CI green until the Codecov token secret or Codecov app is configured for the repo.
  • coverage.xml added to .gitignore (generated artifact).
  • Codecov badge added to the README next to the build badge.

Acceptance criteria

  • Coverage is visible on Codecov with a PR status check once the Codecov token/app is configured — the upload step is in place on every run.
  • README shows the badge.

Validation

  • Workflow YAML parses.
  • Local simulation of the pipeline (uv run coverage run -m pytest && uv run coverage report && uv run coverage xml): 107 tests passed, coverage.xml generated successfully.
  • git diff --check clean.

The test job already runs coverage and uploads .coverage artifacts, but no
one aggregates or publishes the numbers. Emit coverage.xml in the test job
and upload it with codecov/codecov-action (fail_ci_if_error: false so CI
stays green until the Codecov token or app is configured), gitignore the
generated file, and add the Codecov badge to the README next to the build
badge. Fixes shauryagangrade#64.

@shauryagangrade shauryagangrade left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid PR: the CI change generates coverage.xml (needed by the action), uploads via codecov/codecov-action@v6, and the badge is wired into the README. No token is required for this public repo.

Notes (non-blocking):

  • The badge will render "unknown" until the first successful upload on main — expected.
  • fail_ci_if_error: false means a coverage upload failure won't fail CI; fine for a badge, but consider flipping it to true once the repo is confirmed on Codecov so silent regressions don't slip through.
  • Stacking: this exact CI/.gitignore/README change is duplicated in #85 and #86. This PR should be the owner of the codecov hunk; #85/#86 need a rebase onto main after this merges or they will conflict.

Approve — ready to merge once you mark the PR ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DevOps]: Upload coverage to Codecov and add a badge (follow-up to #24)

2 participants