ci(windows): drop a marker file each run and assert it's gone next run
All checks were successful
CI Test / hello (push) Successful in 1s
CI Test / windows-test (push) Successful in 8s
CI Test / revert-vm (push) Successful in 7s

If two runs in a row both pass, the revert flow is provably wiping state
between runs. If the second one fails on 'Verify clean baseline', the
revert isn't doing its job.
This commit is contained in:
ci-bot 2026-05-01 14:42:56 -04:00
parent c1bd0ec9f9
commit db0f36e029

View file

@ -1,7 +1,7 @@
name: CI Test name: CI Test
on: on:
push: push:
branches: [main, windows-ci] branches: [main]
workflow_dispatch: workflow_dispatch:
env: env:
@ -59,15 +59,26 @@ jobs:
-p "$WIN_PORT" "$WIN_USER@$WIN_HOST" \ -p "$WIN_PORT" "$WIN_USER@$WIN_HOST" \
"whoami && ver && echo windows-smoke-ok" "whoami && ver && echo windows-smoke-ok"
# The actual test step — runs the test inside the Windows VM. # Verifies the revert actually wiped the previous run's marker.
# Customise the command to fit the project once Windows test tooling is in place. # Fails fast if it finds C:\ci-marker.txt, which would only be there if
- name: Run Windows test # a previous CI run left it behind and the revert step didn't restore gold.
- name: Verify clean baseline (no marker from prior run)
env:
SSHPASS: ${{ secrets.WINDOWS_SSH_PASSWORD }}
run: |
out=$(sshpass -e ssh -o StrictHostKeyChecking=no \
-p "$WIN_PORT" "$WIN_USER@$WIN_HOST" \
"if exist C:\\ci-marker.txt (echo MARKER_EXISTS & type C:\\ci-marker.txt) else (echo CLEAN)")
echo "$out"
echo "$out" | grep -q "^CLEAN" || { echo "marker from previous run survived — revert is broken"; exit 1; }
- name: Drop marker file (would persist without revert)
env: env:
SSHPASS: ${{ secrets.WINDOWS_SSH_PASSWORD }} SSHPASS: ${{ secrets.WINDOWS_SSH_PASSWORD }}
run: | run: |
sshpass -e ssh -o StrictHostKeyChecking=no \ sshpass -e ssh -o StrictHostKeyChecking=no \
-p "$WIN_PORT" "$WIN_USER@$WIN_HOST" \ -p "$WIN_PORT" "$WIN_USER@$WIN_HOST" \
"echo TODO: run actual test command here" "echo run=${GITHUB_RUN_NUMBER} sha=${GITHUB_SHA} > C:\\ci-marker.txt && type C:\\ci-marker.txt"
# Always-runs cleanup: rolls the VM back to the gold snapshot on the host. # 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. # In a separate job so it fires even when windows-test crashes mid-step.