#!/bin/bash # Watchdog script: checks if the latest commit on the active branch is new, # runs the full test suite if so. # Designed to run every 15 minutes via Hermes cron. # Prints output only when tests are run (silent otherwise). cd /mnt/hermes/projects/cl-tty || exit 1 STATE_FILE="/tmp/.cl-tty-ci-last-commit" BRANCH="feature/v0.11.0-slots" # Fetch latest git fetch origin "$BRANCH" 2>/dev/null || exit 0 LATEST=$(git rev-parse "origin/$BRANCH" 2>/dev/null) || exit 0 # Check against last seen if [ -f "$STATE_FILE" ]; then LAST_SEEN=$(cat "$STATE_FILE") [ "$LATEST" = "$LAST_SEEN" ] && exit 0 # No new commits, silent exit fi # New commit found! Save it and run tests echo "$LATEST" > "$STATE_FILE" COMMIT_MSG=$(git log --oneline "origin/$BRANCH" -1 2>/dev/null) echo "New commit on $BRANCH: $COMMIT_MSG" echo "" echo "=== Running Tier 1: Unit Tests ===" sbcl --noinform --eval '(load "~/quicklisp/setup.lisp")' \ --eval '(push (truename ".") asdf:*central-registry*)' \ --eval '(asdf:test-system :cl-tty)' --eval '(uiop:quit 0)' \ 2>&1 | grep -E "Fail:|Pass:|Did|Running test" echo "" echo "=== Running Tier 2: API Verification ===" python3 scripts/verify-api.py 2>&1 | tail -3 echo "" echo "=== Running Tier 3: PTY Demo Test ===" python3 scripts/verify-demo-pty.py 2>&1 | tail -3 echo "" echo "Done."