chore(ci): Warm shared caches and cut per-job install time#3676
Merged
Conversation
|
😎 This pull request was merged. |
Contributor
|
Reviews (1): Last reviewed commit: "skip electron work and use turbo in CI j..." | Re-trigger Greptile |
|
Note 🤖 stamphog reviewed Gates denied on CI/infra deny-list and tier; this rewrites multiple GitHub Actions workflows and a postinstall script with no approving human or agent review, only a bot thumbs-up.
Gate mechanics and policy version
|
tatoalo
approved these changes
Jul 22, 2026
Contributor
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. |
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.
Problem
CI takes 7-12 minutes per PR and most of it is overhead, not tests. Three causes:
pnpm installin every job compiled better-sqlite3 for Electron (~65s of node-gyp), even in jobs that never run Electron. The unit test job then immediately rebuilt it for Node, throwing the Electron build away.Changes
warm-cachesworkflow runs on every push to main and saves the pnpm, Electron, Playwright and turbo caches under the keys the PR jobs restore, so PRs start warm.postinstall.shskips the Electron rebuild whenSKIP_ELECTRON_REBUILD=1. Jobs that never run Electron set it.turbo build --filter='@posthog/code^...', which builds the same 7 packages in parallel and reuses cached results from main.Measured on this PR's own CI, before main even has a seed: install dropped from ~95s to 13s in the Linux jobs. The macOS install and the turbo cache hits need one merge to main (or a manual
gh workflow run warm-caches.yml) to kick in.How did you test this?
bash -non postinstall.sh.turbo build --filter='@posthog/code^...' --dry=jsonto confirm the filter resolves to exactly the packages the old hand-written steps built.Automatic notifications