Unverified Commit 793a2ce9 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

CI speed improvements (#93411)

## What?

- Restore pnpm store for test timing fetch to speed up `pnpm install` in
that step.
- Skip playwright install when it's not needed. Multiple steps don't
need Playwright in order to run. Saves 41 seconds per step that doesn't
need it.
- Removed extra playwright install on the `test-firefox-safari` as
Playwright already gets installed in the reusable workflow.

### Before (canary)

<img width="1546" height="1142" alt="CleanShot 2026-05-01 at 16 17
37@2x"
src="https://github.com/user-attachments/assets/7819915b-9c42-4286-b0b9-c2489b322825"
/>

### After (This PR)

<img width="1588" height="968" alt="CleanShot 2026-05-01 at 16 17 25@2x"
src="https://github.com/user-attachments/assets/fb583831-a78c-42db-a77d-7e27af9c1f35"
/>

---------
Co-authored-by: 's avatarBenjamin Woodruff <benjamin.woodruff@vercel.com>
parent 938c286b
...@@ -136,6 +136,7 @@ jobs: ...@@ -136,6 +136,7 @@ jobs:
name: build-next name: build-next
uses: ./.github/workflows/build_reusable.yml uses: ./.github/workflows/build_reusable.yml
with: with:
needsPlaywright: 'no'
skipNativeBuild: 'yes' skipNativeBuild: 'yes'
stepName: 'build-next' stepName: 'build-next'
secrets: inherit secrets: inherit
...@@ -162,6 +163,23 @@ jobs: ...@@ -162,6 +163,23 @@ jobs:
with: with:
fetch-depth: 25 fetch-depth: 25
# Match the reusable workflow's pnpm-store cache path so this setup-only
# job does not bottleneck the larger test matrix.
- name: Get pnpm store directory
if: ${{ runner.environment == 'github-hosted' }}
id: get-store-path
run: echo STORE_PATH="$(pnpm store path)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
if: ${{ runner.environment == 'github-hosted' }}
uses: actions/cache@v5
timeout-minutes: 5
id: cache-pnpm-store
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
key: pnpm-store-v2-${{ hashFiles('pnpm-lock.yaml') }}
# Do not use restore-keys since it leads to indefinite growth of the cache.
- name: Install dependencies - name: Install dependencies
run: pnpm install run: pnpm install
...@@ -193,6 +211,7 @@ jobs: ...@@ -193,6 +211,7 @@ jobs:
needs: ['build-next'] needs: ['build-next']
uses: ./.github/workflows/build_reusable.yml uses: ./.github/workflows/build_reusable.yml
with: with:
needsPlaywright: 'no'
skipNativeBuild: 'yes' skipNativeBuild: 'yes'
skipNativeInstall: 'yes' skipNativeInstall: 'yes'
afterBuild: | afterBuild: |
...@@ -224,6 +243,7 @@ jobs: ...@@ -224,6 +243,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml uses: ./.github/workflows/build_reusable.yml
with: with:
needsPlaywright: 'no'
afterBuild: pnpm types-and-precompiled afterBuild: pnpm types-and-precompiled
stepName: 'types-and-precompiled' stepName: 'types-and-precompiled'
secrets: inherit secrets: inherit
...@@ -693,6 +713,7 @@ jobs: ...@@ -693,6 +713,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml uses: ./.github/workflows/build_reusable.yml
with: with:
needsPlaywright: 'no'
nodeVersion: ${{ matrix.node }} nodeVersion: ${{ matrix.node }}
afterBuild: node run-tests.js --type unit afterBuild: node run-tests.js --type unit
stepName: 'test-unit-${{ matrix.node }}' stepName: 'test-unit-${{ matrix.node }}'
...@@ -755,6 +776,7 @@ jobs: ...@@ -755,6 +776,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml uses: ./.github/workflows/build_reusable.yml
with: with:
needsPlaywright: 'no'
nodeVersion: ${{ matrix.node }} nodeVersion: ${{ matrix.node }}
afterBuild: node run-tests.js --type unit afterBuild: node run-tests.js --type unit
stepName: 'test-unit-windows-${{ matrix.node }}' stepName: 'test-unit-windows-${{ matrix.node }}'
...@@ -1079,8 +1101,6 @@ jobs: ...@@ -1079,8 +1101,6 @@ jobs:
with: with:
browser: 'firefox webkit' browser: 'firefox webkit'
afterBuild: | afterBuild: |
pnpm playwright install
# these all run without concurrency because they're heavier # these all run without concurrency because they're heavier
export TEST_CONCURRENCY=1 export TEST_CONCURRENCY=1
export IS_TURBOPACK_TEST=1 export IS_TURBOPACK_TEST=1
......
...@@ -96,6 +96,11 @@ on: ...@@ -96,6 +96,11 @@ on:
required: false required: false
type: string type: string
default: 'chromium' default: 'chromium'
needsPlaywright:
description: 'whether Playwright browser installation is needed'
required: false
type: string
default: 'yes'
env: env:
NAPI_CLI_VERSION: 2.18.4 NAPI_CLI_VERSION: 2.18.4
TURBO_VERSION: 2.9.4 TURBO_VERSION: 2.9.4
...@@ -324,7 +329,7 @@ jobs: ...@@ -324,7 +329,7 @@ jobs:
if: ${{ inputs.skipInstallBuild != 'yes' }} if: ${{ inputs.skipInstallBuild != 'yes' }}
- name: Install Playwright browsers - name: Install Playwright browsers
if: ${{ inputs.skipInstallBuild != 'yes' }} if: ${{ inputs.skipInstallBuild != 'yes' && inputs.needsPlaywright != 'no' }}
run: | run: |
PW_VERSION=$(pnpm playwright --version 2>/dev/null || echo "unknown") PW_VERSION=$(pnpm playwright --version 2>/dev/null || echo "unknown")
CACHE_DIR="$HOME/.cache" CACHE_DIR="$HOME/.cache"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment