Skip to content

ci: add Codecov integration with cargo-tarpaulin#188

Merged
ayomideadeniran merged 1 commit intoSoroLabs:mainfrom
AnnabelJoe:feat/codecov-integration
Mar 30, 2026
Merged

ci: add Codecov integration with cargo-tarpaulin#188
ayomideadeniran merged 1 commit intoSoroLabs:mainfrom
AnnabelJoe:feat/codecov-integration

Conversation

@AnnabelJoe
Copy link
Copy Markdown
Contributor

Summary

Closes #158

Adds automated code coverage reporting to the CI pipeline using cargo-tarpaulin and Codecov.io.

Changes

  • .github/workflows/ci.yml — New coverage job that:

    • Installs cargo-tarpaulin via cargo-binstall (fast binary install, no compile wait)
    • Runs cargo tarpaulin --out Xml --all-features --workspace against the full Rust workspace
    • Uploads the generated cobertura.xml to Codecov via codecov/codecov-action@v4
    • Triggers on pushes to main and all pull requests (same as existing jobs)
  • .tarpaulin.toml — Root-level config that excludes:

    • Test files (*/tests/*, *_test.rs, test_*)
    • Proptest regression files
    • External SDK crates (soroban_sdk, soroban_env_host) from coverage percentage

Required Setup

Before this workflow will succeed, add your Codecov token as a repository secret:

  1. Go to codecov.io → connect your repo → copy the upload token
  2. In GitHub: Settings → Secrets and variables → Actions → New repository secret
    • Name: CODECOV_TOKEN
    • Value: (paste token)

Notes

  • The coverage job runs independently from test and build — a coverage failure won't block the other jobs
  • fail_ci_if_error: true is set so a failed Codecov upload surfaces as a visible CI failure rather than silently passing

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

One thing to do before merging: add CODECOV_TOKEN as a GitHub Actions secret (instructions are in the PR description). Without it the upload step will
fail.

- Add 'coverage' job to CI workflow using cargo-binstall for fast tarpaulin install
- Run tarpaulin with --out Xml --all-features --workspace flags
- Upload cobertura.xml to Codecov via codecov/codecov-action@v4
- Add .tarpaulin.toml to exclude test files and external SDK deps from coverage
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@AnnabelJoe Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ayomideadeniran
Copy link
Copy Markdown
Contributor

Pr under review.

@ayomideadeniran
Copy link
Copy Markdown
Contributor

Thanks for the PR! This is currently under review and I will get back to you shortly.

@ayomideadeniran ayomideadeniran merged commit 1031577 into SoroLabs:main Mar 30, 2026
1 of 4 checks passed
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] Implement Codecov Integration for Contract Suite

2 participants