From a9a7db63b83e00f091aaf06559b400414c7806ff Mon Sep 17 00:00:00 2001 From: Savannah Savings Date: Thu, 21 May 2026 20:46:37 +0000 Subject: [PATCH] fix: improve preview server startup detection in lighthouse CI [CAR-937] Co-Authored-By: Paperclip --- .gitea/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 3d359f7..b77c628 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -88,8 +88,16 @@ jobs: - name: Start preview server run: | npm run preview -- --port 4173 & - sleep 10 - npx wait-on http://localhost:4173/ --timeout 60000 + for i in $(seq 1 30); do + 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 run: | CHROME_PATH=$(find /home/runner/.cache/ms-playwright -name chrome -type f 2>/dev/null | head -1)