test(e2e): add a Playwright interaction suite + wire into CI #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ".nvmrc" | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 11.2.2 | |
| run_install: false | |
| cache: true | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint (type-check + svelte-check + eslint) | |
| run: pnpm lint | |
| - name: Format check | |
| run: pnpm format:check | |
| # Build before tests so the offline-assets PWA budget test sees dist/ | |
| # (it self-skips when dist/ is absent — see tests/unit/offline-assets.test.ts). | |
| - name: Production build | |
| run: pnpm build | |
| - name: Unit tests | |
| run: pnpm test | |
| # E2E runs against the production build from the step above (vite preview). | |
| - name: Resolve Playwright version | |
| id: pwv | |
| run: echo "v=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT" | |
| - name: Cache Playwright browser | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ steps.pwv.outputs.v }} | |
| - name: Install Playwright chromium | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: E2E tests (Playwright) | |
| run: pnpm exec playwright test |