Skip to content

Cut e2e Actions minutes with a shared build and path filters - #12

Merged
cursor[bot] merged 3 commits into
mainfrom
cursor/e2e-actions-minutes-9c89
Sep 16, 2026
Merged

cursor[bot] merged 3 commits into
mainfrom
cursor/e2e-actions-minutes-9c89

Conversation

@cookieofcode

@cookieofcode cookieofcode commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Playwright was compiling the Next app five times on every PR (four shards plus cloud), then ci.yml compiled it again. This PR keeps the same specs, the same four shards plus cloud, and the required check named Playwright, while cutting Actions minutes and concurrent compile spend.

Why

The product owner is hitting GitHub Actions limits. Most of the e2e bill was Next compile, not the tests, and docs/agent PRs still paid for a full matrix.

Changes

  1. Path filters inside the workflow (not on on.pull_request, so the required check never sits pending).

    • Skip the suite when every changed file is outside the running app: agents/**, markdown outside the runtime trees, LICENSE, .github/ISSUE_TEMPLATE/**, labeler/release-drafter, other .github files except this workflow, infra/**, docs/**.
    • Never skip: src/, prisma/, e2e/ (including markdown there), messages/ (next-intl copy the suite asserts on — every locale), package-lock.json, playwright.config.ts, next.config.*.
    • Cloud is not path-filtered on its own: if the suite runs, the cloud job runs. Shared auth/billing lives in src; a green self-hosted shard is not a cloud signal.
    • workflow_dispatch ignores path filters. Inputs: full (default) or cloud-only.
  2. One shared build job. npm ci + prisma generate + npm run build with NEXT_PUBLIC_APP_URL=http://127.0.0.1:3100, then upload production .next (cache and standalone stripped). Shards and the cloud job download the same artifact and do not rebuild. TORQVOICE_MODE stays a runtime env on next start.

    next.config.ts already has output: 'standalone', but the file tracer’s copy of pg/prisma is incomplete (see Dockerfile). Shards keep a lean npm ci and start with next start, which is what Playwright already uses.

  3. Chromium-only, cache-aware install. Cache hit skips the browser download and only runs install-deps. The Playwright container image was not used: a job container cannot reach the Postgres service on 127.0.0.1.

  4. Shards stay at 4 plus the cloud matrix entry. Dropping to 2 would save concurrent runners but add wall-clock (serial specs, workers=1). Only worth it if minutes are still over after this lands.

  5. Report job is still the single required check named Playwright. It is green when every shard and cloud pass, or when the suite was skipped as non-runtime. It fails if any shard or the cloud job fails. It no longer runs npm ci; it npxs the lockfile’s @playwright/test only to merge blobs.

Concurrency cancel-in-progress is unchanged. Security/auth/payment specs, one Postgres per shard, and fail-fast: false are unchanged. No terraform apply.

Estimated savings shape

Case Before After
Runtime PR (src, prisma, e2e, messages/, lockfile, …) 5× Next compile in parallel, then tests 1× compile, then 5 jobs start a prebuilt app. Minutes drop by about four compiles (often the largest slice of each 20–30 min job). Peak concurrent compilers go from 5 to 1.
Docs/agents/infra-only PR Full 5-job matrix + report Paths + Playwright (seconds). Five runners never start.
Report job checkout + npm ci + merge checkout + npx @playwright/test merge
Manual run always full matrix full or cloud-only

ci.yml still builds once per PR; that is out of scope here.

Test plan

  • This PR changes .github/workflows/e2e.yml, so the suite should run (not skip) and the required check named Playwright should still appear.
  • Confirm shards log unpack of .next / BUILD_ID and do not run npm run build.
  • Confirm cloud job still runs on the same artifact.
  • A follow-up docs-only PR should leave Playwright green without starting shards.
Open in Web Open in Cursor 

cursoragent and others added 3 commits September 15, 2026 14:02
Compile Next once and reuse the production output on every shard instead of
building five times. Skip the suite when a PR cannot affect the running app,
while still reporting the required Playwright check.

Co-authored-by: Severin Pereto <cookieofcode@gmail.com>
next-intl copy is runtime the suite asserts on, so a locale-only PR still
needs Playwright. agents/, markdown, and LICENSE remain skippable.

Co-authored-by: Severin Pereto <cookieofcode@gmail.com>
Quality: next-intl copy and the e2e tree are runtime. The skip list now
returns those prefixes before the markdown catch-all, so a locale or
e2e README change still runs the four shards plus cloud.

Co-authored-by: Severin Pereto <cookieofcode@gmail.com>
@cookieofcode
cookieofcode marked this pull request as ready for review September 16, 2026 07:00
@cursor
cursor Bot merged commit 98b211d into main Sep 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants