diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 86c1d77..e554586 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -140,19 +140,27 @@ jobs: name: UI (screenshots) runs-on: ubuntu-latest timeout-minutes: 20 - # Chromium and its system libraries; the version must match the playwright pip pin. - container: mcr.microsoft.com/playwright/python:v1.49.1-noble@sha256:42e251ec3238672c931be6c3565ff279690ae072c3e22058128d0412494f6866 + # Node (for the checkout action), Chromium and its system libraries. The browser build must + # match the playwright pip pin below; Python is added in the first step. + container: mcr.microsoft.com/playwright:v1.49.1-noble@sha256:70e367e0cbf60340a5b5fd562f6247a34eb3196efab9f88a3dd56482d9fe09d2 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: persist-credentials: false - - name: Python dependencies - run: python3 -m pip install --quiet --break-system-packages -r requirements.txt playwright==1.49.1 + - name: Python and dependencies + run: | + apt-get update -qq + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends python3 python3-venv >/dev/null + python3 -m venv /tmp/venv + /tmp/venv/bin/pip install --quiet --disable-pip-version-check -r requirements.txt playwright==1.49.1 - name: Every page renders with replay data (desktop and mobile, dark and light) run: | - python3 scripts/ui_demo.py 8811 > /tmp/ui-demo.log 2>&1 & - for _ in $(seq 1 60); do curl -fs -o /dev/null http://127.0.0.1:8811/ && break; sleep 1; done - python3 scripts/screenshots.py http://127.0.0.1:8811 ui-screenshots + /tmp/venv/bin/python scripts/ui_demo.py 8811 > /tmp/ui-demo.log 2>&1 & + for _ in $(seq 1 60); do + /tmp/venv/bin/python -c 'import urllib.request; urllib.request.urlopen("http://127.0.0.1:8811/", timeout=2)' 2>/dev/null && break + sleep 1 + done + /tmp/venv/bin/python scripts/screenshots.py http://127.0.0.1:8811 ui-screenshots - name: Demo server log if: always() run: tail -n 100 /tmp/ui-demo.log || true