@@ -59,10 +59,26 @@ jobs:
5959 node-version : ${{ matrix.node-version }}
6060 cache : ' pnpm'
6161
62+ # Special handling for Node.js 18: use Node.js 20 for tsgo dependency installation
63+ - name : Setup Node.js 20 for dependency installation (Node 18 only)
64+ if : steps.changes.outputs.changed == 'true' && matrix.node-version == 18
65+ uses : actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
66+ with :
67+ node-version : 20
68+ cache : ' pnpm'
69+
6270 - name : Install Dependencies
6371 if : steps.changes.outputs.changed == 'true'
6472 run : pnpm install
6573
74+ # Switch back to Node.js 18 after dependency installation
75+ - name : Switch back to Node.js ${{ matrix.node-version }} (Node 18 only)
76+ if : steps.changes.outputs.changed == 'true' && matrix.node-version == 18
77+ uses : actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
78+ with :
79+ node-version : ${{ matrix.node-version }}
80+ cache : ' pnpm'
81+
6682 - name : Type Check
6783 if : steps.changes.outputs.changed == 'true'
6884 run : pnpm run type-check
@@ -117,10 +133,26 @@ jobs:
117133 node-version : ${{ matrix.node-version }}
118134 cache : ' pnpm'
119135
136+ # Special handling for Node.js 18: use Node.js 20 for tsgo dependency installation
137+ - name : Setup Node.js 20 for dependency installation (Node 18 only)
138+ if : steps.changes.outputs.changed == 'true' && matrix.node-version == 18
139+ uses : actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
140+ with :
141+ node-version : 20
142+ cache : ' pnpm'
143+
120144 - name : Install Dependencies
121145 if : steps.changes.outputs.changed == 'true'
122146 run : pnpm install && cd ./tests && pnpm playwright install chromium
123147
148+ # Switch back to Node.js 18 after dependency installation
149+ - name : Switch back to Node.js ${{ matrix.node-version }} (Node 18 only)
150+ if : steps.changes.outputs.changed == 'true' && matrix.node-version == 18
151+ uses : actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
152+ with :
153+ node-version : ${{ matrix.node-version }}
154+ cache : ' pnpm'
155+
124156 - name : Integration Test (Rstest)
125157 if : steps.changes.outputs.changed == 'true'
126158 run : pnpm run test:integration
0 commit comments