#!/usr/bin/env bash # SPDX-License-Identifier: MIT # The single gate (family charter: scripts/ladder.sh in the Rust tiers): every rung in order, # stopping at the first that fails. # # scripts/ladder.sh fmt, clippy, cargo test, rungs 1-3 (about a minute); the gate # on every kept commit # FAULTS=1 scripts/ladder.sh and rung 4, the seeded faults (about 15 minutes) # # Rungs 1-4 need the reference (scripts/env.sh: POKEY_PYTHON, its venv, ACIDSAP_DIR). # fmt and clippy are CI's, and run here too from the rustup stable toolchain when present # (the distribution's cargo may be older than CI's). set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) STABLE=${STABLE:-"$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin"} if [ -x "$STABLE/cargo-clippy" ]; then export PATH="$STABLE:$PATH" cargo fmt --check --manifest-path "$ROOT/Cargo.toml" nice -n 19 cargo clippy -q --release --all-targets --features serde --manifest-path "$ROOT/Cargo.toml" -- -D warnings echo "fmt and clippy: clean" else echo "fmt and clippy: skipped (no rustup stable toolchain at $STABLE)" fi nice -n 19 cargo test --release -q --features serde --manifest-path "$ROOT/Cargo.toml" > /dev/null 2>&1 \ || { echo "cargo test: FAILED"; exit 1; } echo "cargo test: passed" for rung in 1 2 3; do echo "== rung $rung" "$ROOT/scripts/rung$rung.sh" | tail -4 done if [ "${FAULTS:-0}" = 1 ]; then echo "== rung 4" "$ROOT/scripts/rung4.sh" | tail -6 fi echo "ladder: passed"