ci: per-contract matrix jobs, coverage, and reusable setup action - #47
Open
malaysiaonelove wants to merge 1 commit into
Open
ci: per-contract matrix jobs, coverage, and reusable setup action#47malaysiaonelove wants to merge 1 commit into
malaysiaonelove wants to merge 1 commit into
Conversation
- Split single sequential CI job into 5 parallel jobs: contracts-fmt, contracts-clippy, contracts-test (6-crate matrix), contracts-build-wasm, contracts-coverage - Add .github/actions/setup-stellar composite action to deduplicate toolchain + cache + Stellar CLI setup across all jobs - Use cargo-nextest for per-test parallelism in test matrix - Add cargo-llvm-cov coverage job with 80% line threshold enforcement - Post sticky coverage summary comment on PRs - Upload lcov.info to Codecov and WASM artifacts to GitHub Actions - Add concurrency group to cancel stale in-flight runs Closes Kqirox#15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #15
Rewrites
.github/workflows/ci.ymlfrom a single sequential job into a parallel job graph, and adds a reusable composite action for Stellar + Rust setup.Job topology
Changes
New:
.github/actions/setup-stellar/action.ymlReusable composite action that installs the Rust toolchain (rustfmt + clippy + wasm targets), primes
Swatinem/rust-cache, and installs the Stellar CLI. Inputs:rust-toolchain,stellar-cli-version,cache-workspaces.Rewritten:
.github/workflows/ci.ymlcontracts-fmtcargo fmt --all -- --checkacross the workspacecontracts-clippycargo clippy --all-targets --all-features -- -D warningscontracts-test / <crate>cargo nextest run --package <crate> --features testutils, one runner per crate,fail-fast: falsecontracts-build-wasmstellar contract build, uploads*.wasmas a 14-day artifactcontracts-coveragecargo llvm-cov nextest --all, enforces ≥ 80% line coverage, posts sticky PR comment, uploadslcov.infoto CodecovAcceptance criteria
contracts-coveragefails the build if line coverage drops belowCOVERAGE_THRESHOLD(default80)test / reward-pool,test / badge-nft, etc., so GitHub clearly surfaces which crate failed.github/actions/setup-stellarused by all 5 jobsNotes
CODECOV_TOKENmust be added to repo secrets if Codecov integration is desired (fail_ci_if_error: falseso it won't block CI if absent)COVERAGE_THRESHOLD: "80") — easy to adjustconcurrency:group cancels stale in-flight runs on the same ref