Files
faunosteo/.gitea/workflows/ci.yml
T

79 lines
3.2 KiB
YAML

# Gitea Actions (same syntax as GitHub Actions). Runs on the self-hosted forge
# runner; no external provider. The check job covers the SQL layer through the
# PGlite harness (no Docker); the supabase job replays it on the real stack.
#
# Rust (plan R0, docs/development/RUST.md): every cargo command runs inside the
# reference builder image built from docker/rust-builder.Dockerfile, so CI and a
# developer machine use the same toolchain and the production VPS never needs Rust.
name: ci
on:
push:
branches: [main, develop]
pull_request:
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Reference Rust builder image (runner needs a Docker daemon)
run: docker build -f docker/rust-builder.Dockerfile -t faunosteo_rust_builder:1.99.0 docker
- name: fmt, clippy, tests, ts-rs export, cargo-deny (licenses, bans, sources)
run: bash docker/rust-run.sh bash docker/rust-check.sh
- name: Committed TypeScript types match the Rust contracts
run: git diff --exit-code -- packages/core-wasm/types
- name: Browser module builds (size printed; the budget is asserted by the vitest proofs)
run: bash docker/rust-run.sh bash docker/wasm-build.sh
check:
runs-on: ubuntu-latest
needs: rust
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Activate pnpm (version from package.json "packageManager")
run: corepack enable && corepack prepare --activate
- run: pnpm install --frozen-lockfile
- name: Browser module for the core-wasm proofs (same builder image as the rust job)
run: docker build -f docker/rust-builder.Dockerfile -t faunosteo_rust_builder:1.99.0 docker && bash docker/rust-run.sh bash docker/wasm-build.sh
- run: pnpm typecheck
- run: pnpm test:run
- run: pnpm lint
- run: pnpm build
docker:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- name: Application image builds (runner needs a Docker daemon)
run: docker build -t faunosteo:ci .
- name: Worker sandbox tests and seccomp derivation on the musl binary that ships
run: docker build -f crates/worker/Dockerfile --target test -t faunosteo_worker:test .
- name: Worker runtime image builds and starts (configuration check, no job loop before R1)
run: |
docker build -f crates/worker/Dockerfile -t faunosteo_worker:ci .
docker run --rm --read-only --cap-drop ALL --security-opt no-new-privileges:true faunosteo_worker:ci run --check
supabase:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: corepack enable && corepack prepare --activate
- run: pnpm install --frozen-lockfile
- name: Start the local stack (runner needs a Docker daemon); applies migrations + seed
run: pnpm supabase start
- name: pgTAP on the real PostgreSQL image
run: pnpm db:test
- name: Generated types match the schema
run: pnpm db:types:check
- if: always()
run: pnpm supabase stop --no-backup