Skip to content

Commit 6647a77

Browse files
authored
Update more global turbo CLI usage (#76576)
Continues #76532 as it seems to be alleviating the `npm` failures so replaces some more usage of global `npm` installing the turbo CLI. x-ref: https://github.com/vercel/next.js/actions/runs/13554859494/job/37886841090#step:15:25
1 parent 5d8aedc commit 6647a77

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/build_and_deploy.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,11 @@ jobs:
304304
with:
305305
node-version: ${{ env.NODE_LTS_VERSION }}
306306
check-latest: true
307-
- run: corepack enable
307+
308+
- name: Setup corepack
309+
run: |
310+
311+
corepack enable
308312
309313
# we always want to run this to set environment variables
310314
- name: Install Rust
@@ -334,7 +338,7 @@ jobs:
334338
# issues with turbo caching
335339
- name: pull build cache
336340
if: ${{ matrix.settings.docker }}
337-
run: npm i -g turbo@${{ env.TURBO_VERSION }} && node ./scripts/pull-turbo-cache.js ${{ matrix.settings.target }}
341+
run: TURBO_VERSION=${TURBO_VERSION} node ./scripts/pull-turbo-cache.js ${{ matrix.settings.target }}
338342

339343
- name: check build exists
340344
if: ${{ matrix.settings.docker }}
@@ -423,8 +427,6 @@ jobs:
423427
with:
424428
targets: wasm32-unknown-unknown
425429

426-
- run: npm i -g turbo@${{ env.TURBO_VERSION }}
427-
428430
- name: Install wasm-pack
429431
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
430432

scripts/pull-turbo-cache.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ const { spawn } = require('child_process')
77
const target = process.argv[process.argv.length - 1]
88

99
let turboResult = ''
10+
const turboCommand = `pnpm dlx turbo@${process.env.TURBO_VERSION || 'latest'}`
1011

1112
await new Promise((resolve, reject) => {
1213
const child = spawn(
1314
'/bin/bash',
14-
['-c', `pnpm turbo run cache-build-native --dry=json -- ${target}`],
15+
['-c', `${turboCommand} run cache-build-native --dry=json -- ${target}`],
1516
{
1617
stdio: 'pipe',
1718
}
@@ -51,7 +52,7 @@ const { spawn } = require('child_process')
5152
await new Promise((resolve, reject) => {
5253
const child = spawn(
5354
'/bin/bash',
54-
['-c', `pnpm turbo run cache-build-native -- ${target}`],
55+
['-c', `${turboCommand} run cache-build-native -- ${target}`],
5556
{
5657
stdio: 'inherit',
5758
}

0 commit comments

Comments
 (0)