mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
ci: Switch to Node.js 20 by default. Add initial support for Node.js 22 (#9501)
This commit is contained in:
parent
a58be175cc
commit
6ea8607716
|
@ -17,9 +17,9 @@ jobs:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
4
.github/workflows/check-pr-title.yml
vendored
4
.github/workflows/check-pr-title.yml
vendored
|
@ -19,9 +19,9 @@ jobs:
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
4
.github/workflows/check-tests.yml
vendored
4
.github/workflows/check-tests.yml
vendored
|
@ -20,9 +20,9 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
uses: actions/setup-node@v4.0.1
|
uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
|
|
||||||
- run: npm install --prefix=.github/scripts --no-package-lock
|
- run: npm install --prefix=.github/scripts --no-package-lock
|
||||||
|
|
||||||
|
|
4
.github/workflows/chromatic.yml
vendored
4
.github/workflows/chromatic.yml
vendored
|
@ -15,9 +15,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
|
27
.github/workflows/ci-master.yml
vendored
27
.github/workflows/ci-master.yml
vendored
|
@ -9,20 +9,15 @@ jobs:
|
||||||
install-and-build:
|
install-and-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
timeout-minutes: 30
|
timeout-minutes: 10
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [18.x, 20.x]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- uses: actions/setup-node@v4.0.2
|
||||||
uses: actions/setup-node@v4.0.1
|
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: 20.x
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
@ -35,7 +30,7 @@ jobs:
|
||||||
uses: actions/cache/save@v4.0.0
|
uses: actions/cache/save@v4.0.0
|
||||||
with:
|
with:
|
||||||
path: ./packages/**/dist
|
path: ./packages/**/dist
|
||||||
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
|
key: ${{ github.sha }}-base:build
|
||||||
|
|
||||||
unit-test:
|
unit-test:
|
||||||
name: Unit tests
|
name: Unit tests
|
||||||
|
@ -43,20 +38,17 @@ jobs:
|
||||||
needs: install-and-build
|
needs: install-and-build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [18.x, 20.x]
|
node-version: [18.x, 20.x, 22.x]
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
nodeVersion: ${{ matrix.node-version }}
|
nodeVersion: ${{ matrix.node-version }}
|
||||||
cacheKey: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
|
cacheKey: ${{ github.sha }}-base:build
|
||||||
collectCoverage: true
|
collectCoverage: true
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint changes
|
name: Lint changes
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: install-and-build
|
needs: install-and-build
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [18.x, 20.x]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
|
@ -64,10 +56,9 @@ jobs:
|
||||||
ref: ${{ inputs.branch }}
|
ref: ${{ inputs.branch }}
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- uses: actions/setup-node@v4.0.2
|
||||||
uses: actions/setup-node@v4.0.1
|
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: 20.x
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
@ -77,7 +68,7 @@ jobs:
|
||||||
uses: actions/cache/restore@v4.0.0
|
uses: actions/cache/restore@v4.0.0
|
||||||
with:
|
with:
|
||||||
path: ./packages/**/dist
|
path: ./packages/**/dist
|
||||||
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
|
key: ${{ github.sha }}-base:build
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
env:
|
env:
|
||||||
|
|
16
.github/workflows/ci-postgres-mysql.yml
vendored
16
.github/workflows/ci-postgres-mysql.yml
vendored
|
@ -20,9 +20,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
@ -46,9 +46,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
@ -72,9 +72,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
@ -106,9 +106,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
|
16
.github/workflows/ci-pull-requests.yml
vendored
16
.github/workflows/ci-pull-requests.yml
vendored
|
@ -13,10 +13,9 @@ jobs:
|
||||||
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- name: Use Node.js 18
|
- uses: actions/setup-node@v4.0.2
|
||||||
uses: actions/setup-node@v4.0.1
|
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
@ -29,7 +28,7 @@ jobs:
|
||||||
uses: actions/cache/save@v4.0.0
|
uses: actions/cache/save@v4.0.0
|
||||||
with:
|
with:
|
||||||
path: ./packages/**/dist
|
path: ./packages/**/dist
|
||||||
key: ${{ github.sha }}-base:18-test-lint
|
key: ${{ github.sha }}-base:build
|
||||||
|
|
||||||
unit-test:
|
unit-test:
|
||||||
name: Unit tests
|
name: Unit tests
|
||||||
|
@ -37,7 +36,7 @@ jobs:
|
||||||
needs: install
|
needs: install
|
||||||
with:
|
with:
|
||||||
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||||
cacheKey: ${{ github.sha }}-base:18-test-lint
|
cacheKey: ${{ github.sha }}-base:build
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint changes
|
name: Lint changes
|
||||||
|
@ -50,10 +49,9 @@ jobs:
|
||||||
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- name: Use Node.js 18
|
- uses: actions/setup-node@v4.0.2
|
||||||
uses: actions/setup-node@v4.0.1
|
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
@ -63,7 +61,7 @@ jobs:
|
||||||
uses: actions/cache/restore@v4.0.0
|
uses: actions/cache/restore@v4.0.0
|
||||||
with:
|
with:
|
||||||
path: ./packages/**/dist
|
path: ./packages/**/dist
|
||||||
key: ${{ github.sha }}-base:18-test-lint
|
key: ${{ github.sha }}-base:build
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
|
|
3
.github/workflows/docker-base-image.yml
vendored
3
.github/workflows/docker-base-image.yml
vendored
|
@ -7,10 +7,11 @@ on:
|
||||||
description: 'Node.js version to build this image with.'
|
description: 'Node.js version to build this image with.'
|
||||||
type: choice
|
type: choice
|
||||||
required: true
|
required: true
|
||||||
default: '18'
|
default: '20'
|
||||||
options:
|
options:
|
||||||
- '18'
|
- '18'
|
||||||
- '20'
|
- '20'
|
||||||
|
- '22'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
4
.github/workflows/release-create-pr.yml
vendored
4
.github/workflows/release-create-pr.yml
vendored
|
@ -36,9 +36,9 @@ jobs:
|
||||||
ref: ${{ github.event.inputs.base-branch }}
|
ref: ${{ github.event.inputs.base-branch }}
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
|
|
||||||
- run: npm install --prefix=.github/scripts --no-package-lock
|
- run: npm install --prefix=.github/scripts --no-package-lock
|
||||||
|
|
||||||
|
|
4
.github/workflows/release-publish.yml
vendored
4
.github/workflows/release-publish.yml
vendored
|
@ -24,9 +24,9 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
- run: |
|
- run: |
|
||||||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
|
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
|
||||||
npm dist-tag add n8n@${{ github.event.inputs.version }} ${{ github.event.inputs.release-channel }}
|
npm dist-tag add n8n@${{ github.event.inputs.version }} ${{ github.event.inputs.release-channel }}
|
||||||
|
|
4
.github/workflows/test-workflows.yml
vendored
4
.github/workflows/test-workflows.yml
vendored
|
@ -26,9 +26,9 @@ jobs:
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
working-directory: n8n
|
working-directory: n8n
|
||||||
|
|
||||||
- uses: actions/setup-node@v4.0.1
|
- uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 20.x
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'n8n/pnpm-lock.yaml'
|
cache-dependency-path: 'n8n/pnpm-lock.yaml'
|
||||||
|
|
||||||
|
|
4
.github/workflows/units-tests-reusable.yml
vendored
4
.github/workflows/units-tests-reusable.yml
vendored
|
@ -12,7 +12,7 @@ on:
|
||||||
description: 'Version of node to use.'
|
description: 'Version of node to use.'
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: '18.x'
|
default: 20.x
|
||||||
cacheKey:
|
cacheKey:
|
||||||
description: 'Cache key for modules and build artifacts.'
|
description: 'Cache key for modules and build artifacts.'
|
||||||
required: false
|
required: false
|
||||||
|
@ -37,7 +37,7 @@ jobs:
|
||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- name: Use Node.js ${{ inputs.nodeVersion }}
|
- name: Use Node.js ${{ inputs.nodeVersion }}
|
||||||
uses: actions/setup-node@v4.0.1
|
uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
node-version: ${{ inputs.nodeVersion }}
|
node-version: ${{ inputs.nodeVersion }}
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
|
@ -64,7 +64,7 @@ dependencies are installed and the packages get linked correctly. Here's a short
|
||||||
|
|
||||||
#### Node.js
|
#### Node.js
|
||||||
|
|
||||||
[Node.js](https://nodejs.org/en/) version 16.9 or newer is required for development purposes.
|
[Node.js](https://nodejs.org/en/) version 18.10 or newer is required for development purposes.
|
||||||
|
|
||||||
#### pnpm
|
#### pnpm
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
ARG NODE_VERSION=18
|
ARG NODE_VERSION=20
|
||||||
|
|
||||||
# 1. Use a builder step to download various dependencies
|
# 1. Use a builder step to download various dependencies
|
||||||
FROM node:${NODE_VERSION}-alpine as builder
|
FROM node:${NODE_VERSION}-alpine as builder
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
ARG NODE_VERSION=18
|
ARG NODE_VERSION=20
|
||||||
|
|
||||||
# 1. Create an image to build n8n
|
# 1. Create an image to build n8n
|
||||||
FROM --platform=linux/amd64 n8nio/base:${NODE_VERSION} as builder
|
FROM --platform=linux/amd64 n8nio/base:${NODE_VERSION} as builder
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
ARG NODE_VERSION=18
|
ARG NODE_VERSION=20
|
||||||
FROM n8nio/base:${NODE_VERSION}
|
FROM n8nio/base:${NODE_VERSION}
|
||||||
|
|
||||||
ARG N8N_VERSION
|
ARG N8N_VERSION
|
||||||
|
|
|
@ -21,10 +21,10 @@ if (process.argv.length === 2) {
|
||||||
const nodeVersion = process.versions.node;
|
const nodeVersion = process.versions.node;
|
||||||
const nodeVersionMajor = require('semver').major(nodeVersion);
|
const nodeVersionMajor = require('semver').major(nodeVersion);
|
||||||
|
|
||||||
if (![18, 20].includes(nodeVersionMajor)) {
|
if (![18, 20, 22].includes(nodeVersionMajor)) {
|
||||||
console.log(`
|
console.log(`
|
||||||
Your Node.js version (${nodeVersion}) is currently not supported by n8n.
|
Your Node.js version (${nodeVersion}) is currently not supported by n8n.
|
||||||
Please use Node.js v18 (recommended), or v20 instead!
|
Please use Node.js v18 (recommended), v20, or v22 instead!
|
||||||
`);
|
`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue