ci: run only changed e2e tests on PRs - #292
Merged
Merged
Conversation
PRs trigger a new e2e-changed job that resolves changed *.e2e.ts files against the PR base SHA and passes them as positional args to Playwright. If no e2e files changed, every step short-circuits, leaving a passing check entry for branch-protection compatibility. The existing sharded full-suite job is gated to push-to-main and manual dispatch only, so we keep the safety net post-merge.
h4yfans
added a commit
that referenced
this pull request
May 6, 2026
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
Splits the e2e workflow into two jobs based on event type:
e2e-changed(PRs only) — resolves changed*.e2e.tsfiles against${{ github.event.pull_request.base.sha }}(handles rebases and stacked PRs correctly), passes them as positional args to Playwright, and short-circuits every step when no e2e files changed. The job still appears in the Checks UI as ✅ for branch-protection compatibility.e2e(push tomain+workflow_dispatch) — unchanged, full sharded suite [1/3, 2/3, 3/3]. Still the safety net post-merge.The trigger now also includes
pull_request, which the existing workflow lacked entirely.Why this is safer than it sounds
Changed-only catches bugs in the new test itself but misses regressions where a source change breaks an unchanged e2e test. The full suite still runs on every push to
main, so any regression that slips through PR review surfaces immediately post-merge instead of accumulating.The PR check name changes:
Playwright Electron E2E (1/3)/(2/3)/(3/3)— these never appeared on PRs anyway since the workflow had nopull_requesttrigger.Playwright E2E (changed only)on PRs.If branch protection on
mainrequires the old shard-named checks as PR gates, those rules need to be updated to requirePlaywright E2E (changed only)instead, or the rule will block all future PRs. Check repo Settings → Branches → main → Required status checks.Implementation notes
fetch-depth: 0on checkout — the default shallow clone doesn't have the PR base commit, sogit diff $BASE_SHA...HEADwould silently return empty and skip every PR.--diff-filter=AMRcovers Added + Modified + Renamed; deleted tests are correctly excluded.note-sync-helpers.e2e.tsandshared-sync-bootstrap.e2e.tsmatch the glob — editing them will trigger a run on a non-spec file. Pre-existing naming quirk; rename to*.helper.tslater if it becomes noisy.E2E_FILES) into the innerdbus-run-session bash -c '...'instead of GitHub Actions string interpolation — safer against any odd characters in filenames.Test plan
e2e-changedjob runs, resolves zero files, and finishes in ~30s greene2e-changedruns only that file🤖 Generated with Claude Code