Skip to content

Commit d4480b7

Browse files
authored
ci: run the Linux package E2E on pull requests only for packaging inputs (lidge-jun#6264)
1 parent 11782ee commit d4480b7

3 files changed

Lines changed: 39 additions & 10 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,20 @@ jobs:
270270
- '.github/workflows/ci.yml'
271271
gui:
272272
- 'gui/**'
273-
# Building both Linux package formats and booting their real payloads is
274-
# substantially heavier than the Rust-only desktop-shell check. Keep it
275-
# scoped to inputs that can change the packaged shell, dashboard or
276-
# standalone sidecar. The workflow names itself so edits to this lane
277-
# cannot skip their own E2E.
273+
# Building both Linux package formats and booting their real payloads takes
274+
# about 15 minutes, far more than the Rust-only desktop-shell check. On a
275+
# pull request it runs only for inputs that change how the package is
276+
# assembled or launched: the shell itself, the standalone sidecar build
277+
# and its runtime locator, the native keyring staging, and the dependency
278+
# set. Ordinary src/** and gui/** changes no longer select it on a pull
279+
# request; they are still covered on every promotion push to main and
280+
# preview and by workflow_dispatch, which always request this job.
281+
# The workflow names itself so edits to this lane cannot skip their own E2E.
278282
desktop:
279283
- 'desktop/**'
280-
- 'gui/**'
281-
- 'src/**'
284+
- 'src/lib/standalone.ts'
285+
- 'src/lib/keyring-native.ts'
286+
- 'src/lib/bun-runtime.ts'
282287
- 'scripts/build-standalone.ts'
283288
- 'scripts/standalone-keyring.ts'
284289
- 'scripts/standalone-targets.ts'

‎structure/desktop-shell.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,14 @@ the runtime to be gone; destroying the X window or a crash does not count as a d
417417
report records readiness time and whole app-process-tree RSS as evidence; those observations are not
418418
pass/fail budgets until a reviewed cross-platform baseline exists.
419419

420+
The lane takes about 15 minutes, so a pull request selects it only through the `changes` job's
421+
`desktop` filter: `desktop/**`, the standalone build and its runtime locator
422+
(`scripts/build-standalone.ts`, `scripts/standalone-targets.ts`, `src/lib/standalone.ts`,
423+
`src/lib/bun-runtime.ts`), native keyring staging (`scripts/standalone-keyring.ts`,
424+
`src/lib/keyring-native.ts`), `package.json`, `bun.lock` and `ci.yml` itself. Ordinary `src/**` and
425+
`gui/**` edits do not run it on a pull request; promotion pushes to `main` and `preview` and
426+
`workflow_dispatch` always do, so a packaging regression from such an edit surfaces at promotion.
427+
420428
Extraction is intentional. A GitHub-hosted runner is disposable but its package database is still a
421429
shared job resource, and a normal pull request does not need passwordless package installation or GUI
422430
elevation to prove that the packaged executable and resources boot together. The separate

‎tests/ci-workflows/linux-desktop-packaged-ci.test.ts‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,25 @@ describe("Linux packaged desktop E2E in CI", () => {
2727
const filter = changes?.steps?.find(step => step.name === "Detect changed areas");
2828
const filters = String(filter?.with?.filters ?? "");
2929
expect(filters).toContain("desktop:");
30-
expect(filters).toContain("'desktop/**'");
31-
expect(filters).toContain("'src/**'");
32-
expect(filters).toContain("'.github/workflows/ci.yml'");
30+
// The package E2E filter: only packaging inputs select it on a pull request. Ordinary
31+
// src/** and gui/** edits are left to promotion pushes and workflow_dispatch.
32+
const desktopFilter = filters.split(/\n(?=\s{0,2}\S[^\n]*:\s*$)/m)
33+
.find(block => /^\s*desktop:\s*$/m.test(block.split("\n")[0] ?? "")) ?? "";
34+
const desktopPaths = [...desktopFilter.matchAll(/- '([^']+)'/g)].map(match => match[1]);
35+
expect(desktopPaths).toEqual([
36+
"desktop/**",
37+
"src/lib/standalone.ts",
38+
"src/lib/keyring-native.ts",
39+
"src/lib/bun-runtime.ts",
40+
"scripts/build-standalone.ts",
41+
"scripts/standalone-keyring.ts",
42+
"scripts/standalone-targets.ts",
43+
"package.json",
44+
"bun.lock",
45+
".github/workflows/ci.yml",
46+
]);
47+
expect(desktopPaths).not.toContain("src/**");
48+
expect(desktopPaths).not.toContain("gui/**");
3349

3450
const shell = workflow.jobs?.["desktop-shell"];
3551
expect(shell?.if).toContain("needs.changes.outputs.desktop == 'true'");

0 commit comments

Comments
 (0)