ci: speed up Playwright workflow with shared build job#3729
Conversation
Build the plugin once and reuse the artifact across matrix jobs. Add npm caching and use npx @wordpress/env instead of a global install. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Playwright workflow builds the plugin in a separate job, transfers the built workspace as an artifact, and restores it for testing. WordPress environment setup uses ChangesPlaywright CI workflow
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Pull request artifacts
|
|
Size Change: -5 B (0%) Total Size: 2.63 MB 📦 View Changed
ℹ️ View Unchanged
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/playwright.yml (1)
17-20: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winSkip Playwright browser downloads during dependency installation.
By default, installing dependencies with
npm citriggers the download of all Playwright browsers, consuming significant time and bandwidth. Since tests are not executed in thebuildjob, and thetestjob explicitly installs the required Chromium browser in a later dedicated step, you can safely skip the default browser downloads in both places to speed up the workflow.
.github/workflows/playwright.yml#L17-L20: addenv: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1to the build job'snpm cistep..github/workflows/playwright.yml#L61-L62: addenv: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1to the test job'snpm cistep.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/playwright.yml around lines 17 - 20, Skip Playwright browser downloads during dependency installation by setting PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD to 1 on the npm ci steps at .github/workflows/playwright.yml lines 17-20 and 61-62; keep the test job’s later explicit Chromium installation unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/playwright.yml:
- Around line 17-20: Skip Playwright browser downloads during dependency
installation by setting PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD to 1 on the npm ci
steps at .github/workflows/playwright.yml lines 17-20 and 61-62; keep the test
job’s later explicit Chromium installation unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: da9bf57d-181b-44b5-9ae6-3b59dbdb28c9
📒 Files selected for processing (1)
.github/workflows/playwright.yml
Avoid tar failing with "file changed as we read it" when the archive is created inside the directory being packed. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
buildjob that compiles the plugin once and uploads a tarball artifacttestjobs download the artifact instead of rebuilding on every WP/PHP combinationsetup-nodefor fasternpm cion build and test jobswp-envinstall withnpx @wordpress/envTest plan
Made with Cursor
Summary by CodeRabbit