Skip to content

docs(template): add persistence-tier-by-traffic table (sqlite single/… #185

docs(template): add persistence-tier-by-traffic table (sqlite single/…

docs(template): add persistence-tier-by-traffic table (sqlite single/… #185

Workflow file for this run

name: Rust CI
# The primary CI gate for the Sky compiler. Guards the Rust compiler's
# reproducibility + parity invariants via the full xtask gate suite.
#
# Structure: the gates are split across INDEPENDENT jobs that run CONCURRENTLY,
# so the wall-clock is the slowest single job — not the sum of every gate (which
# was ~90 min in one sequential job). Nothing is dropped: every gate that ran
# before runs here, just fanned out. macOS keeps only the platform-determinism
# subset (repro / coerce-floor / runtime behaviour) — the reason for a 2nd OS —
# while ubuntu carries full coverage.
#
# Runs on every push/PR to main (no paths filter, so a required status check
# never deadlocks on a docs-only PR) plus the in-flight rewrite branch.
on:
push:
branches: [main, 'rewrite/rust-compiler']
pull_request:
branches: [main]
# One in-flight run per ref; a newer push cancels the older.
concurrency:
group: rust-ci-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: rust
jobs:
# ── ty crate tests (the heavy corpus tests — each recompiles the stdlib, so
# this crate is the bulk of the old 30-min test step; on its own runner) ──
test-ty:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
shared-key: sky-test-linux
- name: Tests — ty (corpus accept/reject/infer)
run: cargo test -p ty --locked
# ── Every other crate's tests + clippy + doctests ───────────────────────────
test-rest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
shared-key: sky-test-linux
- name: Clippy (report only)
run: cargo clippy --workspace --all-targets || true
- name: Tests — workspace except ty
run: cargo test --workspace --exclude ty --locked
- name: Doctests
run: cargo test --workspace --locked --doc
# ── Accept-side parity gates (infer dominates ~13m) ─────────────────────────
parity-accept:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
shared-key: sky-gates-linux
- run: cargo build --workspace --locked
- name: Gate — roundtrip (reprint == source, L8)
run: cargo run -q -p xtask -- roundtrip
- name: Gate — resolve (name-resolution parity)
run: cargo run -q -p xtask -- resolve
- name: Gate — infer (type accept-parity, M3)
run: cargo run -q -p xtask -- infer
- name: Gate — divergences (known Rust-vs-oracle ledger)
run: cargo run -q -p xtask -- divergences
- name: Gate — s8 (forbidden public-surface patterns)
run: cargo run -q -p xtask -- s8
# ── Reject-side parity + fmt (reject dominates ~16m) ────────────────────────
parity-reject:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
shared-key: sky-gates-linux
- run: cargo build --workspace --locked
- name: Gate — fmt (sky fmt never drops a comment; idempotent)
run: cargo run -q -p xtask -- fmt
- name: Gate — reject (reject-parity)
run: cargo run -q -p xtask -- reject
# ── Byte-stable codegen across fresh processes (~15.5m) ─────────────────────
repro:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
shared-key: sky-gates-linux
- run: cargo build --workspace --locked
- name: Gate — repro (byte-stable Go across fresh processes, L4)
run: cargo run -q -p xtask -- repro
# ── Codegen emit + go build + runtime (needs Go; cached) ────────────────────
codegen-build:
runs-on: ubuntu-latest
env:
GOCACHE: ${{ github.workspace }}/.gocache
GOMODCACHE: ${{ github.workspace }}/.gomodcache
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-go@v5
with:
go-version: '1.26'
cache: false
- name: Cache Go build + module cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.gocache
${{ github.workspace }}/.gomodcache
key: go-linux-${{ hashFiles('runtime-go/go.sum', 'runtime-go/go.mod') }}
restore-keys: go-linux-
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
shared-key: sky-gates-linux
- run: cargo build --workspace --locked
- name: Gate — coerce-floor (runtime-coercion floor lock, FAIL-ON-INCREASE)
run: cargo run -q -p xtask -- coerce-floor
- name: Gate — runtime rt tests (go test)
run: cd ../runtime-go && CGO_ENABLED=0 go test ./rt/...
- name: Gate — build-run (emit + go build every example; FFI skipped)
run: cargo run -q -p xtask -- build-run --all
- name: Gate — golden (runtime-correctness, CLI subset)
run: cargo run -q -p xtask -- build-run --shape cli --run --golden
- name: Gate — stdlib behavioral conformance (sky test suites)
# The behavioral layer the corpus gates + oracle DON'T cover: asserts
# documented stdlib semantics with adversarial inputs (Store multi-col
# order, memoised-CAF stale reads, Log attrs, fromJson-ADT, stack safety).
run: |
cargo build --release -p sky --locked
SKY_BIN="$PWD/target/release/sky" ../scripts/conformance.sh
- name: Gate — live runtime (Sky.Live examples start + serve, no panic)
run: cargo run -q -p xtask -- build-run --shape live --run
- name: Gate — http runtime (Sky.Http.Server examples start + serve)
run: cargo run -q -p xtask -- build-run --shape http --run
- name: Gate — tui runtime (Sky.Tui examples start + run, no panic)
run: cargo run -q -p xtask -- build-run --shape tui --run
# ── Editor-parity (Neovim) + fuzzer (small; isolated setup) ─────────────────
lsp-fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
shared-key: sky-gates-linux
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
- run: cargo build --workspace --locked
- name: Gate — lsp (Neovim editor-parity, 17/17)
run: cargo run -q -p xtask -- lsp
- name: Gate — fuzz (robustness + determinism, L7 + L4)
run: cargo run -q -p xtask -- fuzz
# ── Real-Postgres session-store integration (the store prod shops run on) ───
# The per-push rt tests cover memory/sqlite round-trip + the postgres fail-loud
# branch; the happy-path postgresStore (Get/Set/Delete/TTL/cross-instance
# decode) was never tested against a live engine. A `postgres:16` service
# container + the `integration`-tagged tests close that gap.
integration-postgres:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: sky
POSTGRES_PASSWORD: sky
POSTGRES_DB: sky
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.26'
cache: false
- name: Postgres session-store integration tests
working-directory: runtime-go
env:
SKY_TEST_POSTGRES_DSN: postgres://sky:sky@localhost:5432/sky?sslmode=disable
run: CGO_ENABLED=0 go test -tags integration ./rt/ -run Postgres -v
# ── macOS: platform-determinism subset only (the reason for a 2nd OS) ───────
# Byte-stable codegen (repro) + coerce floor + runtime behaviour must hold on a
# 2nd platform. Full example builds / parity corpora are platform-agnostic and
# stay ubuntu-only above, so macOS carries just the determinism invariants.
macos-determinism:
runs-on: macos-latest
env:
GOCACHE: ${{ github.workspace }}/.gocache
GOMODCACHE: ${{ github.workspace }}/.gomodcache
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-go@v5
with:
go-version: '1.26'
cache: false
- name: Cache Go build + module cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.gocache
${{ github.workspace }}/.gomodcache
key: go-macos-${{ hashFiles('runtime-go/go.sum', 'runtime-go/go.mod') }}
restore-keys: go-macos-
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
shared-key: sky-macos
- run: cargo build --workspace --locked
- name: Gate — repro (byte-stable Go, 2nd platform)
run: cargo run -q -p xtask -- repro
- name: Gate — coerce-floor (2nd platform)
run: cargo run -q -p xtask -- coerce-floor
- name: Gate — runtime rt tests (go test, 2nd platform)
run: cd ../runtime-go && CGO_ENABLED=0 go test ./rt/...
# Platform parity for the emit + go-build regression class. The #164/#166
# alias-collision / record-update-field-drop bugs are gated only by these
# `project` integration tests (they run real `go build` on emitted Go), and
# the CLI golden set is the only runtime-output-correctness gate — both were
# Linux-only, so a macOS-specific codegen/runtime divergence (the very class
# the int64 bug belonged to) could ship green. Run them on the 2nd platform.
- name: Gate — project integration tests (go build regressions, 2nd platform)
run: cargo test -p project --locked
- name: Gate — golden (runtime-correctness CLI subset, 2nd platform)
run: cargo run -q -p xtask -- build-run --shape cli --run --golden
- name: Gate — stdlib behavioral conformance (2nd platform)
run: |
cargo build --release -p sky --locked
SKY_BIN="$PWD/target/release/sky" ../scripts/conformance.sh