ci: Switch to Node.js 20 by default. Add initial support for Node.js 22 (#9501)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-05-24 12:32:50 +02:00
committed by GitHub
parent a58be175cc
commit 6ea8607716
18 changed files with 50 additions and 60 deletions

View File

@@ -17,9 +17,9 @@ jobs:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- name: Install dependencies

View File

@@ -19,9 +19,9 @@ jobs:
uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- name: Install dependencies

View File

@@ -20,9 +20,9 @@ jobs:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4.0.1
uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
- run: npm install --prefix=.github/scripts --no-package-lock

View File

@@ -15,9 +15,9 @@ jobs:
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

View File

@@ -9,20 +9,15 @@ jobs:
install-and-build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
node-version: [18.x, 20.x]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: ${{ matrix.node-version }}
node-version: 20.x
cache: pnpm
- name: Install dependencies
@@ -35,7 +30,7 @@ jobs:
uses: actions/cache/save@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
key: ${{ github.sha }}-base:build
unit-test:
name: Unit tests
@@ -43,20 +38,17 @@ jobs:
needs: install-and-build
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
with:
ref: ${{ inputs.branch }}
nodeVersion: ${{ matrix.node-version }}
cacheKey: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
cacheKey: ${{ github.sha }}-base:build
collectCoverage: true
lint:
name: Lint changes
runs-on: ubuntu-latest
needs: install-and-build
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4.1.1
with:
@@ -64,10 +56,9 @@ jobs:
ref: ${{ inputs.branch }}
- run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: ${{ matrix.node-version }}
node-version: 20.x
cache: pnpm
- name: Install dependencies
@@ -77,7 +68,7 @@ jobs:
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
key: ${{ github.sha }}-base:build
- name: Lint
env:

View File

@@ -20,9 +20,9 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
@@ -46,9 +46,9 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
@@ -72,9 +72,9 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
@@ -106,9 +106,9 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

View File

@@ -13,10 +13,9 @@ jobs:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- run: corepack enable
- name: Use Node.js 18
uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: pnpm
- name: Install dependencies
@@ -29,7 +28,7 @@ jobs:
uses: actions/cache/save@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}-base:18-test-lint
key: ${{ github.sha }}-base:build
unit-test:
name: Unit tests
@@ -37,7 +36,7 @@ jobs:
needs: install
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
cacheKey: ${{ github.sha }}-base:18-test-lint
cacheKey: ${{ github.sha }}-base:build
lint:
name: Lint changes
@@ -50,10 +49,9 @@ jobs:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- run: corepack enable
- name: Use Node.js 18
uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: pnpm
- name: Install dependencies
@@ -63,7 +61,7 @@ jobs:
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}-base:18-test-lint
key: ${{ github.sha }}-base:build
- name: Lint
run: pnpm lint

View File

@@ -7,10 +7,11 @@ on:
description: 'Node.js version to build this image with.'
type: choice
required: true
default: '18'
default: '20'
options:
- '18'
- '20'
- '22'
jobs:
build:

View File

@@ -36,9 +36,9 @@ jobs:
ref: ${{ github.event.inputs.base-branch }}
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
- run: npm install --prefix=.github/scripts --no-package-lock

View File

@@ -24,9 +24,9 @@ jobs:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

View File

@@ -22,9 +22,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
- run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm dist-tag add n8n@${{ github.event.inputs.version }} ${{ github.event.inputs.release-channel }}

View File

@@ -26,9 +26,9 @@ jobs:
- run: corepack enable
working-directory: n8n
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
cache-dependency-path: 'n8n/pnpm-lock.yaml'

View File

@@ -12,7 +12,7 @@ on:
description: 'Version of node to use.'
required: false
type: string
default: '18.x'
default: 20.x
cacheKey:
description: 'Cache key for modules and build artifacts.'
required: false
@@ -37,7 +37,7 @@ jobs:
- run: corepack enable
- name: Use Node.js ${{ inputs.nodeVersion }}
uses: actions/setup-node@v4.0.1
uses: actions/setup-node@v4.0.2
with:
node-version: ${{ inputs.nodeVersion }}
cache: pnpm