Skip to content

chore(ci): use nodeVersion with environment variables #74576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.3.3
NODE_MAINTENANCE_VERSION: 18
NODE_MAINTENANCE_VERSION: 18.18.2
NODE_LTS_VERSION: 20
TEST_CONCURRENCY: 8
# disable backtrace for test snapshots
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_MAINTENANCE_VERSION }}
- run: corepack enable
- name: 'Run link checker'
run: node ./.github/actions/validate-docs-links/dist/index.js
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
react: ['']
uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: 18.18.2
nodeVersion: ${{ env.NODE_MAINTENANCE_VERSION }}
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-dev-tests-manifest.json" TURBOPACK=1 TURBOPACK_DEV=1 NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration
stepName: 'test-turbopack-integration-react-${{ matrix.react }}-${{ matrix.group }}'
secrets: inherit
Expand All @@ -270,7 +270,7 @@ jobs:
react: ['', '18.3.1']
uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: 18.18.2
nodeVersion: ${{ env.NODE_MAINTENANCE_VERSION }}
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-build-tests-manifest.json" TURBOPACK=1 TURBOPACK_BUILD=1 NEXT_TEST_MODE=start NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production
stepName: 'test-turbopack-production-react-${{ matrix.react }}-${{ matrix.group }}'
secrets: inherit
Expand All @@ -286,7 +286,7 @@ jobs:
group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: 18.18.2
nodeVersion: ${{ env.NODE_MAINTENANCE_VERSION }}
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-build-tests-manifest.json" TURBOPACK=1 TURBOPACK_BUILD=1 node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration
stepName: 'test-turbopack-production-integration-${{ matrix.group }}'
secrets: inherit
Expand All @@ -298,6 +298,7 @@ jobs:

uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: ${{ env.NODE_MAINTENANCE_VERSION }}
afterBuild: rustup target add wasm32-unknown-unknown && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && node ./scripts/normalize-version-bump.js && turbo run build-wasm -- --target nodejs && git checkout . && mv crates/wasm/pkg crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/production/pages-dir/production/test/index.test.ts test/e2e/streaming-ssr/index.test.ts
stepName: 'test-next-swc-wasm'
secrets: inherit
Expand Down Expand Up @@ -326,7 +327,9 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18, 20] # TODO: use env var like [env.NODE_MAINTENANCE_VERSION, env.NODE_LTS_VERSION]
node:
- ${{ env.NODE_MAINTENANCE_VERSION }}
- ${{ env.NODE_LTS_VERSION }}

uses: ./.github/workflows/build_reusable.yml
with:
Expand Down Expand Up @@ -458,7 +461,7 @@ jobs:
react: ['']
uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: 18.18.2
nodeVersion: ${{ env.NODE_MAINTENANCE_VERSION }}
afterBuild: NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration
stepName: 'test-integration-${{ matrix.group }}-react-${{ matrix.react }}'
secrets: inherit
Expand Down Expand Up @@ -487,7 +490,7 @@ jobs:

uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: 18.18.2
nodeVersion: ${{ env.NODE_MAINTENANCE_VERSION }}
afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" node run-tests.js --timings -c ${TEST_CONCURRENCY} --type integration
stepName: 'test-ppr-integration'
secrets: inherit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: corepack enable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/retry_deploy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: >-
${{
github.event.workflow_run.conclusion == 'failure' &&
github.repository == 'vercel/next.js' &&
github.repository_owner == 'vercel' &&
github.event.workflow_run.run_attempt < 2
}}
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/retry_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: >-
${{
github.event.workflow_run.conclusion == 'failure' &&
github.repository == 'vercel/next.js' &&
github.repository_owner == 'vercel' &&
github.event.workflow_run.run_attempt < 3
}}
runs-on: ubuntu-latest
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ on:

name: Test examples

env:
# TODO: LTS Version is now 22
NODE_MAINTENANCE_VERSION: 18.18.2
NODE_LTS_VERSION: 20

jobs:
testExamples:
# Don't execute using cron on forks
if: (github.repository == 'vercel/next.js') || (inputs.is_dispatched == true)
if: (github.repository_owner == 'vercel') || (inputs.is_dispatched == true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matches other checks e.g. in trigger_release 👍🏻

name: Test Examples
runs-on: ubuntu-latest
timeout-minutes: 120
Expand All @@ -25,7 +30,9 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18, 20]
node:
- ${{ env.NODE_MAINTENANCE_VERSION }}
- ${{ env.NODE_LTS_VERSION }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -37,7 +44,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node }}
check-latest: true
- run: corepack enable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true

- name: Clone Next.js repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ env:
NEXT_TEST_CONTINUE_ON_ERROR: TRUE
NEXT_E2E_TEST_TIMEOUT: 240000
NEXT_TEST_JOB: 1
# TODO: LTS Version is now 22
NODE_MAINTENANCE_VERSION: 18.18.2
NODE_LTS_VERSION: 20

jobs:
# First, build Next.js to execute across tests.
setup_nextjs:
name: Setup Next.js build
uses: ./.github/workflows/setup-nextjs-build.yml
with:
nodeVersion: 18.18.2
nodeVersion: ${{ env.NODE_MAINTENANCE_VERSION }}
version: ${{ inputs.version || 'canary' }}

# Actual test scheduling. These jobs mimic the same jobs in Next.js repo,
Expand Down Expand Up @@ -70,7 +73,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.18.2
node-version: ${{ env.NODE_MAINTENANCE_VERSION }}
check-latest: true
- uses: actions/cache/restore@v3
id: restore-build
Expand Down Expand Up @@ -121,7 +124,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.18.2
node-version: ${{ env.NODE_MAINTENANCE_VERSION }}
check-latest: true
- uses: actions/cache/restore@v3
id: restore-build
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/turbopack-nextjs-dev-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ env:
NEXT_TEST_CONTINUE_ON_ERROR: TRUE
NEXT_E2E_TEST_TIMEOUT: 240000
NEXT_TEST_JOB: 1
# TODO: LTS Version is now 22
NODE_MAINTENANCE_VERSION: 18.18.2
NODE_LTS_VERSION: 20

jobs:
# First, build next-dev and Next.js both to execute across tests.
setup_nextjs:
name: Setup Next.js build
uses: ./.github/workflows/setup-nextjs-build.yml
with:
nodeVersion: 18.18.2
nodeVersion: ${{ env.NODE_MAINTENANCE_VERSION }}
version: ${{ inputs.version || 'canary' }}

# Actual test scheduling. These jobs mimic the same jobs in Next.js repo,
Expand Down Expand Up @@ -70,13 +73,13 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.18.2
node-version: ${{ env.NODE_MAINTENANCE_VERSION }}
check-latest: true
- uses: actions/cache/restore@v3
id: restore-build
with:
path: ./*
key: ${{ inputs.version || 'canary' }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt}}-${{ github.run_number }}
key: ${{ inputs.version || 'canary' }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.run_number }}
fail-on-cache-miss: true

- name: Enable corepack and install yarn
Expand Down Expand Up @@ -121,7 +124,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.18.2
node-version: ${{ env.NODE_MAINTENANCE_VERSION }}
check-latest: true
- uses: actions/cache/restore@v3
id: restore-build
Expand Down
Loading