Skip to content

[15] Add per-contract CI jobs and a coverage job to detect regressions faster #15

Description

@merlik787-droi

Problem Statement

.github/workflows/ci.yml defines a single CI job that runs all six contracts in sequence. There is no per-contract parallelism, no coverage measurement, and no separate jobs for fmt, clippy, test, build. A regression in any one contract blocks feedback for all.

Why It Matters

  • Slow CI is a contributor-experience killer. Per-contract jobs halve or third the critical path.
  • No coverage = no idea what the tests do or don't cover.

Expected Outcome

  • Split into:
    • contracts-fmt: runs across all crates in parallel.
    • contracts-clippy: same.
    • contracts-test-{reward-pool,course-registry,badge-nft,quest-engine,stake-vault,governance} matrix.
    • contracts-build-wasm: builds WASM artifacts and uploads.
    • contracts-coverage: uses cargo-tarpaulin or llvm-cov to generate a coverage report, posted back to PRs as a comment.
  • A reusable composite action .github/actions/setup-stellar for Stellar CLI.

Acceptance Criteria

  • CI runtime reduced by ≥30% via parallelization.
  • Coverage threshold >80% enforced (or measured and reported).
  • Per-contract test results clearly indicate which crate failed.

Implementation Notes

  • Use cargo-nextest for per-test parallelism.
  • Cache target/ per crate with Swatinem/rust-cache already in workflow.

Files / Modules Affected

  • .github/workflows/ci.yml (rewrite).
  • New .github/actions/setup-stellar/action.yml.

Dependencies

None.

Difficulty

Medium.

Estimated Effort

1–2 days.

Suggested Labels

ci, devops, P2


Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions