Repository navigation
CI: Build once for the E2E tests and add swap space (wp/7.0) - #85782
Conversation
Backports the build-once part of #81031 (4028b8e) to this branch. Each of the eight Playwright shards ran its own `npm run build`. A single Build job now builds and uploads the output, and each shard downloads it. This branch's runners, timeouts and Playwright install are left unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Y86gzn3apHfS8kjjkmzTW
The build starts many processes at once. On runners with fewer resources, such as those used by private forks, the kernel can occasionally refuse to start another one, failing the build with `spawn ENOMEM`. A 4 GB swap file raises the amount of memory that can be committed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Y86gzn3apHfS8kjjkmzTW
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
andrewserong
left a comment
There was a problem hiding this comment.
LGTM! Only question for me is whether we still need the "Add swap space" step if we're building once, but the included comments indicate that some environments have fewer resources which seems a good justification to me 👍
What?
Backports the build-once part of #81031 to
wp/7.0. A single Build job runsnpm run build -- --skip-typesand uploads the result, and the E2E jobs download it instead of each building on their own. The Build job also adds a 4 GB swap file first.Why?
On this branch, each of the eight Playwright shards runs its own build. The build starts many processes at once (an esbuild build and a
sass-embeddedcompiler per package). This issue can be encountered on runs with fewer resources, such as those used within private forks: occasionally the kernel refuses to start one more process, and a shard fails in "Npm build" with[plugin sass-plugin] spawn ENOMEM.Trunk also limits how many builds wp-build runs at once (#79889). That change is in
packages/wp-build, the published@wordpress/buildpackage, so it isn't backported here. This PR only changes the workflow.How?
Two commits:
buildjob and thebuild-outputartifact, and makes the test jobs depend on it. The artifact paths are CI: build once and reuse the build across e2e tests shards #81031's: thebuild*directories, plus the generated icon library, worker code and block parser files, which are the same on this branch. A failed build makes the test jobs fail rather than skip, as in CI: build once and reuse the build across e2e tests shards #81031. This branch's runners, timeouts and Playwright install are left unchanged; the rest of CI: build once and reuse the build across e2e tests shards #81031 (vars.RUNNERS_NAME, shorter timeouts,setup-playwright) isn't included./mnt/swapfile-buildbefore the build. The hosted image already has 3 GB of swap. The extra file raises the memory the kernel lets processes commit (about 10.8 GB to 14.8 GB), which is the limit it checks when starting a process.Testing Instructions
build-output, all eight test jobs download it, and the tests run as before.🤖 Generated with Claude Code
https://claude.ai/code/session_011Y86gzn3apHfS8kjjkmzTW