Type : DevOps | Priority : HIGH | Effort : 10 hours
Component : .github/workflows/, CI configuration files
Problem :
No unified CI/CD pipeline covering all project components. Quality issues slip through to production:
No automated testing before merge
Breaking changes deployed to production
Security vulnerabilities not caught early
Type errors in TypeScript not detected
Contract regressions not prevented
Inconsistent code style across team
No build verification before deployment
Manual testing is time-consuming and error-prone
Current State :
Desired State :
Comprehensive, automated CI/CD pipeline that:
Runs on every pull request and push to main
Tests all components (frontend, backend, contracts)
Enforces code quality standards
Provides fast feedback (< 10 minutes)
Prevents broken code from merging
Automates deployments after successful builds
Acceptance Criteria :
1. Frontend CI Pipeline (.github/workflows/frontend-ci.yml)
2. Backend CI Pipeline (.github/workflows/backend-ci.yml)
3. Smart Contract CI Pipeline (.github/workflows/contracts-ci.yml)
4. Unified Quality Gate (.github/workflows/quality-gate.yml)
5. Deployment Pipeline (.github/workflows/deploy.yml)
Workflow Structure :
# .github/workflows/frontend-ci.yml
name : Frontend CI
on :
pull_request :
paths :
- ' frontend/**'
- ' .github/workflows/frontend-ci.yml'
push :
branches : [main]
paths :
- ' frontend/**'
jobs :
lint :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- uses : actions/setup-node@v3
with :
node-version : 18
cache : ' npm'
cache-dependency-path : frontend/package-lock.json
- run : cd frontend && npm ci
- run : cd frontend && npm run lint
- run : cd frontend && npm run format:check
type-check :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- uses : actions/setup-node@v3
- run : cd frontend && npm ci
- run : cd frontend && npm run type-check
test :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- uses : actions/setup-node@v3
- run : cd frontend && npm ci
- run : cd frontend && npm run test -- --coverage
- uses : codecov/codecov-action@v3
with :
files : ./frontend/coverage/coverage-final.json
fail_ci_if_error : true
build :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- uses : actions/setup-node@v3
- run : cd frontend && npm ci
- run : cd frontend && npm run build
- uses : actions/upload-artifact@v3
with :
name : frontend-build
path : frontend/.next
security :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- uses : actions/setup-node@v3
- run : cd frontend && npm ci
- run : cd frontend && npm audit --audit-level=high
- uses : trufflesecurity/trufflehog@main
with :
path : ./frontend
# .github/workflows/backend-ci.yml
name : Backend CI
on :
pull_request :
paths :
- ' backend/**'
push :
branches : [main]
paths :
- ' backend/**'
jobs :
lint-and-test :
runs-on : ubuntu-latest
services :
postgres :
image : postgres:15
env :
POSTGRES_PASSWORD : test_password
POSTGRES_DB : test_db
options : >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis :
image : redis:7
options : >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps :
- uses : actions/checkout@v3
- uses : actions/setup-node@v3
with :
node-version : 18
- run : cd backend && npm ci
- run : cd backend && npm run lint
- run : cd backend && npm run type-check
- run : cd backend && npm run test -- --coverage
env :
DATABASE_URL : postgresql://postgres:test_password@localhost:5432/test_db
REDIS_URL : redis://localhost:6379
- run : cd backend && npm run test:integration
# .github/workflows/contracts-ci.yml
name : Contracts CI
on :
pull_request :
paths :
- ' contracts/**'
push :
branches : [main]
paths :
- ' contracts/**'
jobs :
test :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- uses : actions-rs/toolchain@v1
with :
toolchain : stable
components : rustfmt, clippy
- uses : Swatinem/rust-cache@v2
- name : Format Check
run : cd contracts && cargo fmt --all -- --check
- name : Clippy
run : cd contracts && cargo clippy --all-targets -- -D warnings
- name : Build
run : cd contracts && cargo build --release
- name : Run Tests
run : cd contracts && cargo test --all
- name : Security Audit
run : cd contracts && cargo audit
- name : Gas Benchmarks
run : cd contracts && cargo bench --no-run
Success Metrics :
Related Files :
.github/workflows/frontend-ci.yml (create)
.github/workflows/backend-ci.yml (update from Issue [Contract] Add Metadata Support for Stream References #14 )
.github/workflows/contracts-ci.yml (create)
.github/workflows/quality-gate.yml (create)
.github/workflows/deploy.yml (create)
docs/CI_CD_GUIDE.md (create documentation)
Documentation Requirements :
Type: DevOps | Priority: HIGH | Effort: 10 hours
Component:
.github/workflows/, CI configuration filesProblem:
No unified CI/CD pipeline covering all project components. Quality issues slip through to production:
Current State:
Desired State:
Comprehensive, automated CI/CD pipeline that:
Acceptance Criteria:
1. Frontend CI Pipeline (
.github/workflows/frontend-ci.yml)2. Backend CI Pipeline (
.github/workflows/backend-ci.yml)3. Smart Contract CI Pipeline (
.github/workflows/contracts-ci.yml)4. Unified Quality Gate (
.github/workflows/quality-gate.yml)5. Deployment Pipeline (
.github/workflows/deploy.yml)Workflow Structure:
Success Metrics:
Related Files:
.github/workflows/frontend-ci.yml(create).github/workflows/backend-ci.yml(update from Issue [Contract] Add Metadata Support for Stream References #14).github/workflows/contracts-ci.yml(create).github/workflows/quality-gate.yml(create).github/workflows/deploy.yml(create)docs/CI_CD_GUIDE.md(create documentation)Documentation Requirements: