Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions scripts/ci-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
CI_YML="$REPO_ROOT/.github/workflows/ci.yml"

# ── Drift detection ──────────────────────────────────────────────────
# Extract every "uv run" command from CI, regardless of whether it appears
# on a single-line "- run:" step or inside a multi-line "run: |" block.
ci_commands=$(grep -oE 'uv run [^ ].*' "$CI_YML" | sort -u)

local_commands=$(sort -u <<'COMMANDS'
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run mypy src/
uv run pyright src/
uv run pytest -q
COMMANDS
)

if [[ "$ci_commands" != "$local_commands" ]]; then
echo "ERROR: CI / local pipeline drift detected!"
echo ""
echo "In CI but not in this script:"
comm -23 <(echo "$ci_commands") <(echo "$local_commands") | sed 's/^/ + /'
echo ""
echo "In this script but not in CI:"
comm -13 <(echo "$ci_commands") <(echo "$local_commands") | sed 's/^/ - /'
echo ""
echo "Update scripts/ci-local.sh to match .github/workflows/ci.yml"
exit 1
fi

echo "✓ Pipeline parity verified"
echo ""

# ── Checks (same order as CI) ───────────────────────────────────────
echo "=== lint ==="
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
echo ""

echo "=== typecheck ==="
uv run mypy src/
uv run pyright src/
echo ""

echo "=== test ==="
uv run pytest -q
echo ""

echo "All checks passed."