#!/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 rungs 1-5 (about 2 minutes); the gate on every kept commit # FAULTS=1 scripts/ladder.sh and rung 6, the seeded faults (about 30 minutes) # # Rungs 1, 2, 3 and 4 need the reference and its data (scripts/env.sh); rung 5 # needs nothing outside the repository. fmt and clippy are CI's, and run here # too when the rustup stable toolchain is present. 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 PATH="$STABLE:$PATH" cargo fmt --check --manifest-path "$ROOT/Cargo.toml" PATH="$STABLE:$PATH" nice -n 19 cargo clippy -q --release --all-targets --manifest-path "$ROOT/Cargo.toml" -- -D warnings echo "fmt and clippy: clean" fi nice -n 19 cargo test --release -q --manifest-path "$ROOT/Cargo.toml" > /dev/null echo "cargo test: passed" for rung in 1 2 3 4 5; do echo "== rung $rung" "$ROOT/scripts/rung$rung.sh" 2>/dev/null | grep -v "traces are identical" | tail -4 done if [ "${FAULTS:-0}" = 1 ]; then echo "== rung 6" "$ROOT/scripts/rung6.sh" | tail -6 fi echo "ladder: passed"