Skip to content

Commit 9037e0b

Browse files
committed
feat(ci): Add Node 18 to test matrix
1 parent 457b806 commit 9037e0b

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ jobs:
281281
runs-on: ubuntu-latest
282282
strategy:
283283
matrix:
284-
node: [8, 10, 12, 14, 16]
284+
node: [8, 10, 12, 14, 16, 18]
285285
steps:
286286
- name: Check out current commit (${{ env.HEAD_COMMIT }})
287287
uses: actions/checkout@v2
@@ -318,7 +318,7 @@ jobs:
318318
runs-on: ubuntu-latest
319319
strategy:
320320
matrix:
321-
node: [10, 12, 14, 16]
321+
node: [10, 12, 14, 16, 18]
322322
steps:
323323
- name: Check out current commit (${{ env.HEAD_COMMIT }})
324324
uses: actions/checkout@v2
@@ -518,7 +518,7 @@ jobs:
518518
continue-on-error: true
519519
strategy:
520520
matrix:
521-
node: [10, 12, 14, 16]
521+
node: [10, 12, 14, 16, 18]
522522
steps:
523523
- name: Check out current commit (${{ github.sha }})
524524
uses: actions/checkout@v2

packages/nextjs/test/run-integration-tests.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ for NEXTJS_VERSION in 10 11 12; do
7878
WEBPACK_VERSION=5 ||
7979
WEBPACK_VERSION=4
8080

81+
# Node v18 only with Webpack 5 and above
82+
# https://github.com/webpack/webpack/issues/14532#issuecomment-947513562
83+
# Context: https://github.com/vercel/next.js/issues/30078#issuecomment-947338268
84+
if [ "$NODE_MAJOR" -gt "17" ] && [ "$WEBPACK_VERSION" -eq "4" ]; then
85+
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
86+
exit 0
87+
fi
88+
if [ "$NODE_MAJOR" -gt "17" ] && [ "$NEXTJS_VERSION" -eq "10" ]; then
89+
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
90+
exit 0
91+
fi
92+
93+
8194
# next 10 defaults to webpack 4 and next 11 defaults to webpack 5, but each can use either based on settings
8295
if [ "$NEXTJS_VERSION" -eq "10" ]; then
8396
sed "s/%RUN_WEBPACK_5%/$RUN_WEBPACK_5/g" <next10.config.template >next.config.js

packages/node/test/manual/webpack-domain/npm-build.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ const path = require('path');
22
const webpack = require('webpack');
33
const { execSync } = require('child_process');
44

5+
// Webpack test does not work in Node 18 and above.
6+
if (Number(process.versions.node.split('.')[0]) >= 18) {
7+
return;
8+
}
9+
510
// prettier-ignore
611
webpack(
712
{
@@ -13,7 +18,7 @@ webpack(
1318
target: 'node',
1419
mode: 'development',
1520
},
16-
function(err, stats) {
21+
function (err, stats) {
1722
if (err) {
1823
console.error(err.stack || err);
1924
if (err.details) {

0 commit comments

Comments
 (0)