ci(windows): add always-runs revert job that rolls the VM back to gold
All checks were successful
CI Test / hello (push) Successful in 1s
CI Test / windows-test (push) Successful in 7s
CI Test / revert-vm (push) Successful in 8s

Calls the host's testing-revert HTTP endpoint after windows-test (whether
it passed or failed), so every CI run starts from the gold snapshot.
This commit is contained in:
ci-bot 2026-05-01 14:37:49 -04:00
parent 71b7db4985
commit c1bd0ec9f9

View file

@ -68,3 +68,25 @@ jobs:
sshpass -e ssh -o StrictHostKeyChecking=no \
-p "$WIN_PORT" "$WIN_USER@$WIN_HOST" \
"echo TODO: run actual test command here"
# Always-runs cleanup: rolls the VM back to the gold snapshot on the host.
# In a separate job so it fires even when windows-test crashes mid-step.
revert-vm:
runs-on: docker
needs: [windows-test]
if: always()
steps:
- name: Install client tools
run: |
apt-get update -qq
apt-get install -y -qq curl iproute2
- name: Trigger revert on host
env:
REVERT_TOKEN: ${{ secrets.REVERT_TOKEN }}
run: |
GW=$(ip route | awk '/default/ {print $3; exit}')
echo "calling revert endpoint at $GW:8765"
curl -fsSL --max-time 90 -X POST \
-H "Authorization: Bearer $REVERT_TOKEN" \
"http://$GW:8765/revert"