Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/e2e-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ runs:
shell: bash
run: npx nx run-many -t ci:build

# Cache the Chromium binary (~120MB) keyed on the resolved Playwright
# version, so it isn't re-downloaded every shard/run. Browser versions are
# pinned to the Playwright package version, so the version is the correct
# cache key. On a hit, `playwright install` finds the browser present and
# only installs OS deps.
- name: Resolve Playwright version
id: playwright-version
shell: bash
run:
echo "version=$(cd packages/app && node -p
"require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"

- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key:
${{ runner.os }}-playwright-${{
steps.playwright-version.outputs.version }}

- name: Install Playwright browsers
shell: bash
run: cd packages/app && npx playwright install --with-deps chromium
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on:
jobs:
e2e-tests:
name: E2E Tests - Shard ${{ matrix.shard }}
runs-on: ubuntu-24.04
# 8-core runner so the 4 Playwright workers (see playwright.config.ts) have
# CPU headroom alongside the app + ClickHouse + MongoDB — 4 workers
# over-subscribed the 4-vCPU ubuntu-24.04 runner and caused timeouts.
runs-on: 8-core-playwright
timeout-minutes: 15
permissions:
contents: read
Expand Down
12 changes: 10 additions & 2 deletions packages/app/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,16 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 1,
/* Use multiple workers on CI for faster execution */
workers: process.env.CI ? 2 : undefined,
/* Use multiple workers on CI for faster execution. CI e2e shards run on
* 8-core runners (see .github/workflows/e2e-tests.yml), so 4 workers leave
* headroom for the app + ClickHouse + Mongo. Override with E2E_WORKERS
* (a positive integer); anything else falls back to the default. */
workers: (() => {
const raw = process.env.E2E_WORKERS;
const parsed = raw ? Number(raw) : NaN;
if (Number.isInteger(parsed) && parsed >= 1) return parsed;
return process.env.CI ? 4 : undefined;
})(),
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['html'],
Expand Down
Loading