2026-03-22 19:07:07 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
|
|
2026-04-03 16:12:52 +01:00
|
|
|
echo "=== Building frontend ==="
|
|
|
|
|
if [ -d "$PROJECT_ROOT/frontend" ]; then
|
|
|
|
|
cd "$PROJECT_ROOT/frontend"
|
|
|
|
|
npm install
|
|
|
|
|
npm run build
|
|
|
|
|
cd "$PROJECT_ROOT"
|
|
|
|
|
else
|
|
|
|
|
echo "Skipping frontend build (no frontend directory)"
|
|
|
|
|
fi
|
|
|
|
|
|
2026-04-10 11:16:51 +00:00
|
|
|
echo "=== Checking Rust formatting ==="
|
|
|
|
|
if cargo fmt --version &>/dev/null; then
|
2026-04-13 14:07:08 +00:00
|
|
|
cargo fmt --manifest-path "$PROJECT_ROOT/Cargo.toml" --all --check
|
2026-04-10 11:16:51 +00:00
|
|
|
else
|
|
|
|
|
echo "Skipping Rust formatting check (rustfmt not installed)"
|
|
|
|
|
fi
|
|
|
|
|
|
2026-03-28 18:15:29 +00:00
|
|
|
echo "=== Running cargo clippy ==="
|
2026-04-10 11:16:51 +00:00
|
|
|
cargo clippy --manifest-path "$PROJECT_ROOT/Cargo.toml" --all-targets --all-features -- -D warnings
|
2026-03-28 18:15:29 +00:00
|
|
|
|
2026-03-22 19:07:07 +00:00
|
|
|
echo "=== Running Rust tests ==="
|
2026-04-07 16:22:19 +00:00
|
|
|
cargo test --manifest-path "$PROJECT_ROOT/Cargo.toml" --bin huskies
|
2026-03-22 19:07:07 +00:00
|
|
|
|
|
|
|
|
echo "=== Running frontend unit tests ==="
|
|
|
|
|
if [ -d "$PROJECT_ROOT/frontend" ]; then
|
|
|
|
|
cd "$PROJECT_ROOT/frontend"
|
|
|
|
|
npm test
|
|
|
|
|
else
|
|
|
|
|
echo "Skipping frontend tests (no frontend directory)"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Disabled: e2e tests may be causing merge pipeline hangs (no running server
|
|
|
|
|
# in merge workspace → Playwright blocks indefinitely). Re-enable once confirmed.
|
|
|
|
|
# Disabled: e2e tests cause merge pipeline hangs (no running server
|
|
|
|
|
# in merge workspace → Playwright blocks indefinitely).
|
|
|
|
|
# echo "=== Running e2e tests ==="
|
|
|
|
|
# npm run test:e2e
|