Files
Danish Arora 68a74c041c dev(preflight): add fast local checks + opt-in pre-push hook (#156)
CI takes ~40 min end to end, so quick-to-catch issues (a stale-UI-text
typo, a broken unit test) only surface after a full cycle. `make
preflight` runs the fast local equivalents of the rust-checks CI job
(cargo check/test, forge test, the anvil-backed integration tests) plus
swap-ui-unit, every dependency-free node contract/unit test, and
qmllint — no nix build, no real Basecamp launch. ~30s warm, a few
minutes cold; fails on the first broken check and names it.

`make preflight-full` adds a working-tree build+stage via
basecamp-dev.sh --no-launch (the one CI job with no fast local form),
with a documented TODO for wiring the actual UI-text smoke assertions
against it.

`make install-hooks` is a one-time opt-in that symlinks
scripts/pre-push into the shared hooks dir to run `make preflight`
before every push.
2026-08-18 16:57:51 +05:30

19 lines
723 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# git pre-push hook — installed by `make install-hooks` (opt-in, never
# forced on). Runs the fast local checks (`make preflight`: cargo
# check/test, forge test, the node contract/unit tests, swap-ui-unit,
# qmllint — no nix build, no real Basecamp launch) before letting a push
# through, so the common CI failure classes surface in seconds-to-minutes
# instead of after a ~40 min CI run.
#
# Skip once: git push --no-verify
# Uninstall: rm "$(git rev-parse --git-path hooks)/pre-push"
repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)
cd "$repo_root"
echo "pre-push: running 'make preflight' (skip once with 'git push --no-verify')"
exec make preflight