|
1 | 1 | name: CI |
2 | | -on: [push, pull_request] |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [master] |
| 5 | + pull_request: |
3 | 6 | defaults: |
4 | 7 | run: |
5 | 8 | working-directory: ./packages/toolkit |
@@ -70,18 +73,12 @@ jobs: |
70 | 73 | matrix: |
71 | 74 | node: ['24.x'] |
72 | 75 | react: |
73 | | - [ |
74 | | - { |
75 | | - version: '^18', |
76 | | - types: ^18, |
77 | | - react-dom: { version: '^18', types: '^18' }, |
78 | | - }, |
79 | | - { |
80 | | - version: '^19', |
81 | | - types: '^19', |
82 | | - react-dom: { version: '^19', types: '^19' }, |
83 | | - }, |
84 | | - ] |
| 76 | + - version: '^18' |
| 77 | + types: '^18' |
| 78 | + react-dom: { version: '^18', types: '^18' } |
| 79 | + - version: '^19' |
| 80 | + types: '^19' |
| 81 | + react-dom: { version: '^19', types: '^19' } |
85 | 82 |
|
86 | 83 | steps: |
87 | 84 | - name: Checkout repo |
@@ -137,21 +134,90 @@ jobs: |
137 | 134 | strategy: |
138 | 135 | fail-fast: false |
139 | 136 | matrix: |
140 | | - node: ['24.x'] |
141 | | - ts: ['5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8'] |
142 | | - react: |
143 | | - [ |
144 | | - { |
145 | | - version: '^18', |
146 | | - types: ^18, |
147 | | - react-dom: { version: '^18', types: '^18' }, |
148 | | - }, |
149 | | - { |
150 | | - version: '^19', |
151 | | - types: '^19', |
152 | | - react-dom: { version: '^19', types: '^19' }, |
153 | | - }, |
154 | | - ] |
| 137 | + # Sparse matrix: All TS versions with React 19, boundary TS versions with React 18 |
| 138 | + include: |
| 139 | + # React 19 × all TS versions |
| 140 | + - node: '24.x' |
| 141 | + ts: '5.4' |
| 142 | + react: |
| 143 | + { |
| 144 | + version: '^19', |
| 145 | + types: '^19', |
| 146 | + react-dom: { version: '^19', types: '^19' }, |
| 147 | + } |
| 148 | + - node: '24.x' |
| 149 | + ts: '5.5' |
| 150 | + react: |
| 151 | + { |
| 152 | + version: '^19', |
| 153 | + types: '^19', |
| 154 | + react-dom: { version: '^19', types: '^19' }, |
| 155 | + } |
| 156 | + - node: '24.x' |
| 157 | + ts: '5.6' |
| 158 | + react: |
| 159 | + { |
| 160 | + version: '^19', |
| 161 | + types: '^19', |
| 162 | + react-dom: { version: '^19', types: '^19' }, |
| 163 | + } |
| 164 | + - node: '24.x' |
| 165 | + ts: '5.7' |
| 166 | + react: |
| 167 | + { |
| 168 | + version: '^19', |
| 169 | + types: '^19', |
| 170 | + react-dom: { version: '^19', types: '^19' }, |
| 171 | + } |
| 172 | + - node: '24.x' |
| 173 | + ts: '5.8' |
| 174 | + react: |
| 175 | + { |
| 176 | + version: '^19', |
| 177 | + types: '^19', |
| 178 | + react-dom: { version: '^19', types: '^19' }, |
| 179 | + } |
| 180 | + - node: '24.x' |
| 181 | + ts: '5.9' |
| 182 | + react: |
| 183 | + { |
| 184 | + version: '^19', |
| 185 | + types: '^19', |
| 186 | + react-dom: { version: '^19', types: '^19' }, |
| 187 | + } |
| 188 | + - node: '24.x' |
| 189 | + ts: 'next' |
| 190 | + react: |
| 191 | + { |
| 192 | + version: '^19', |
| 193 | + types: '^19', |
| 194 | + react-dom: { version: '^19', types: '^19' }, |
| 195 | + } |
| 196 | + # React 18 × boundary TS versions only (5.4, 5.9, next) |
| 197 | + - node: '24.x' |
| 198 | + ts: '5.4' |
| 199 | + react: |
| 200 | + { |
| 201 | + version: '^18', |
| 202 | + types: '^18', |
| 203 | + react-dom: { version: '^18', types: '^18' }, |
| 204 | + } |
| 205 | + - node: '24.x' |
| 206 | + ts: '5.9' |
| 207 | + react: |
| 208 | + { |
| 209 | + version: '^18', |
| 210 | + types: '^18', |
| 211 | + react-dom: { version: '^18', types: '^18' }, |
| 212 | + } |
| 213 | + - node: '24.x' |
| 214 | + ts: 'next' |
| 215 | + react: |
| 216 | + { |
| 217 | + version: '^18', |
| 218 | + types: '^18', |
| 219 | + react-dom: { version: '^18', types: '^18' }, |
| 220 | + } |
155 | 221 |
|
156 | 222 | steps: |
157 | 223 | - name: Checkout repo |
@@ -186,13 +252,22 @@ jobs: |
186 | 252 | - name: Erase path aliases |
187 | 253 | run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json |
188 | 254 |
|
189 | | - - name: Test types |
| 255 | + - name: Test types (TS 5.x) |
| 256 | + if: matrix.ts != 'next' && !startsWith(matrix.ts, '6.') |
190 | 257 | env: |
191 | 258 | TEST_DIST: true |
192 | 259 | run: | |
193 | 260 | yarn tsc --version |
194 | 261 | yarn type-tests |
195 | 262 |
|
| 263 | + - name: Test types (TS 6.x/next) |
| 264 | + if: matrix.ts == 'next' || startsWith(matrix.ts, '6.') |
| 265 | + env: |
| 266 | + TEST_DIST: true |
| 267 | + run: | |
| 268 | + yarn tsc --version |
| 269 | + yarn tsc -p tsconfig.test.json --noEmit --ignoreDeprecations 6.0 |
| 270 | +
|
196 | 271 | test-published-artifact: |
197 | 272 | name: Test Published Artifact ${{ matrix.example }} |
198 | 273 |
|
@@ -304,14 +379,50 @@ jobs: |
304 | 379 | strategy: |
305 | 380 | fail-fast: false |
306 | 381 | matrix: |
307 | | - node: ['24.x'] |
308 | | - ts: ['5.3', '5.4', '5.5', '5.6', '5.7', '5.8', '5.9', 'next'] |
309 | | - example: |
310 | | - [ |
311 | | - { name: 'bundler', moduleResolution: 'Bundler' }, |
312 | | - { name: 'nodenext-cjs', moduleResolution: 'NodeNext' }, |
313 | | - { name: 'nodenext-esm', moduleResolution: 'NodeNext' }, |
314 | | - ] |
| 382 | + # Sparse matrix: All TS versions with bundler, boundary TS versions with nodenext |
| 383 | + include: |
| 384 | + # bundler × all TS versions |
| 385 | + - node: '24.x' |
| 386 | + ts: '5.4' |
| 387 | + example: { name: 'bundler', moduleResolution: 'Bundler' } |
| 388 | + - node: '24.x' |
| 389 | + ts: '5.5' |
| 390 | + example: { name: 'bundler', moduleResolution: 'Bundler' } |
| 391 | + - node: '24.x' |
| 392 | + ts: '5.6' |
| 393 | + example: { name: 'bundler', moduleResolution: 'Bundler' } |
| 394 | + - node: '24.x' |
| 395 | + ts: '5.7' |
| 396 | + example: { name: 'bundler', moduleResolution: 'Bundler' } |
| 397 | + - node: '24.x' |
| 398 | + ts: '5.8' |
| 399 | + example: { name: 'bundler', moduleResolution: 'Bundler' } |
| 400 | + - node: '24.x' |
| 401 | + ts: '5.9' |
| 402 | + example: { name: 'bundler', moduleResolution: 'Bundler' } |
| 403 | + - node: '24.x' |
| 404 | + ts: 'next' |
| 405 | + example: { name: 'bundler', moduleResolution: 'Bundler' } |
| 406 | + # nodenext-cjs × boundary TS versions only (5.4, 5.9, next) |
| 407 | + - node: '24.x' |
| 408 | + ts: '5.4' |
| 409 | + example: { name: 'nodenext-cjs', moduleResolution: 'NodeNext' } |
| 410 | + - node: '24.x' |
| 411 | + ts: '5.9' |
| 412 | + example: { name: 'nodenext-cjs', moduleResolution: 'NodeNext' } |
| 413 | + - node: '24.x' |
| 414 | + ts: 'next' |
| 415 | + example: { name: 'nodenext-cjs', moduleResolution: 'NodeNext' } |
| 416 | + # nodenext-esm × boundary TS versions only (5.4, 5.9, next) |
| 417 | + - node: '24.x' |
| 418 | + ts: '5.4' |
| 419 | + example: { name: 'nodenext-esm', moduleResolution: 'NodeNext' } |
| 420 | + - node: '24.x' |
| 421 | + ts: '5.9' |
| 422 | + example: { name: 'nodenext-esm', moduleResolution: 'NodeNext' } |
| 423 | + - node: '24.x' |
| 424 | + ts: 'next' |
| 425 | + example: { name: 'nodenext-esm', moduleResolution: 'NodeNext' } |
315 | 426 | steps: |
316 | 427 | - name: Checkout repo |
317 | 428 | uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 |
@@ -348,3 +459,58 @@ jobs: |
348 | 459 | run: | |
349 | 460 | npm --workspace=@examples-type-portability/${{ matrix.example.name }} pkg set type=module |
350 | 461 | yarn workspace @examples-type-portability/${{ matrix.example.name }} run test --module ESNext --moduleResolution Node10 --preserveSymLinks --verbatimModuleSyntax false |
| 462 | +
|
| 463 | + test-types-native-preview: |
| 464 | + if: false # Disabled pending TS 7.0 compatibility fixes |
| 465 | + name: 'Test Types: TypeScript Native Preview' |
| 466 | + needs: [build] |
| 467 | + runs-on: ubuntu-latest |
| 468 | + continue-on-error: true |
| 469 | + strategy: |
| 470 | + matrix: |
| 471 | + node: ['24.x'] |
| 472 | + steps: |
| 473 | + - name: Checkout repo |
| 474 | + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 |
| 475 | + |
| 476 | + - name: Use node ${{ matrix.node }} |
| 477 | + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 |
| 478 | + with: |
| 479 | + node-version: ${{ matrix.node }} |
| 480 | + cache: 'yarn' |
| 481 | + |
| 482 | + - name: Install deps |
| 483 | + run: yarn install |
| 484 | + |
| 485 | + - name: Install TypeScript Native Preview |
| 486 | + run: yarn add @typescript/native-preview |
| 487 | + |
| 488 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 |
| 489 | + with: |
| 490 | + name: package |
| 491 | + path: packages/toolkit |
| 492 | + |
| 493 | + - name: Install build artifact |
| 494 | + run: yarn add ./package.tgz |
| 495 | + |
| 496 | + - name: Show installed RTK versions |
| 497 | + run: yarn info @reduxjs/toolkit |
| 498 | + |
| 499 | + - name: Erase path aliases |
| 500 | + run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json |
| 501 | + |
| 502 | + - name: Test types with tsgo |
| 503 | + env: |
| 504 | + TEST_DIST: true |
| 505 | + run: | |
| 506 | + yarn tsgo --version |
| 507 | + yarn tsgo -p tsconfig.test.json --noEmit --moduleResolution Bundler |
| 508 | +
|
| 509 | + - name: Install build artifact for type-portability example |
| 510 | + run: yarn workspace @examples-type-portability/bundler add $(pwd)/package.tgz |
| 511 | + |
| 512 | + - name: Install TypeScript Native Preview for type-portability example |
| 513 | + run: yarn workspace @examples-type-portability/bundler add -D @typescript/native-preview |
| 514 | + |
| 515 | + - name: Test type portability with tsgo (bundler example) |
| 516 | + run: yarn workspace @examples-type-portability/bundler exec tsgo --noEmit |
0 commit comments