Skip to content

ci: add node 24 to test matrices #7213

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: latest
cache: npm

- name: Install dependencies
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
# Pinning 20.x version as a temporary workaround due to this https://github.com/nodejs/node/issues/52884
node-version: ['18.14.0', '20.12.2', '22']
node-version: ['18.14.0', '20', '22', '24.0.0-rc.2']
fail-fast: false
steps:
# This improves Windows network performance. We need this since we open many ports in our tests.
Expand All @@ -47,7 +46,7 @@ jobs:
version: 10

- name: Install dependencies
run: npm ci --no-audit
run: npm ci --ignore-scripts --no-audit

- name: Build project
run: npm run build
Expand Down Expand Up @@ -79,7 +78,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
node-version: ['18.14.0', '*']
node-version: ['18.14.0', '22', '24.0.0-rc.2']
fail-fast: false
steps:
- name: Git checkout
Expand All @@ -99,7 +98,7 @@ jobs:
version: 10

- name: Install dependencies
run: npm ci --no-audit
run: npm ci --ignore-scripts --no-audit

- name: Build project
run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: latest
cache: npm

- name: Install dependencies
Expand Down
91 changes: 4 additions & 87 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
# Pinning 20.x version as a temporary workaround due to this https://github.com/nodejs/node/issues/52884
node-version: ['18.17.0', '20.12.2', '22']
# TODO(serhalp): Document why we test against 18.17.0 here (18.14.0 is our minimum supported version)
node-version: ['18.17.0', '20', '22', '24.0.0-rc.2']
shard: ['1/4', '2/4', '3/4', '4/4']

# TODO(serhalp): Why are these excluded? Document, fix, or remove.
exclude:
- os: macOS-latest
node-version: '18.17.0'
Expand Down Expand Up @@ -61,7 +62,7 @@ jobs:
deno-version: v1.44.4

- name: Install core dependencies
run: npm ci --no-audit
run: npm ci --ignore-scripts --no-audit

- name: Build project
run: npm run build
Expand Down Expand Up @@ -113,87 +114,3 @@ jobs:
with:
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
token: ${{ secrets.CODECOV_TOKEN }}
# Specific tests for known test that failed on windows using node 23.
# Can be replaced with larger node 23 tests in the future.
integration-win-node-23:
name: Integration test windows latest node23 specific
runs-on: windows-latest
timeout-minutes: 40
steps:
# This improves Windows network performance, we need this since we open many ports in our tests
- name: Increase Windows port limit and reduce time wait delay
run: |
netsh int ipv4 set dynamicport tcp start=1025 num=64511
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters /v TcpTimedWaitDelay /t REG_DWORD /d 30 /f

- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '23.x'
cache: npm
check-latest: true

- name: Install PNPM
run: |
corepack enable
corepack prepare [email protected] --activate

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.44.4

- name: Install core dependencies
run: npm ci --no-audit

- name: Build project
run: npm run build
if: '${{!steps.release-check.outputs.IS_RELEASE}}'

- name: Prepare tests
run: npm run test:init

- name: Tests
run: npm exec vitest -- run tests/integration/commands/dev/dev.test.ts --coverage
env:
# GitHub secrets are not available when running on PR from forks
# We set a flag so we can skip tests that access Netlify API
NETLIFY_TEST_DISABLE_LIVE:
${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_TEST_GITHUB_TOKEN is used to avoid reaching GitHub API limits in exec-fetcher.js
NETLIFY_TEST_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Changes the polling interval used by the file watcher
CHOKIDAR_INTERVAL: 20
CHOKIDAR_USEPOLLING: 1

- name: Get test coverage flags
id: test-coverage-flags
# For windows we have to use $env:
run: |-
os=windows-latest
node=$(node --version)
echo "os=${os/-latest/}" >> $GITHUB_OUTPUT
echo "os=${os/-latest/}" >> $env:GITHUB_OUTPUT
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT
shell: bash

- name: Store npm error artefacts
uses: actions/upload-artifact@v4
if: always()
with:
name: npm-logs--windows-latest--23x
path: |
~/.npm/_logs/**/*

- uses: codecov/codecov-action@v5
continue-on-error: true
with:
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: latest
cache: npm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release-sha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '18.17.0'
node-version: latest
cache: npm
registry-url: 'https://registry.npmjs.org'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: latest
cache: npm
registry-url: 'https://registry.npmjs.org'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: latest
cache: npm
registry-url: 'https://registry.npmjs.org'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: latest
cache: npm

- name: Install dependencies
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: ['18.14.0', '22.x']
node-version: ['18.14.0', '22', '24.0.0-rc.2']
# TODO(serhalp): Why is this excluded? Document, fix, or remove.
exclude:
- os: windows-latest
node-version: '22.x'
node-version: '22'
fail-fast: false
steps:
- name: Git checkout
Expand All @@ -34,7 +35,7 @@ jobs:
check-latest: true

- name: Install core dependencies
run: npm ci --no-audit
run: npm ci --ignore-scripts --no-audit

- name: Build project
run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: latest
cache: npm

- name: Install dependencies
Expand Down
Loading