|
| 1 | +name: Compatibility matrix |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + schedule: |
| 9 | + - cron: '23 10 * * 1' |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: compatibility-matrix-${{ github.event.pull_request.number || github.ref }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + compatibility: |
| 21 | + if: github.event_name != 'schedule' |
| 22 | + name: ${{ matrix.label }} |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 30 |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + include: |
| 29 | + - label: React 19.0.4 / webpack 5.59.0 + rspack 1.x / Node 20 |
| 30 | + node-version: '20.x' |
| 31 | + react-version: '19.0.4' |
| 32 | + react-dom-version: '19.0.4' |
| 33 | + types-react-version: '19.0.4' |
| 34 | + types-react-dom-version: '19.0.4' |
| 35 | + webpack-version: '5.59.0' |
| 36 | + rspack-version: '1.x' |
| 37 | + node-options: --openssl-legacy-provider |
| 38 | + - label: React 19.0.4 / webpack latest 5.x + rspack 1.x / Node 22 |
| 39 | + node-version: '22.x' |
| 40 | + react-version: '19.0.4' |
| 41 | + react-dom-version: '19.0.4' |
| 42 | + types-react-version: '19.0.4' |
| 43 | + types-react-dom-version: '19.0.4' |
| 44 | + webpack-version: '^5.0.0' |
| 45 | + rspack-version: '1.x' |
| 46 | + - label: React 19.2.x / webpack 5.59.0 + rspack 1.x / Node 22 |
| 47 | + node-version: '22.x' |
| 48 | + react-version: '~19.2.0' |
| 49 | + react-dom-version: '~19.2.0' |
| 50 | + types-react-version: '~19.2.0' |
| 51 | + types-react-dom-version: '~19.2.0' |
| 52 | + webpack-version: '5.59.0' |
| 53 | + rspack-version: '1.x' |
| 54 | + node-options: --openssl-legacy-provider |
| 55 | + - label: React 19.2.x / webpack latest 5.x + rspack 1.x / Node 20 |
| 56 | + node-version: '20.x' |
| 57 | + react-version: '~19.2.0' |
| 58 | + react-dom-version: '~19.2.0' |
| 59 | + types-react-version: '~19.2.0' |
| 60 | + types-react-dom-version: '~19.2.0' |
| 61 | + webpack-version: '^5.0.0' |
| 62 | + rspack-version: '1.x' |
| 63 | + |
| 64 | + steps: |
| 65 | + # Pinned immutable actions/checkout@v5 release SHA verified via git ls-remote. |
| 66 | + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd |
| 67 | + - name: Use Node.js |
| 68 | + # Pinned immutable actions/setup-node@v4 release SHA verified via git ls-remote. |
| 69 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 |
| 70 | + with: |
| 71 | + node-version: ${{ matrix.node-version }} |
| 72 | + cache: yarn |
| 73 | + - name: Install matrix packages without changing yarn.lock |
| 74 | + env: |
| 75 | + COMPAT_LABEL: ${{ matrix.label }} |
| 76 | + COMPAT_REACT: ${{ matrix.react-version }} |
| 77 | + COMPAT_REACT_DOM: ${{ matrix.react-dom-version }} |
| 78 | + COMPAT_REACT_SERVER_DOM_WEBPACK: ${{ matrix.react-version }} |
| 79 | + COMPAT_TYPES_REACT: ${{ matrix.types-react-version }} |
| 80 | + COMPAT_TYPES_REACT_DOM: ${{ matrix.types-react-dom-version }} |
| 81 | + COMPAT_WEBPACK: ${{ matrix.webpack-version }} |
| 82 | + COMPAT_RSPACK: ${{ matrix.rspack-version }} |
| 83 | + run: node scripts/prepare-compatibility-install.cjs |
| 84 | + - name: Build package artifacts |
| 85 | + env: |
| 86 | + NODE_OPTIONS: ${{ matrix.node-options || '' }} |
| 87 | + run: yarn build |
| 88 | + - name: Run unit and integration tests |
| 89 | + env: |
| 90 | + NODE_OPTIONS: ${{ matrix.node-options || '' }} |
| 91 | + run: yarn test |
| 92 | + - name: Record matrix result |
| 93 | + if: always() |
| 94 | + run: | |
| 95 | + { |
| 96 | + echo "### Test command" |
| 97 | + echo |
| 98 | + echo "- Command: \`yarn build && yarn test\`" |
| 99 | + echo "- Result: \`${{ job.status }}\`" |
| 100 | + } >> "$GITHUB_STEP_SUMMARY" |
| 101 | +
|
| 102 | + canary: |
| 103 | + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' |
| 104 | + name: React canary signal |
| 105 | + runs-on: ubuntu-latest |
| 106 | + timeout-minutes: 30 |
| 107 | + continue-on-error: true |
| 108 | + steps: |
| 109 | + # Pinned immutable actions/checkout@v5 release SHA verified via git ls-remote. |
| 110 | + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd |
| 111 | + - name: Use Node.js |
| 112 | + # Pinned immutable actions/setup-node@v4 release SHA verified via git ls-remote. |
| 113 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 |
| 114 | + with: |
| 115 | + node-version: '22.x' |
| 116 | + cache: yarn |
| 117 | + - name: Install canary packages without changing yarn.lock |
| 118 | + env: |
| 119 | + COMPAT_LABEL: React canary / webpack latest 5.x / rspack latest 1.x / Node 22 |
| 120 | + COMPAT_REACT: canary |
| 121 | + COMPAT_REACT_DOM: canary |
| 122 | + COMPAT_REACT_SERVER_DOM_WEBPACK: canary |
| 123 | + COMPAT_WEBPACK: '^5.0.0' |
| 124 | + COMPAT_RSPACK: 1.x |
| 125 | + # COMPAT_TYPES_REACT / COMPAT_TYPES_REACT_DOM intentionally omitted: |
| 126 | + # canary @types packages are not reliably published; stable types remain. |
| 127 | + run: node scripts/prepare-compatibility-install.cjs |
| 128 | + - name: Build package artifacts |
| 129 | + run: yarn build |
| 130 | + - name: Run canary unit and integration tests |
| 131 | + run: yarn test |
| 132 | + - name: Record canary result |
| 133 | + if: always() |
| 134 | + run: | |
| 135 | + { |
| 136 | + echo "### Canary signal" |
| 137 | + echo |
| 138 | + echo "- Command: \`yarn test\`" |
| 139 | + echo "- Result: \`${{ job.status }}\`" |
| 140 | + echo "- This scheduled canary is signal-only; failures do not block required compatibility checks." |
| 141 | + } >> "$GITHUB_STEP_SUMMARY" |
0 commit comments