Enable pnpm dependency caching in e2e deploy tests#88953
Conversation
|
Cursor Agent can help with this pull request. Just |
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
Tests Passed |
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **432 kB** → **432 kB** ✅ -42 B82 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
|
This adds pnpm dependency caching to build_reusable.yml for jobs that run on GitHub-hosted ubuntu-latest runners (like the e2e deploy tests). The caching pattern follows the same approach used in build_and_deploy.yml, create_release_branch.yml, and trigger_release.yml: - Get the pnpm store path - Cache it using actions/cache@v4 with a key based on pnpm-lock.yaml hash This will speed up pnpm install for jobs like test_e2e_deploy_release.yml that pass runs_on_labels: '["ubuntu-latest"]'. Co-authored-by: sebastian.silbermann <sebastian.silbermann@vercel.com>
This reverts commit 58fc623.
Add enablePnpmCache input to build_reusable.yml and enable it in test_e2e_deploy_release.yml for the test-deploy job. This caches the pnpm store between workflow runs, speeding up pnpm install for GitHub-hosted ubuntu-latest runners. The caching pattern follows the same approach used in build_and_deploy.yml, create_release_branch.yml, and trigger_release.yml. Co-authored-by: sebastian.silbermann <sebastian.silbermann@vercel.com>
Add check for ubuntu-latest in runs_on_labels to ensure pnpm caching only runs on GitHub-hosted runners. Self-hosted runners have their own persistent storage and don't need actions/cache. Co-authored-by: sebastian.silbermann <sebastian.silbermann@vercel.com>
Remove the explicit enablePnpmCache option and instead automatically enable pnpm store caching when runs_on_labels contains 'ubuntu-latest'. This way any job using build_reusable.yml on GitHub-hosted runners will benefit from pnpm caching without needing to remember to enable it. Co-authored-by: sebastian.silbermann <sebastian.silbermann@vercel.com>
Aligns with the pattern used in other workflows (build_and_deploy.yml, create_release_branch.yml, trigger_release.yml) that explain restore-keys is avoided to prevent indefinite cache growth. Co-authored-by: sebastian.silbermann <sebastian.silbermann@vercel.com>
Use runner.environment == 'github-hosted' instead of checking runs_on_labels for 'ubuntu-latest'. This is more reliable as it directly checks the runner type rather than inferring from labels. Co-authored-by: sebastian.silbermann <sebastian.silbermann@vercel.com>
3edcdbd to
d6d5a70
Compare
|
|
||
| - name: Cache pnpm store | ||
| if: ${{ runner.environment == 'github-hosted' }} | ||
| uses: actions/cache@v4 |
There was a problem hiding this comment.
Has actions/cache gotten more reliable? We previously saw restoring from cache causing slower perf than just installing directly in GitHub's runners, the cache would also randomly cause workflows to fail from transient errors.
There was a problem hiding this comment.
I've never seen a fresh download be faster than a cached install tbh. Maybe it's only slower on self-hosted runners which this change doesn't affect.
There was a problem hiding this comment.
This was way back before we had self hosted runners
|
Can't think of an easy A/B testing setup. Will just look at before/after times (after is cache step + install step). |
Adds pnpm dependency caching to the e2e deploy test workflow. Basically all workflows using build_reusable in a GitHub hosted runners now get pnpm dependency caching. Self-hosted runners relied on the persisted worker environment.
It's also nice for forks/mirrors that use GitHub-hosted runners.
For e2e deploy test this is mostly relevant for a retry. Right now the lockfile changes for every release anyway since we have to use exact versions in the package.json (which change for every release). Ideally we'd use
workspace:*andpnpm publishto avoid lockfile changes on release.test plan
Slack Thread