1- name : ' Run tests'
1+ name : " Run tests"
22on :
33 pull_request :
44 branches : [main]
55 schedule :
6- - cron : ' 0 6 * * *' # Run every day at 6am UTC
6+ - cron : " 0 6 * * *" # Run every day at 6am UTC
77 workflow_dispatch :
88 inputs :
99 versions :
10- description : ' The versions of Next.js to test against (quoted and comma separated)'
10+ description : " The versions of Next.js to test against (quoted and comma separated)"
1111 required : false
12- default : ' latest'
12+ default : " latest"
1313
1414jobs :
1515 setup :
@@ -59,25 +59,30 @@ jobs:
5959
6060 steps :
6161 - uses : actions/checkout@v5
62+ - name : Resolve Next.js version
63+ id : resolve-next-version
64+ shell : bash
65+ run : |
66+ RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
67+ echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
68+ echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
6269 - name : Decide Node Version
6370 id : decide-node-version
6471 shell : bash
6572 run : |
6673 NODE_VERSION=18.x
67- if [ "${{ matrix.version}}" = "canary" ]; then
68- # this is not ideal, because we set node@20 just when explicitly using canary tag as target
69- # but next@canary are still on 15 major, so we can't yet use major version of resolved next version
70- # as condition
74+ if [[ "${{ steps.resolve-next-version.outputs.version }}" == "16."* ]]; then
75+ # Next@16 requires Node.js 20+
7176 NODE_VERSION=20.x
7277 fi
7378 echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
74- echo "Node version for 'next@${{ matrix .version }}' is '$NODE_VERSION'"
75- - name : ' Install Node'
79+ echo "Node version for 'next@${{ steps.resolve-next-version.outputs .version }}' is '$NODE_VERSION'"
80+ - name : " Install Node"
7681 uses : actions/setup-node@v5
7782 with :
7883 node-version : ${{ steps.decide-node-version.outputs.version }}
79- cache : ' npm'
80- cache-dependency-path : ' **/package-lock.json'
84+ cache : " npm"
85+ cache-dependency-path : " **/package-lock.json"
8186 - uses : oven-sh/setup-bun@v2
8287 - name : setup pnpm/yarn
8388 run : |
8994 with :
9095 # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
9196 deno-version : v2.2.4
92- - name : ' Install dependencies'
97+ - name : " Install dependencies"
9398 run : npm ci
94- - name : ' Prepare Netlify CLI'
99+ - name : " Prepare Netlify CLI"
95100 env :
96101 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
97102 run : |
@@ -104,20 +109,13 @@ jobs:
104109 - uses : actions/cache@v4
105110 id : playwright-cache
106111 with :
107- path : ' ~/.cache/ms-playwright'
108- key : ' ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
112+ path : " ~/.cache/ms-playwright"
113+ key : " ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}"
109114 restore-keys : |
110115 ${{ runner.os }}-playwright-
111116 - name : Install Playwright Browsers
112117 if : steps.playwright-cache.outputs.cache-hit != 'true'
113118 run : npx playwright install --with-deps
114- - name : Resolve Next.js version
115- id : resolve-next-version
116- shell : bash
117- run : |
118- RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
119- echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
120- echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
121119 - name : Run Playwright tests
122120 run : npm run test:ci:e2e -- --shard=${{ matrix.shard }}/5
123121 env :
@@ -143,31 +141,36 @@ jobs:
143141 version : ${{ fromJson(needs.setup.outputs.matrix) }}
144142 exclude :
145143 - os : windows-2025
146- version : ' 13.5.1'
144+ version : " 13.5.1"
147145 - os : windows-2025
148- version : ' 14.2.15'
146+ version : " 14.2.15"
149147 runs-on : ${{ matrix.os }}
150148 steps :
151149 - uses : actions/checkout@v5
150+ - name : Resolve Next.js version
151+ id : resolve-next-version
152+ shell : bash
153+ run : |
154+ RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
155+ echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
156+ echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
152157 - name : Decide Node Version
153158 id : decide-node-version
154159 shell : bash
155160 run : |
156161 NODE_VERSION=18.x
157- if [ "${{ matrix.version}}" = "canary" ]; then
158- # this is not ideal, because we set node@20 just when explicitly using canary tag as target
159- # but next@canary are still on 15 major, so we can't yet use major version of resolved next version
160- # as condition
162+ if [[ "${{ steps.resolve-next-version.outputs.version }}" == "16."* ]]; then
163+ # Next@16 requires Node.js 20+
161164 NODE_VERSION=20.x
162165 fi
163166 echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
164167 echo "Node version for 'next@${{ matrix.version }}' is '$NODE_VERSION'"
165- - name : ' Install Node'
168+ - name : " Install Node"
166169 uses : actions/setup-node@v5
167170 with :
168171 node-version : ${{ steps.decide-node-version.outputs.version }}
169- cache : ' npm'
170- cache-dependency-path : ' **/package-lock.json'
172+ cache : " npm"
173+ cache-dependency-path : " **/package-lock.json"
171174 - name : Prefer npm global on windows
172175 if : runner.os == 'Windows'
173176 # On Windows by default PATH prefers corepack bundled with Node.js
@@ -186,19 +189,12 @@ jobs:
186189 with :
187190 # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/edge-bundler/blob/e55f825bd985d3c92e21d1b765d71e70d5628fba/node/bridge.ts#L17
188191 deno-version : v2.2.4
189- - name : ' Install dependencies'
192+ - name : " Install dependencies"
190193 run : npm ci
191- - name : ' Build'
194+ - name : " Build"
192195 run : npm run build
193- - name : ' Vendor deno helpers for integration tests'
196+ - name : " Vendor deno helpers for integration tests"
194197 run : node tools/vendor-deno-tools.js
195- - name : Resolve Next.js version
196- id : resolve-next-version
197- shell : bash
198- run : |
199- RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
200- echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
201- echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
202198 - name : Compute Fixtures Cache Key
203199 id : fixture-cache-key
204200 # Fixtures only need to be rebuilt if either fixture or support files change,
@@ -215,14 +211,14 @@ jobs:
215211 key :
216212 integration-fixtures-${{ runner.os }}-${{steps.resolve-next-version.outputs.version}}-${{
217213 steps.fixture-cache-key.outputs.key }}
218- - name : ' Prepare Fixtures'
214+ - name : " Prepare Fixtures"
219215 if : steps.cache-fixtures.outputs.cache-hit != 'true'
220216 run : npm run pretest
221217 env :
222218 NEXT_VERSION : ${{ matrix.version }}
223219 NEXT_RESOLVED_VERSION : ${{ steps.resolve-next-version.outputs.version }}
224220 NODE_OPTIONS : --import ${{ github.workspace }}/tools/fetch-retry.mjs
225- - name : ' Unit and integration tests'
221+ - name : " Unit and integration tests"
226222 run : npm run test:ci:unit-and-integration -- --shard=${{ matrix.shard }}/8
227223 env :
228224 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
@@ -241,25 +237,30 @@ jobs:
241237 version : ${{ fromJson(needs.setup.outputs.matrix) }}
242238 steps :
243239 - uses : actions/checkout@v5
240+ - name : Resolve Next.js version
241+ id : resolve-next-version
242+ shell : bash
243+ run : |
244+ RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
245+ echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
246+ echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
244247 - name : Decide Node Version
245248 id : decide-node-version
246249 shell : bash
247250 run : |
248251 NODE_VERSION=18.x
249- if [ "${{ matrix.version}}" = "canary" ]; then
250- # this is not ideal, because we set node@20 just when explicitly using canary tag as target
251- # but next@canary are still on 15 major, so we can't yet use major version of resolved next version
252- # as condition
252+ if [[ "${{ steps.resolve-next-version.outputs.version }}" == "16."* ]]; then
253+ # Next@16 requires Node.js 20+
253254 NODE_VERSION=20.x
254255 fi
255256 echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
256257 echo "Node version for 'next@${{ matrix.version }}' is '$NODE_VERSION'"
257- - name : ' Install Node'
258+ - name : " Install Node"
258259 uses : actions/setup-node@v5
259260 with :
260261 node-version : ${{ steps.decide-node-version.outputs.version }}
261- cache : ' npm'
262- cache-dependency-path : ' **/package-lock.json'
262+ cache : " npm"
263+ cache-dependency-path : " **/package-lock.json"
263264 - name : setup pnpm/yarn
264265 run : corepack enable
265266 shell : bash
@@ -268,25 +269,18 @@ jobs:
268269 with :
269270 # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
270271 deno-version : v2.2.4
271- - name : ' Install dependencies'
272+ - name : " Install dependencies"
272273 run : npm ci
273- - name : ' Build'
274+ - name : " Build"
274275 run : npm run build
275- - name : ' Prepare Netlify CLI'
276+ - name : " Prepare Netlify CLI"
276277 env :
277278 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
278279 run : |
279280 # Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
280281 npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
281282 npx netlify login
282- - name : Resolve Next.js version
283- id : resolve-next-version
284- shell : bash
285- run : |
286- RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
287- echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
288- echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
289- - name : ' Smoke tests'
283+ - name : " Smoke tests"
290284 run : npm run test:ci:smoke
291285 env :
292286 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
@@ -296,36 +290,36 @@ jobs:
296290
297291 merge-reports :
298292 if : always()
299- needs : [setup,e2e]
293+ needs : [setup, e2e]
300294 strategy :
301295 fail-fast : false
302296 matrix :
303297 version : ${{ fromJson(needs.setup.outputs.matrix) }}
304298
305299 runs-on : ubuntu-latest
306300 steps :
307- - uses : actions/checkout@v5
308- - uses : actions/setup-node@v5
309- with :
310- node-version : 18
311- - name : Install dependencies
312- run : npm ci
301+ - uses : actions/checkout@v5
302+ - uses : actions/setup-node@v5
303+ with :
304+ node-version : 18
305+ - name : Install dependencies
306+ run : npm ci
313307
314- - name : Download blob reports from GitHub Actions Artifacts
315- uses : actions/download-artifact@v5
316- with :
317- path : all-blob-reports
318- pattern : blob-report-${{ matrix.version }}-*
319- merge-multiple : true
308+ - name : Download blob reports from GitHub Actions Artifacts
309+ uses : actions/download-artifact@v5
310+ with :
311+ path : all-blob-reports
312+ pattern : blob-report-${{ matrix.version }}-*
313+ merge-multiple : true
320314
321- - name : Merge reports
322- run : |
323- npx playwright merge-reports --reporter html ./all-blob-reports
324- npx playwright merge-reports --reporter json ./all-blob-reports > merged_reports.json
315+ - name : Merge reports
316+ run : |
317+ npx playwright merge-reports --reporter html ./all-blob-reports
318+ npx playwright merge-reports --reporter json ./all-blob-reports > merged_reports.json
325319
326- - name : Upload HTML report
327- uses : actions/upload-artifact@v4
328- with :
329- name : html-report-${{ matrix.version }}-attempt-${{ github.run_attempt }}
330- path : playwright-report
331- retention-days : 14
320+ - name : Upload HTML report
321+ uses : actions/upload-artifact@v4
322+ with :
323+ name : html-report-${{ matrix.version }}-attempt-${{ github.run_attempt }}
324+ path : playwright-report
325+ retention-days : 14
0 commit comments