diff --git a/.gitea/workflows/ci-deploy.yml b/.gitea/workflows/ci-deploy.yml index 345f745..67f8fb2 100644 --- a/.gitea/workflows/ci-deploy.yml +++ b/.gitea/workflows/ci-deploy.yml @@ -274,14 +274,30 @@ jobs: # through the same unreliable transport and made a transient crash persistent. # Assertion/configuration failures remain terminal and always block deployment. run: | + smoke_log="$(mktemp)" set +e - npm run test:e2e - smoke_status=$? + npm run test:e2e 2>&1 | tee "$smoke_log" + smoke_status=${PIPESTATUS[0]} set -e if [ "$smoke_status" -eq 0 ]; then exit 0 fi + + # This self-hosted runner has occasionally mutated Axe's installed JavaScript after a + # checksum-valid npm download (`true` became `tre`, or a stray `break` appeared). + # Retry only that unmistakable source-corruption signature from a new isolated cache. + # Ordinary Axe violations and application assertions remain terminal. + if grep -q "AxeBuilder.analyze" "$smoke_log" \ + && grep -Eq "page\.evaluate: (ReferenceError|SyntaxError)" "$smoke_log"; then + echo "Axe runtime source appears corrupted — reinstalling the locked dependencies from a fresh cache and retrying the complete suite once..." + rm -rf node_modules + npm_cache="$(mktemp -d)" + npm ci --no-audit --no-fund --cache "$npm_cache" + npm run test:e2e + exit $? + fi + if [ "$smoke_status" -ne 139 ]; then exit "$smoke_status" fi