Skip to content

Commit 42ed6d8

Browse files
committed
Refactor the MRT's node version
1 parent b6e961b commit 42ed6d8

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ env:
2828
DEVELOP: ${{ (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && (github.head_ref || github.ref_name) == 'develop' }}
2929
RELEASE: ${{ (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && startsWith(github.head_ref || github.ref_name, 'release-') }}
3030

31+
# The current recommended version for Managed Runtime:
32+
# https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-node-version.html
33+
MRT_NODE: 22
34+
MRT_NPM: 10
35+
3136
jobs:
3237
changelog-check:
3338
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
@@ -63,9 +68,7 @@ jobs:
6368
# For more: https://nodejs.org/en/download/releases/
6469
# (We also use this env var for making sure a step runs once for the current node version)
6570
IS_DEFAULT_NPM: ${{ (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
66-
# The current recommended version for Managed Runtime:
67-
# https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-node-version.html
68-
IS_MRT_NODE: ${{ matrix.node == 22 && matrix.npm == 10 }}
71+
IS_MRT_NODE: ${{ matrix.node == env.MRT_NODE && matrix.npm == MRT_NPM }}
6972
PROJECT_DIR: generated-retail-react-app-test-project
7073
steps:
7174
- name: Checkout
@@ -166,9 +169,7 @@ jobs:
166169
# (We also use this env var for making sure a step runs once for the current node version)
167170
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
168171
IS_DEFAULT_NPM: ${{ (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
169-
# The current recommended version for Managed Runtime:
170-
# https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-node-version.html
171-
IS_MRT_NODE: ${{ matrix.node == 22 && matrix.npm == 10 }}
172+
IS_MRT_NODE: ${{ matrix.node == env.MRT_NODE && matrix.npm == env.MRT_NPM }}
172173
steps:
173174
- name: Checkout
174175
uses: actions/checkout@v4
@@ -209,7 +210,7 @@ jobs:
209210
- name: Setup Node
210211
uses: actions/setup-node@v4
211212
with:
212-
node-version: 22
213+
node-version: ${{ env.MRT_NODE }}
213214

214215
- name: Setup Ubuntu Machine
215216
uses: "./.github/actions/setup_ubuntu"
@@ -309,7 +310,7 @@ jobs:
309310
- name: Setup Node
310311
uses: actions/setup-node@v4
311312
with:
312-
node-version: 22
313+
node-version: ${{ env.MRT_NODE }}
313314

314315
- name: Setup Windows Machine
315316
uses: "./.github/actions/setup_windows"
@@ -353,8 +354,6 @@ jobs:
353354
needs: changelog-check
354355
strategy:
355356
fail-fast: false
356-
matrix:
357-
node: [22] # Should match node version supported by MRT.
358357
runs-on: ubuntu-latest
359358
env:
360359
PROJECT_DIR: generated-retail-react-app-test-project
@@ -365,7 +364,7 @@ jobs:
365364
- name: Setup Node
366365
uses: actions/setup-node@v4
367366
with:
368-
node-version: ${{ matrix.node }}
367+
node-version: ${{ env.MRT_NODE }}
369368
cache: npm
370369

371370
- name: Setup Ubuntu Machine
@@ -389,8 +388,6 @@ jobs:
389388
# needs: changelog-check
390389
# strategy:
391390
# fail-fast: false
392-
# matrix:
393-
# node: [22] # Should match node version supported by MRT.
394391
# runs-on: ubuntu-latest
395392
# env:
396393
# PROJECT_DIR: generated-retail-react-app-test-project
@@ -403,7 +400,7 @@ jobs:
403400
# - name: Setup Node
404401
# uses: actions/setup-node@v4
405402
# with:
406-
# node-version: ${{ matrix.node }}
403+
# node-version: ${{ env.MRT_NODE }}
407404
# cache: npm
408405

409406
# - name: Setup Ubuntu Machine

0 commit comments

Comments
 (0)