Skip to content

ci: retry Playwright browser install to survive cdn.playwright.dev st… #56

ci: retry Playwright browser install to survive cdn.playwright.dev st…

ci: retry Playwright browser install to survive cdn.playwright.dev st… #56

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- name: Verify OpenAPI spec is in sync with live API
run: |
bun run generate
git diff --exit-code -- specs/openapi.json packages/ui/src/types/ \
|| { echo "::error::OpenAPI spec or generated types are stale. Run 'bun run generate' locally and commit."; exit 1; }
- run: bun run check
- name: Brand-rule grep
run: bun run scripts/brand-grep.ts
- run: bun run typecheck
- run: bun run build
- run: bun run test
- name: Install Playwright browsers
# cdn.playwright.dev browser-binary downloads occasionally stall with no
# built-in timeout, hanging the job. Cap each attempt and retry.
run: |
for i in 1 2 3; do
timeout 480 bunx playwright install --with-deps chromium && exit 0
echo "::warning::Playwright install attempt $i stalled or failed; retrying"
sleep 10
done
echo "::error::Playwright browser download failed after 3 attempts"; exit 1
- run: bun run test:e2e
env:
PLAYWRIGHT_PROJECTS: chromium
- name: UI audit (no [object Object], no empty-state drift)
run: |
bun run preview &
PREVIEW_PID=$!
for i in $(seq 1 30); do
curl -sf http://localhost:3001 > /dev/null && break
sleep 1
done
bun run audit
AUDIT_EXIT=$?
kill $PREVIEW_PID 2>/dev/null || true
exit $AUDIT_EXIT