ci: retrigger E2E (flaky HN network) #48
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: | |
| # ── Job 1: unit tests (fast path — no browser needed) ──────────────────────── | |
| unit: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Test (unit) | |
| run: pnpm test | |
| # ── Job 2: E2E smoke tests (requires Chromium) ─────────────────────────────── | |
| e2e: | |
| name: E2E Smoke Tests | |
| runs-on: ubuntu-latest | |
| needs: unit # only run E2E if unit tests pass | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # Cache the Chromium binary between runs. | |
| # Key includes the patchright version so it invalidates on upgrades. | |
| - name: Cache Patchright Chromium | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: patchright-chromium-${{ runner.os }}-${{ hashFiles('packages/core/package.json') }} | |
| restore-keys: patchright-chromium-${{ runner.os }}- | |
| - name: Install Patchright Chromium | |
| run: pnpm --filter @browserkit-dev/core exec patchright install chromium --with-deps | |
| - name: Build | |
| run: pnpm build | |
| # Checkout adapter-hackernews and link it into the workspace for E2E tests. | |
| - name: Checkout adapter-hackernews for E2E | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: browserkit-dev/adapter-hackernews | |
| path: packages/adapter-hackernews | |
| - name: Link adapter-hackernews into workspace | |
| run: | | |
| node -e " | |
| const fs = require('fs'); | |
| const pkg = JSON.parse(fs.readFileSync('packages/adapter-hackernews/package.json')); | |
| pkg.devDependencies['@browserkit-dev/core'] = 'workspace:*'; | |
| fs.writeFileSync('packages/adapter-hackernews/package.json', JSON.stringify(pkg, null, 2)); | |
| " | |
| pnpm install --no-frozen-lockfile | |
| pnpm --filter @browserkit-dev/adapter-hackernews build | |
| - name: Test (E2E smoke) | |
| run: pnpm test:e2e | |
| timeout-minutes: 5 |