Unverified Commit 36a8f4c2 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

[ci] Use node-version-file when we already have a repository checkout and reduce…

[ci] Use node-version-file when we already have a repository checkout and reduce hardcoded references to node versions (#94780)

I noticed the `node-version-file` option for `setup-node` while
reviewing https://github.com/vercel/nextjs-react-compiler/pull/2

We should use it in places where we're already checking out the
repository anyways. It should make it easier to keep node versions in
sync.
parent cd1a292c
......@@ -23,7 +23,6 @@ env:
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default
# TODO: we should add the relevant envs later to to switch to strict mode
TURBO_ARGS: '-v --env-mode loose --remote-cache-timeout 90 --summarize --log-order stream'
NODE_LTS_VERSION: 20
TURBO_TEAM: 'vtest314-next-adapter-e2e-tests'
# Prefer shared remote cache across runs, but keep local cache enabled so jobs
# degrade gracefully if the remote cache or token is unavailable.
......@@ -55,7 +54,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- name: Setup corepack
......@@ -121,10 +120,15 @@ jobs:
# canary next-swc binaries in the monorepo
NEXT_SKIP_NATIVE_POSTINSTALL: 1
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 25
persist-credentials: false
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- name: Setup corepack
......@@ -132,11 +136,6 @@ jobs:
npm i -g corepack@0.31
corepack enable
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 25
persist-credentials: false
- id: get-store-path
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT
......@@ -251,7 +250,7 @@ jobs:
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
if: ${{ !matrix.docker }}
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......@@ -472,7 +471,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- run: corepack enable
......@@ -516,17 +515,6 @@ jobs:
- build-wasm
- build-native
steps:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
......@@ -543,6 +531,17 @@ jobs:
build-and-deploy-${{ github.sha }}-${{ github.run_number }}
build-and-deploy-${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt}}
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: next-swc-binaries-*
......
......@@ -29,7 +29,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
- name: Setup corepack
......
......@@ -32,7 +32,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
......
......@@ -15,7 +15,6 @@ concurrency:
env:
NAPI_CLI_VERSION: 2.18.4
TURBO_VERSION: 2.9.4
NODE_LTS_VERSION: 20
TEST_CONCURRENCY: 6
TURBO_TEAM: 'vtest314-next-adapter-e2e-tests'
......@@ -159,7 +158,7 @@ jobs:
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
package-manager-cache: false
- name: Install dependencies
......
......@@ -42,7 +42,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......@@ -105,7 +105,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......
......@@ -72,7 +72,7 @@ jobs:
if: steps.precheck.outputs.should_evaluate == 'true'
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......
......@@ -15,7 +15,6 @@ on:
env:
TURBOPACK_BENCH_COUNTS: '100'
TURBOPACK_BENCH_PROGRESS: '1'
NODE_LTS_VERSION: 20
TURBO_TEAM: 'vtest314-next-adapter-e2e-tests'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
......@@ -41,7 +40,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- run: corepack enable
......
......@@ -51,10 +51,16 @@ jobs:
outputs:
next-version: ${{ steps.version.outputs.value }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 25
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......@@ -63,12 +69,6 @@ jobs:
npm i -g corepack@0.31
corepack enable
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 25
persist-credentials: false
- id: nextPackageInfo
name: Get `next` package info
run: |
......
......@@ -12,7 +12,6 @@ env:
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_ADAPTER_TEST_TEAM: vtest314-next-adapter-e2e-tests
VERCEL_ADAPTER_TEST_TOKEN: ${{ secrets.VERCEL_ADAPTER_TEST_TOKEN }}
NODE_LTS_VERSION: 20
TURBO_TEAM: 'vtest314-next-adapter-e2e-tests'
# Prefer shared remote cache across runs, but keep local cache enabled so jobs
# degrade gracefully if the remote cache or token is unavailable.
......@@ -26,10 +25,16 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'vercel'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 25
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......@@ -38,12 +43,6 @@ jobs:
npm i -g corepack@0.31
corepack enable
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 25
persist-credentials: false
- name: Install dependencies
run: pnpm install
......
......@@ -38,7 +38,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- name: Setup corepack
......
......@@ -49,7 +49,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
......
......@@ -42,7 +42,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......@@ -101,7 +101,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......
......@@ -7,9 +7,6 @@ on:
# Allow manual runs
workflow_dispatch:
env:
NODE_LTS_VERSION: 20
jobs:
create-pull-request:
runs-on: ubuntu-latest
......@@ -44,7 +41,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......
......@@ -14,7 +14,6 @@ on:
required: false
env:
NODE_LTS_VERSION: 20
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
jobs:
......@@ -50,7 +49,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
......
......@@ -18,18 +18,18 @@ jobs:
name: Upload test results
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup corepack
run: |
npm i -g corepack@0.31
......
......@@ -9,9 +9,6 @@ on:
workflows: ['build-and-deploy']
types: [completed]
env:
NODE_LTS_VERSION: 20
permissions:
actions: read
contents: read
......@@ -23,13 +20,6 @@ jobs:
if: github.event.workflow_run.conclusion == 'success'
environment: preview-builds
steps:
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
package-manager-cache: false
# Checkout from the default branch (canary) -- workflow_run always uses
# the default branch's version of the workflow file and this checkout
# matches that, ensuring the upload script is trusted.
......@@ -39,6 +29,13 @@ jobs:
fetch-depth: 1
persist-credentials: false
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .node-version
check-latest: true
package-manager-cache: false
- name: Enable corepack
run: corepack enable
......
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