1616 runs-on : ubuntu-latest
1717 outputs :
1818 matrix : ${{ steps.set-matrix.outputs.matrix }}
19+ os : ${{ steps.set-matrix.outputs.os }}
1920 steps :
2021 - name : Check PR labels
2122 if : github.event_name == 'pull_request'
@@ -28,25 +29,42 @@ jobs:
2829 repo: context.repo.repo,
2930 issue_number: context.payload.pull_request.number,
3031 });
31- const shouldTestAllVersions = labels.some(label => label.name === 'autorelease: pending' || label.name === 'test all versions');
32- if (shouldTestAllVersions) {
33- return 'all'
32+
33+ const runOnWindows = labels.some(label => label.name === 'test on windows');
34+
35+ let versionsToTest = 'latest';
36+ if (labels.some(label => label.name === 'autorelease: pending' || label.name === 'test all versions')) {
37+ versionsToTest = 'all';
38+ } else if (labels.some(label => label.name === 'test latest and canary')) {
39+ versionsToTest = 'latest-and-canary';
3440 }
3541
36- return labels.some(label => label.name === 'test latest and canary') ? 'latest-and-canary' : 'latest'
42+ return {
43+ versionsToTest,
44+ runOnWindows
45+ }
3746 - name : Set Next.js versions to test
3847 id : set-matrix
39- # If this is the nightly build or a release PR then run the full matrix of versions
40- run : |
41- if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
42- echo "matrix=${{ github.event.inputs.versions }}" >> $GITHUB_OUTPUT
43- elif [ "${{ github.event_name }}" = "schedule" ] || [ "${{ steps.check-labels.outputs.result }}" = "all" ]; then
44- echo "matrix=[\"latest\", \"canary\", \"14.2.15\", \"13.5.1\"]" >> $GITHUB_OUTPUT
45- elif [ "${{ steps.check-labels.outputs.result }}" = "latest-and-canary" ]; then
46- echo "matrix=[\"latest\", \"canary\"]" >> $GITHUB_OUTPUT
47- else
48- echo "matrix=[\"latest\"]" >> $GITHUB_OUTPUT
49- fi
48+ uses : actions/github-script@v8
49+ with :
50+ script : |
51+ const { versionsToTest, runOnWindows } = ${{ steps.check-labels.outputs.result }} ?? {}
52+
53+ if ('${{ github.event_name }}' === 'workflow_dispatch') {
54+ core.setOutput('matrix', '${{ github.event.inputs.versions }}');
55+ } else if ('${{ github.event_name }}' === 'schedule' || versionsToTest === 'all') {
56+ core.setOutput('matrix', '["latest", "canary", "15.5.9", "14.2.35", "13.5.1"]');
57+ } else if (versionsToTest === 'latest-and-canary') {
58+ core.setOutput('matrix', '["latest", "canary"]');
59+ } else {
60+ core.setOutput('matrix', '["latest"]');
61+ }
62+
63+ if (runOnWindows) {
64+ core.setOutput('os', '["ubuntu-latest", "windows-2025"]');
65+ } else {
66+ core.setOutput('os', '["ubuntu-latest"]');
67+ }
5068
5169 e2e :
5270 needs : setup
@@ -122,7 +140,7 @@ jobs:
122140 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
123141 NEXT_VERSION : ${{ matrix.version }}
124142 NEXT_RESOLVED_VERSION : ${{ steps.resolve-next-version.outputs.version }}
125- NODE_OPTIONS : --import ${{ github.workspace }}/tools/fetch-retry.mjs
143+ NODE_OPTIONS : --import file:// ${{ github.workspace }}/tools/fetch-retry.mjs
126144 - name : Upload blob report to GitHub Actions Artifacts
127145 uses : actions/upload-artifact@v5
128146 if : always()
@@ -137,13 +155,16 @@ jobs:
137155 fail-fast : false
138156 matrix :
139157 shard : [1, 2, 3, 4, 5, 6, 7, 8]
140- os : [ubuntu-latest]
158+ os : ${{ fromJson(needs.setup.outputs.os) }}
141159 version : ${{ fromJson(needs.setup.outputs.matrix) }}
142160 exclude :
143161 - os : windows-2025
144162 version : " 13.5.1"
145163 - os : windows-2025
146- version : " 14.2.15"
164+ version : " 14.2.35"
165+ - os : windows-2025
166+ version : " 15.5.9"
167+
147168 runs-on : ${{ matrix.os }}
148169 steps :
149170 - uses : actions/checkout@v6
@@ -171,17 +192,8 @@ jobs:
171192 node-version : ${{ steps.decide-node-version.outputs.version }}
172193 cache : " npm"
173194 cache-dependency-path : " **/package-lock.json"
174- - name : Prefer npm global on windows
175- if : runner.os == 'Windows'
176- # On Windows by default PATH prefers corepack bundled with Node.js
177- # This prepends npm global to PATH to ensure that npm installed global corepack is used instead
178- run : |
179- echo "$(npm config get prefix)" >> "$GITHUB_PATH"
180- shell : bash
181195 - name : setup pnpm/yarn
182196 run : |
183- # global corepack installation requires --force on Windows, otherwise EEXIST errors occur
184- npm install -g corepack --force
185197 corepack enable
186198 shell : bash
187199 - name : Install Deno
@@ -217,15 +229,15 @@ jobs:
217229 env :
218230 NEXT_VERSION : ${{ matrix.version }}
219231 NEXT_RESOLVED_VERSION : ${{ steps.resolve-next-version.outputs.version }}
220- NODE_OPTIONS : --import ${{ github.workspace }}/tools/fetch-retry.mjs
232+ NODE_OPTIONS : --import file:// ${{ github.workspace }}/tools/fetch-retry.mjs
221233 - name : " Unit and integration tests"
222234 run : npm run test:ci:unit-and-integration -- --shard=${{ matrix.shard }}/8
223235 env :
224236 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
225237 NEXT_VERSION : ${{ matrix.version }}
226238 NEXT_RESOLVED_VERSION : ${{ steps.resolve-next-version.outputs.version }}
227239 TEMP : ${{ github.workspace }}/..
228- NODE_OPTIONS : --import ${{ github.workspace }}/tools/fetch-retry.mjs
240+ NODE_OPTIONS : --import file:// ${{ github.workspace }}/tools/fetch-retry.mjs
229241
230242 smoke :
231243 if : always()
@@ -286,7 +298,7 @@ jobs:
286298 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
287299 NEXT_VERSION : ${{ matrix.version }}
288300 NEXT_RESOLVED_VERSION : ${{ steps.resolve-next-version.outputs.version }}
289- NODE_OPTIONS : --import ${{ github.workspace }}/tools/fetch-retry.mjs
301+ NODE_OPTIONS : --import file:// ${{ github.workspace }}/tools/fetch-retry.mjs
290302
291303 merge-reports :
292304 if : always()
0 commit comments