#!/usr/bin/env bash
set -euo pipefail
PROJECT_ROOT="$(cd "$(dirname "$0")" && pwd)"

cargo fmt --all -- --check
cargo test --workspace --all-targets --locked
cargo clippy --workspace --all-targets -- -D warnings
"$PROJECT_ROOT/backend/.venv/bin/pytest" "$PROJECT_ROOT/backend/tests" -q
npm test --prefix "$PROJECT_ROOT/dashboard" -- --run
npm run --prefix "$PROJECT_ROOT/dashboard" build
PYTHONPATH="$PROJECT_ROOT/tools:$PROJECT_ROOT/backend" "$PROJECT_ROOT/backend/.venv/bin/pytest" "$PROJECT_ROOT/tools"/test_*.py -q
