This document describes the automated CI/CD pipeline for building, testing, and deploying QuorumProof smart contracts.
| Workflow | File | Trigger |
|---|---|---|
| CI (build, test, security scan) | ci.yml |
Push/PR to main or develop |
| Testnet deploy (PR preview) | deploy-pr.yml |
PR opened/updated against main |
| Mainnet deploy (gated) | deploy-mainnet.yml |
Manual (workflow_dispatch) |
Runs on every push and pull request to main or develop.
Jobs:
- contracts — Builds all Soroban WASM contracts and runs the full test suite. Includes the migration verification gate which runs snapshot-diff invariant checks (see
docs/migration-invariants.md). - frontend — Installs dependencies, lints, tests, and builds the frontend.
- security — Runs
cargo auditto check for known vulnerabilities in Rust dependencies, and TruffleHog to detect any hardcoded secrets in the diff.
All three jobs must pass before a PR can be merged. The migration verification gate (cargo test -p integration_tests -- migration_verification) runs as part of the contracts job and must pass before any migration PR can be merged.
Triggered automatically when a PR is opened or updated against main.
What it does:
- Builds contracts and runs tests.
- Deploys all three contracts (
quorum_proof,sbt_registry,zk_verifier) to Stellar testnet. - Posts a comment on the PR with the deployed contract IDs.
Required secrets (configured in the testnet GitHub environment):
| Secret | Description |
|---|---|
STELLAR_RPC_URL |
Testnet RPC endpoint |
STELLAR_SECRET_KEY |
Testnet deployer secret key (S...) |
Manual-only deployment with two gates:
- Confirmation string — The person triggering the workflow must type
deploy-mainnetexactly in the input field. - GitHub environment approval — The
mainnetenvironment must be configured with required reviewers in GitHub repository settings. The job will pause and wait for an authorized reviewer to approve before proceeding.
What it does:
- Validates the confirmation string.
- Waits for manual approval (via GitHub environment protection rules).
- Builds contracts, runs tests, and runs
cargo audit. - Deploys all three contracts to Stellar mainnet.
- Outputs contract IDs to the workflow summary.
Required secrets (configured in the mainnet GitHub environment):
| Secret | Description |
|---|---|
MAINNET_RPC_URL |
Mainnet RPC endpoint |
MAINNET_SECRET_KEY |
Mainnet deployer secret key (S...) |
- Go to Settings → Environments → New environment → name it
testnet. - Add secrets:
STELLAR_RPC_URL,STELLAR_SECRET_KEY. - No approval required (deploys automatically on PR).
- Go to Settings → Environments → New environment → name it
mainnet. - Enable Required reviewers and add at least one authorized reviewer.
- Add secrets:
MAINNET_RPC_URL,MAINNET_SECRET_KEY. - Optionally set a deployment branch rule to restrict to
mainonly.
- Ensure the PR is merged to
mainand all CI checks pass. - Go to Actions → Deploy Mainnet → Run workflow.
- In the confirmation field, type exactly:
deploy-mainnet - Click Run workflow.
- An authorized reviewer will receive an approval request — the deployment proceeds only after approval.
- Contract IDs are shown in the workflow summary after a successful run. Record them in
.envand the team password manager.
- Never commit secret keys. All keys are stored as GitHub environment secrets.
- The
mainnetenvironment requires human approval — automated triggers are intentionally not supported. cargo auditruns on every CI check and again before every mainnet deployment.- TruffleHog scans every PR diff for accidentally committed secrets.
- See
docs/deployment-guide.mdfor the full manual deployment procedure and post-deployment security checklist.