Skip to content
Merged
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@v5
with:
node-version: lts/*
node-version: '24'
cache: npm

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
os: [windows-2025]
# Pinning 20.x version as a temporary workaround due to this https://github.com/nodejs/node/issues/52884
node-version: ['20.12.2', '22']
node-version: ['20.12.2', '22', '24']
fail-fast: false
steps:
# This improves Windows network performance. We need this since we open many ports in our tests.
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
node-version: ['20.12.2', '22']
node-version: ['20.12.2', '22', '24']
fail-fast: false
steps:
- name: Git checkout
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@v5
with:
node-version: 22.20.0
node-version: '24'
cache: npm

- name: Install dependencies
Expand Down
90 changes: 1 addition & 89 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ jobs:
matrix:
os: [ubuntu-latest, macOS-latest, windows-2025]
# Pinning 20.x version as a temporary workaround due to this https://github.com/nodejs/node/issues/52884
node-version: ['20.12.2', '22']
node-version: ['20.12.2', '22', '24']
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: can we delete the copy-pasted integration-win-node-23 job in this file now? πŸ™πŸΌ

shard: ['1/4', '2/4', '3/4', '4/4']

exclude:
- os: windows-2025
node-version: '22'
fail-fast: false
steps:
# This improves Windows network performance, we need this since we open many ports in our tests
Expand Down Expand Up @@ -109,87 +105,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-2025
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@v5
with:
fetch-depth: 0

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

- name: Install PNPM
run: |
corepack enable
corepack prepare pnpm@9.14.2 --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-2025
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-2025--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@v5
with:
node-version: 22.20.0
node-version: '24'
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@v5
with:
node-version: '22.20.0'
node-version: '24'
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@v5
with:
node-version: lts/*
node-version: '24'
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@v5
with:
node-version: lts/*
node-version: '24'
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@v5
with:
node-version: 22.20.0
node-version: '24'
cache: npm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-2025]
node-version: ['20.12.2', '22.x']
node-version: ['20.12.2', '22.x', '24']
Copy link
Member

Choose a reason for hiding this comment

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

πŸ’­ Don't forget to mark the new e2e + integration + unit v24 CI jobs as required when you merge!

exclude:
- os: windows-2025
node-version: '22.x'
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@v5
with:
node-version: lts/*
node-version: '24'
cache: npm

- name: Install dependencies
Expand Down
20 changes: 17 additions & 3 deletions e2e/install.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ const distDir = path.join(projectRoot, 'dist')
const tempdirPrefix = 'netlify-cli-e2e-test--'

const debug = createDebug('netlify-cli:e2e')
const isNodeModules = picomatch('**/node_modules/**')
const isNotNodeModules = (target: string) => !isNodeModules(target)
const isNodeModules = picomatch('**/node_modules/**', { dot: true })
const shouldCopyCLIFile = async (src: string) => {
if (isNodeModules(src)) return false

try {
const st = await fs.lstat(src) // DO NOT follow symlinks
if (st.isSocket() || st.isFIFO() || st.isCharacterDevice() || st.isBlockDevice()) {
return false
}
} catch {
// If we can't lstat it, skip it
return false
}

return true
}

const itWithMockNpmRegistry = it.extend<{ registry: { address: string; cwd: string } }>({
registry: async (
Expand Down Expand Up @@ -107,7 +121,7 @@ const itWithMockNpmRegistry = it.extend<{ registry: { address: string; cwd: stri
verbatimSymlinks: true,
// At this point, the project is built. As long as we limit the prepublish script to built-
// ins, node_modules are not be necessary to publish the package.
filter: isNotNodeModules,
filter: shouldCopyCLIFile,
})
await fs.writeFile(
path.join(publishWorkspace, '.npmrc'),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/command-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export const netlifyCommand = () => {
}

// Captures `pnpx netlify ...`
if (pkgFromUserAgent(npm_config_user_agent) === 'pnpm' && npm_command === 'run-script') {
if (pkgFromUserAgent(npm_config_user_agent) === 'pnpm' && ['run-script', 'run'].includes(npm_command ?? '')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in node 24 on unix this has changed, and pnpm sets npm_command to run instead

return `pnpx netlify`
}

Expand Down