Skip to content

feat: add GitHub Actions workflow for code coverage with Codecov integration#36

Merged
twangodev merged 3 commits intomainfrom
feat/codecov
Nov 3, 2025
Merged

feat: add GitHub Actions workflow for code coverage with Codecov integration#36
twangodev merged 3 commits intomainfrom
feat/codecov

Conversation

@twangodev
Copy link
Owner

@twangodev twangodev commented Nov 3, 2025

Summary by CodeRabbit

  • Chores
    • CI workflow now includes a dedicated Code Coverage job that runs on Linux to produce Rust test coverage reports.
    • Coverage is generated using a tarpaulin-based process and output in XML format for reporting.
    • Coverage results are uploaded to Codecov; reporting errors are configured not to fail the CI pipeline.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Added a new "Code Coverage" job to the GitHub Actions workflow that runs on ubuntu-latest, sets up Rust, installs cargo-tarpaulin, generates coverage in XML, and uploads the report to Codecov (fail_ci_if_error: false). Job is placed between Build and Docker.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
/.github/workflows/rust.yml
Inserted a "Code Coverage" CI job (runs on ubuntu-latest) that checks out code, sets up Rust, installs cargo-tarpaulin, runs coverage to produce XML into ./coverage, and uploads results to Codecov with fail_ci_if_error: false; positioned between Build and Docker jobs.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GH as GitHub Actions
  participant Repo as Repository
  participant Rust as Rust toolchain
  participant Tarpaulin as cargo-tarpaulin
  participant Codecov as Codecov

  rect rgba(200,230,255,0.25)
    GH->>Repo: checkout code
    GH->>Rust: set up Rust toolchain
    GH->>Tarpaulin: install cargo-tarpaulin
    GH->>Tarpaulin: run `cargo tarpaulin --out xml --output-dir ./coverage`
    Tarpaulin-->>GH: coverage XML artifact
    GH->>Codecov: upload coverage XML (fail_ci_if_error: false)
    Codecov-->>GH: upload response
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify tarpaulin installation approach and compatibility with the repository's Rust toolchain.
  • Confirm Codecov upload configuration (token usage, fail_ci_if_error: false) and secrets handling.

Poem

🐇 I hopped through CI at break of day,
Lines counted neatly in XML array,
Tarpaulin danced, reports in tow,
Codecov nodded — metrics grow,
A rabbit's whisker marks the flow.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a code coverage job to the GitHub Actions workflow with Codecov integration.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/codecov

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 203e2f0 and 434caaf.

📒 Files selected for processing (1)
  • .github/workflows/rust.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/rust.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Code Coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@twangodev twangodev marked this pull request as ready for review November 3, 2025 18:17
Copilot AI review requested due to automatic review settings November 3, 2025 18:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a code coverage job to the Rust CI workflow using cargo-tarpaulin and Codecov for coverage reporting.

  • Introduces a new coverage job that runs tarpaulin to generate code coverage reports
  • Uploads coverage results to Codecov for tracking and visualization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/rust.yml (1)

50-53: Consider upgrading codecov/codecov-action to the latest version.

The latest version is v5.5.1 (released Sep 4), while the workflow currently uses v4. Update line 51 from uses: codecov/codecov-action@v4 to uses: codecov/codecov-action@v5 or @v5.5.1 to benefit from recent bug fixes and improvements.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc68375 and 9189e29.

📒 Files selected for processing (1)
  • .github/workflows/rust.yml (1 hunks)
🔇 Additional comments (2)
.github/workflows/rust.yml (2)

34-49: Code coverage job is well-structured and follows established patterns.

The job correctly orchestrates dependency installation (cargo-tarpaulin), coverage generation in Codecov-compatible XML format, and upload. Action versions are reasonable, and the setup is consistent with the existing build job structure.

A minor note: The fail_ci_if_error: false configuration ensures CI remains green even if the Codecov upload fails (e.g., due to API unavailability), which is a sensible non-blocking approach for a metrics-only job. Confirm this aligns with your team's policy on optional vs. required checks.


34-53: Consider explicit Codecov token for private repositories.

If this repository is private, you may need to explicitly pass a Codecov token to codecov/codecov-action. Public repositories typically don't require this, but private ones do. Verify your repository visibility and add token: ${{ secrets.CODECOV_TOKEN }} to the action configuration if needed.

@codecov
Copy link

codecov bot commented Nov 3, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 3, 2025 18:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@twangodev twangodev enabled auto-merge November 3, 2025 18:37
@twangodev twangodev merged commit f599930 into main Nov 3, 2025
18 checks passed
@twangodev twangodev deleted the feat/codecov branch November 3, 2025 18:37
@coderabbitai coderabbitai bot mentioned this pull request Dec 16, 2025
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.

2 participants