Cut e2e Actions minutes with a shared build and path filters - #12
Merged
Merged
Conversation
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Playwright was compiling the Next app five times on every PR (four shards plus cloud), then
ci.ymlcompiled 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
Path filters inside the workflow (not on
on.pull_request, so the required check never sits pending).agents/**, markdown outside the runtime trees,LICENSE,.github/ISSUE_TEMPLATE/**, labeler/release-drafter, other.githubfiles except this workflow,infra/**,docs/**.src/,prisma/,e2e/(including markdown there),messages/(next-intl copy the suite asserts on — every locale),package-lock.json,playwright.config.ts,next.config.*.src; a green self-hosted shard is not a cloud signal.workflow_dispatchignores path filters. Inputs:full(default) orcloud-only.One shared build job.
npm ci+prisma generate+npm run buildwithNEXT_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_MODEstays a runtime env onnext start.next.config.tsalready hasoutput: 'standalone', but the file tracer’s copy of pg/prisma is incomplete (seeDockerfile). Shards keep a leannpm ciand start withnext start, which is what Playwright already uses.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 on127.0.0.1.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.
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 runsnpm ci; itnpxs the lockfile’s@playwright/testonly to merge blobs.Concurrency
cancel-in-progressis unchanged. Security/auth/payment specs, one Postgres per shard, andfail-fast: falseare unchanged. No terraform apply.Estimated savings shape
src,prisma,e2e,messages/, lockfile, …)npm ci+ mergenpx @playwright/testmergefullorcloud-onlyci.ymlstill builds once per PR; that is out of scope here.Test plan
.github/workflows/e2e.yml, so the suite should run (not skip) and the required check namedPlaywrightshould still appear..next/BUILD_IDand do not runnpm run build.