#!/bin/sh # Test one commit in a throwaway worktree, with the checkout's Linux .venv. # 1-test-and-promote.ps1 runs this through wsl.exe when the checkout lives # inside WSL, where the .venv has no Windows python.exe to call. The gates are # the same as in that script; keep the two lists in step. # Usage: sh deploy/test-commit.sh (from the checkout root) set -eu root=$(pwd) python="$root/.venv/bin/python" [ -x "$python" ] || { echo "no interpreter at $python - run uv sync" >&2; exit 1; } base=$(mktemp -d /tmp/test-commit-XXXXXXXX) tree="$base/tree" trap 'git -C "$root" worktree remove --force "$tree" 2>/dev/null; rm -rf "$base"' EXIT git worktree add --detach "$tree" "$1" >/dev/null cd "$tree" "$python" -m pytest -q # "$python" -m ruff check . # "$python" -m mypy --cache-dir "$root/.mypy_cache"