The agent that turns websites into APIs!
ci: cache browser engines and retain failure diagnostics
kalil03218fb2595c53b8
diff --git a/.github/workflows/website.yml b/.github/workflows/website.ymlindex ea9b96c..3c727c7 100644--- a/.github/workflows/website.yml+++ b/.github/workflows/website.yml@@ -22,7 +22,7 @@ jobs:name: Build and deployif: github.ref_type == 'branch'runs-on: ubuntu-latest- timeout-minutes: 20+ timeout-minutes: 30permissions:contents: readdeployments: write@@ -62,6 +62,12 @@ jobs:with:python-version: '3.13'+ - name: Cache Playwright browsers+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4+ with:+ path: ~/.cache/ms-playwright+ key: ${{ runner.os }}-${{ runner.arch }}-playwright-1.58.0+- name: Install browser test dependenciesrun: |python -m pip install 'playwright==1.58.0'@@ -93,6 +99,17 @@ jobs:cat /tmp/rae-website-server.logfi+ - name: Upload browser diagnostics on failure+ if: failure()+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4+ with:+ name: browser-diagnostics-${{ github.run_id }}-${{ github.run_attempt }}+ path: |+ /tmp/rae-website-server.log+ /tmp/rae-header-*.png+ if-no-files-found: ignore+ retention-days: 7+- name: Deploy to Cloudflare Pagesid: deployuses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0diff --git a/website/tests/scroll_e2e.py b/website/tests/scroll_e2e.pyindex 05a1db8..d002147 100644--- a/website/tests/scroll_e2e.py+++ b/website/tests/scroll_e2e.py@@ -5,11 +5,24 @@ Install browsers first: uv run --extra manual playwright install chromium firefo"""import jsonimport sys-from contextlib import closing+from contextlib import closing, contextmanagerfrom pathlib import Pathfrom playwright.sync_api import sync_playwright+@contextmanager+def capture_failure(context, engine, width):+ try:+ yield+ except Exception:+ if context.pages:+ try:+ context.pages[-1].screenshot(path=f'/tmp/rae-header-{engine}-{width}-failure.png')+ except Exception as error:+ print(f'Could not capture failure screenshot: {error}', file=sys.stderr)+ raise++base_url, export_dir = sys.argv[1:]docs_dir = Path(export_dir, 'docs')assert docs_dir.is_dir(), f'Missing docs export: {docs_dir}'@@ -21,7 +34,7 @@ with sync_playwright() as playwright:for engine in ['chromium', 'firefox', 'webkit']:with closing(getattr(playwright, engine).launch()) as browser:for width, height in [(1280, 800), (390, 844)]:- with closing(browser.new_context(viewport={'width': width, 'height': height})) as context:+ with closing(browser.new_context(viewport={'width': width, 'height': height})) as context, capture_failure(context, engine, width):page = context.new_page()errors = []page.on('pageerror', lambda error: errors.append(str(error)))