Skip to content

feat(structure-viewer): add TED, restyle the resource row, and gate the docs-screenshot scripts #478

feat(structure-viewer): add TED, restyle the resource row, and gate the docs-screenshot scripts

feat(structure-viewer): add TED, restyle the resource row, and gate the docs-screenshot scripts #478

Workflow file for this run

name: E2E Tests (Playwright)
on:
schedule:
- cron: '0 3 * * *'
pull_request:
# Keep `synchronize`: the state that gets merged is the one worth testing.
types: [opened, reopened, synchronize]
# Err broad: a wrong filter does not fail the job, it silently never runs, which reads
# like a pass (see bundle-contract.yml). Hence `packages/**` and the root files the app
# resolves through, not just the two packages it imports today.
# Do not add a label gate alongside this: `paths:` suppresses the webhook, so a label on
# a PR outside these paths can never start a run. Use `workflow_dispatch` instead.
paths:
- 'apps/web/**'
- 'packages/**'
- 'pnpm-lock.yaml'
- 'package.json'
- 'turbo.json'
- 'pnpm-workspace.yaml'
- '.github/workflows/e2e.yml'
workflow_dispatch:
concurrency:
group: e2e-${{ github.ref }}
# Cancel superseded PR runs; let the nightly and manual dispatches finish.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
e2e-tests:
name: E2E Tests (Playwright)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Resolve Playwright version
id: pw
run: echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"
# Keyed on the browser build, not the lockfile: a lockfile hash would rewrite ~456MB
# on every dependency bump. No restore-keys for the same reason — a prefix match
# restores superseded browser dirs that then get re-saved.
- name: Cache Playwright browsers
id: pw-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.pw.outputs.version }}
# Unconditional on purpose. `--with-deps` always installs the apt packages (which live
# outside the cached directory), and skips the download of any browser whose
# INSTALLATION_COMPLETE marker the cache restored. One step covers hit and miss.
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps chromium firefox webkit
# Only the packages the dev server resolves through node_modules. The tests are served
# by `pnpm dev:app` (a Vite dev server, see webServer in playwright.config.ts), so
# `@protspace/app#build` produced an 89MB bundle nothing here reads.
- name: Build workspace packages
run: pnpm build --filter=@protspace/core --filter=@protspace/utils
- name: Run Playwright tests
run: pnpm test:e2e
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
apps/web/playwright-report
apps/web/test-results
retention-days: 14
if-no-files-found: ignore