2026-04-29 18:50:55 +02:00
|
|
|
#!/usr/bin/env bash
|
ci: restore verification — reachable submodule pin, codegen + WASM freshness gates
Phase 0 of the 2026-07 simplification audit (plan §1). CI has been 100% red on
main since 2026-07-13 and every "gates green" claim since rested on local runs.
- S7 / critic gap 2: push memllib `feat/nisps-core-swap` (3 commits incl. the
pin b37fc53) to monkey-w1n5t0n/memllib and repoint .gitmodules at the fork.
Those commits existed on exactly one disk; `git ls-remote` now resolves the
pin, so `submodules: recursive` checkout and fresh clones work again. Drops
the compensating unreachable-pin error paragraph in build-firmware-arch.sh.
- S24 / S31: the manifold-tests job regenerates from schemas/, runs the codegen
golden test, and fails on a dirty diff — the "schema changes ship with both
generated outputs" rule is now enforced rather than assumed.
- S32: a WASM freshness gate runs the parity harness against the *committed*
manifold/public/nisps.{js,wasm} before the CI rebuild overwrites it. That
artifact is what the webhook ships to production, so a stale commit now fails
loudly instead of shipping.
- critic gap 3 / operator decision §7.4: the VPS webhook
(~/.config/webhooks/meml-deploy.sh, not in this repo) waits for the `CI`
workflow to conclude success on the pushed SHA before building. Fail-closed;
MEML_SKIP_CI_GATE=1 for an emergency hand-deploy. Verified the gate query
returns `failure` for fa37047, i.e. it would have blocked that deploy.
- S31: corrected run-all-tests.sh's false "single command CI invokes" header.
Docs moved with the code: ALIGNMENT defect 1 deleted (resolved) and the rest
renumbered; MAP.md's unreachable-pin warning replaced with the fork pin and a
pointer to the §7.5 vendoring decision; ONBOARDING documents the deploy gate
and the tracked-WASM-ships-to-prod hazard; plan §1 marked burned down.
Gates: scripts/run-all-tests.sh ALL GREEN (ctest 4/4, parity 1273 floats within
1e-5, lint, typecheck, 33 Playwright specs).
2026-07-21 11:57:32 +02:00
|
|
|
# scripts/run-all-tests.sh — master local entrypoint that exercises every
|
|
|
|
|
# check the repo owns. CI (.github/workflows/ci.yml) does NOT invoke this
|
|
|
|
|
# script; it re-lists the same stages as discrete steps so failures are
|
|
|
|
|
# attributable per-step. Keep the two in sync when adding a stage.
|
2026-04-29 18:50:55 +02:00
|
|
|
#
|
|
|
|
|
# Stages (each fails fast):
|
|
|
|
|
# 1. C++ build + ctest → scripts/build-cpp-tests.sh
|
|
|
|
|
# 2. WASM build → scripts/build-wasm.sh
|
|
|
|
|
# 3. Parity check → scripts/parity-check.sh
|
|
|
|
|
# 4. Lint → scripts/lint-cpp.sh
|
2026-07-13 23:27:56 +02:00
|
|
|
# 5. Manifold tests → cd manifold && typecheck + build + bun test + playwright
|
2026-04-29 18:50:55 +02:00
|
|
|
#
|
|
|
|
|
# Flags via env:
|
|
|
|
|
# NISPS_SKIP_PLAYWRIGHT=1 skip the Playwright leg (useful in C++-only loops)
|
|
|
|
|
# NISPS_SKIP_WASM=1 skip WASM build + parity (no emcc available)
|
|
|
|
|
# NISPS_LINT_STRICT=1 treat lint warnings as failures
|
2026-07-13 23:27:56 +02:00
|
|
|
# PLAYWRIGHT_BROWSERS_PATH respected (on the VPS point it at the snap-bun
|
|
|
|
|
# browser cache — see docs/specs/plans/BUILD-PLAN.md)
|
2026-04-29 18:50:55 +02:00
|
|
|
#
|
|
|
|
|
# Exit codes: 0 on full success, otherwise the failing stage's exit code.
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
|
cd "$ROOT"
|
|
|
|
|
|
|
|
|
|
stage() { printf '\n=== %s ===\n' "$1"; }
|
|
|
|
|
|
|
|
|
|
stage "1/5 C++ build + ctest"
|
|
|
|
|
"$ROOT/scripts/build-cpp-tests.sh"
|
|
|
|
|
|
|
|
|
|
if [[ "${NISPS_SKIP_WASM:-0}" != "1" ]]; then
|
|
|
|
|
stage "2/5 WASM build"
|
|
|
|
|
"$ROOT/scripts/build-wasm.sh"
|
|
|
|
|
|
|
|
|
|
stage "3/5 parity check"
|
|
|
|
|
"$ROOT/scripts/parity-check.sh"
|
|
|
|
|
else
|
|
|
|
|
stage "2/5 WASM build (skipped: NISPS_SKIP_WASM=1)"
|
|
|
|
|
stage "3/5 parity check (skipped: NISPS_SKIP_WASM=1)"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
stage "4/5 lint"
|
|
|
|
|
"$ROOT/scripts/lint-cpp.sh"
|
|
|
|
|
|
|
|
|
|
if [[ "${NISPS_SKIP_PLAYWRIGHT:-0}" != "1" ]]; then
|
2026-07-13 23:27:56 +02:00
|
|
|
stage "5/5 manifold tests"
|
2026-04-29 18:50:55 +02:00
|
|
|
if ! command -v bun >/dev/null 2>&1; then
|
2026-07-13 23:27:56 +02:00
|
|
|
echo "[run-all-tests] bun not on PATH; skipping manifold stage"
|
2026-04-29 18:50:55 +02:00
|
|
|
else
|
2026-07-18 12:45:45 +02:00
|
|
|
(
|
|
|
|
|
# Codegen idempotence golden (C++ + manifold TS outputs).
|
|
|
|
|
cd "$ROOT/codegen"
|
|
|
|
|
bun install --frozen-lockfile 2>/dev/null || bun install
|
|
|
|
|
bun run tests/golden_test.ts
|
|
|
|
|
)
|
2026-04-29 18:50:55 +02:00
|
|
|
(
|
2026-07-13 23:27:56 +02:00
|
|
|
cd "$ROOT/manifold"
|
2026-04-29 18:50:55 +02:00
|
|
|
bun install --frozen-lockfile 2>/dev/null || bun install
|
|
|
|
|
bun run typecheck
|
2026-07-13 23:27:56 +02:00
|
|
|
bun run test
|
|
|
|
|
bun run build
|
|
|
|
|
# The Playwright RUNNER goes through non-snap node: snap-confined
|
|
|
|
|
# bun cannot see host browser libraries (BUILD-PLAN gotcha).
|
2026-04-29 18:50:55 +02:00
|
|
|
# Ensure browsers are present. `--with-deps` is heavy; leave to CI.
|
2026-07-13 23:27:56 +02:00
|
|
|
node node_modules/.bin/playwright install chromium >/dev/null 2>&1 || true
|
|
|
|
|
node node_modules/.bin/playwright test
|
2026-04-29 18:50:55 +02:00
|
|
|
)
|
|
|
|
|
fi
|
|
|
|
|
else
|
2026-07-13 23:27:56 +02:00
|
|
|
stage "5/5 manifold tests (skipped: NISPS_SKIP_PLAYWRIGHT=1)"
|
2026-04-29 18:50:55 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
stage "ALL GREEN"
|