pnpm check:all runs pnpm e2e:ui after the node stage when the Chromium of the pinned Playwright is present, and prints a SKIPPED line with the install command otherwise. The shell suite needs the isolated stack and stays a separate run.
54 lines
2.6 KiB
Bash
Executable File
54 lines
2.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Every technical check a branch must pass before a merge, in one command: `pnpm check:all`.
|
|
# It runs on the development machine; no CI is configured on the forge today, and a future
|
|
# runner calls these same stages (docs/development/RUST.md §4). Stops at the first failure.
|
|
# Needs the native Rust toolchain (RUST.md §1) and Docker for the image stages. The local
|
|
# Supabase stack is not required: the SQL suite runs on PGlite inside `pnpm test:run`, and
|
|
# `pnpm db:test` is the real-stack complement after a change under supabase/. The browser
|
|
# suite runs when the Chromium of the pinned Playwright is installed, else it is reported
|
|
# SKIPPED with the reason (docs/development/BROWSER_TESTS.md); `pnpm e2e:shell` needs the
|
|
# isolated stack and stays a separate run.
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
stage() {
|
|
printf '\n== %s (%s)\n' "$1" "$(date +%H:%M:%S)"
|
|
}
|
|
|
|
stage "rust: fmt, clippy, tests, ts-rs export, cargo-deny (native toolchain)"
|
|
bash scripts/rust-check.sh
|
|
stage "rust: committed TypeScript types match the Rust contracts (no modified or new file)"
|
|
drift="$(git status --porcelain --untracked-files=all -- packages/core-wasm/types)"
|
|
if [ -n "$drift" ]; then
|
|
echo "packages/core-wasm/types differs from the committed types:" >&2
|
|
echo "$drift" >&2
|
|
exit 1
|
|
fi
|
|
stage "rust: RustSec advisories (warn-only until the CI/CD step; the release gate blocks)"
|
|
# Out of the blocking path on purpose (RUST_ARCHITECTURE_REVIEW VIII.3); printed here because
|
|
# no nightly job runs yet. Needs the network for the advisory database.
|
|
(cd . && . scripts/rust-env.sh && cargo deny check advisories) \
|
|
|| echo "== advisories: findings or no network above; review before a release"
|
|
stage "wasm: browser module (the core-wasm proofs run on it in the Node pipeline)"
|
|
bash scripts/wasm-build.sh
|
|
stage "node: typecheck, tests, lint, build"
|
|
pnpm check
|
|
stage "browser: Chromium UI suite (pnpm e2e:ui), desktop and 375 px, axe"
|
|
chromium="$(cd apps/app && node -e "console.log(require('@playwright/test').chromium.executablePath())")"
|
|
if [ -x "$chromium" ]; then
|
|
pnpm e2e:ui
|
|
else
|
|
echo "== SKIPPED: no Chromium for the pinned Playwright at $chromium"
|
|
echo " install it without sudo: pnpm --filter @faunosteo/app exec playwright install chromium"
|
|
fi
|
|
stage "docker: application image"
|
|
docker build -t faunosteo:check .
|
|
stage "docker: worker sandbox tests and seccomp derivation on the musl binary that ships"
|
|
pnpm worker:test
|
|
stage "docker: worker runtime image starts read-only"
|
|
pnpm worker:image
|
|
docker run --rm --read-only --cap-drop ALL --security-opt no-new-privileges:true \
|
|
faunosteo_worker:dev run --check
|
|
stage "all checks passed"
|