fix(ci): bind vite preview to 127.0.0.1, not localhost (CAR-1218)

The previous fix (probe 127.0.0.1) wasn't enough because 'vite preview'
binds to 'localhost', which resolves to ::1 (IPv6) on the Gitea Actions
runner. wait-on probed 127.0.0.1 but vite preview was listening on
::1, so the IPv4 probe still timed out.

Use 'npx vite preview --host 127.0.0.1 --port 4173' to force the
explicit IPv4 binding, matching the wait-on probe. Two-line diff total
with the lighthouserc.json change. The vite preview 'Local' message
will report 127.0.0.1:4173 (no 'Network' line because we're not bound
to 0.0.0.0).

Refs: CAR-1218
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Barcode Betty
2026-06-04 01:21:59 +00:00
parent 35ec73bf8f
commit 4e772d120a
+1 -1
View File
@@ -86,7 +86,7 @@ jobs:
npx playwright install --with-deps chromium npx playwright install --with-deps chromium
- name: Start preview server - name: Start preview server
run: | run: |
npm run preview & npx vite preview --host 127.0.0.1 --port 4173 &
npx wait-on http://127.0.0.1:4173/ --timeout 30000 npx wait-on http://127.0.0.1:4173/ --timeout 30000
- name: Run Lighthouse CI - name: Run Lighthouse CI
run: | run: |