fix(ci): recover corrupted axe runtime
CI and Deploy / test (push) Successful in 6m55s
CI and Deploy / deploy (push) Successful in 58s

This commit is contained in:
cesnimda
2026-09-01 16:55:26 +02:00
parent 3b055b01f5
commit d9ec37d717
+18 -2
View File
@@ -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 `tr<garbage>e`, 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