fix: improve preview server startup detection in lighthouse CI [CAR-937]
CI / lint (pull_request) Successful in 13s
CI / test (pull_request) Successful in 14s
CI / audit (pull_request) Successful in 10s
CI / e2e (pull_request) Successful in 39s
CI / build-and-push (pull_request) Has been skipped
CI / deploy-dev (pull_request) Has been skipped
CI / deploy-uat (pull_request) Has been skipped
CI / lighthouse (pull_request) Failing after 42s

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Savannah Savings
2026-05-21 20:46:37 +00:00
parent 75700fbb5e
commit a9a7db63b8
+10 -2
View File
@@ -88,8 +88,16 @@ jobs:
- name: Start preview server - name: Start preview server
run: | run: |
npm run preview -- --port 4173 & npm run preview -- --port 4173 &
sleep 10 for i in $(seq 1 30); do
npx wait-on http://localhost:4173/ --timeout 60000 if curl -s http://localhost:4173/ > /dev/null 2>&1; then
echo "Server ready on http://localhost:4173/"
exit 0
fi
echo "Waiting for server... ($i/30)"
sleep 2
done
echo "Server failed to start"
exit 1
- name: Run Lighthouse CI - name: Run Lighthouse CI
run: | run: |
CHROME_PATH=$(find /home/runner/.cache/ms-playwright -name chrome -type f 2>/dev/null | head -1) CHROME_PATH=$(find /home/runner/.cache/ms-playwright -name chrome -type f 2>/dev/null | head -1)