Compatibility #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Compatibility | |
| on: | |
| schedule: | |
| - cron: "0 14 * * 1" | |
| workflow_dispatch: | |
| inputs: | |
| next_version: | |
| description: Next.js version or dist-tag | |
| required: false | |
| default: latest | |
| react_version: | |
| description: React and react-dom version or dist-tag | |
| required: false | |
| default: latest | |
| react_dom_version: | |
| description: Optional react-dom override | |
| required: false | |
| default: "" | |
| types_react_version: | |
| description: Optional @types/react override | |
| required: false | |
| default: latest | |
| types_react_dom_version: | |
| description: Optional @types/react-dom override | |
| required: false | |
| default: latest | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: compatibility-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| latest-stack: | |
| name: Latest React / Next Stack | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| NEXT_VERSION: ${{ github.event.inputs.next_version || 'latest' }} | |
| REACT_VERSION: ${{ github.event.inputs.react_version || 'latest' }} | |
| REACT_DOM_VERSION: ${{ github.event.inputs.react_dom_version || '' }} | |
| TYPES_REACT_VERSION: ${{ github.event.inputs.types_react_version || 'latest' }} | |
| TYPES_REACT_DOM_VERSION: ${{ github.event.inputs.types_react_dom_version || 'latest' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v3 | |
| with: | |
| version: 10.12.1 | |
| run_install: false | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install workspace dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Cache Playwright browsers | |
| id: pw-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('packages/core/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| - name: Install Playwright browsers (if cache miss) | |
| if: steps.pw-cache.outputs.cache-hit != 'true' | |
| run: pnpm --filter @react-zero-ui/core exec playwright install --with-deps | |
| - name: Rewrite fixture versions | |
| run: node scripts/set-compat-fixture-versions.mjs | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Run Build | |
| run: pnpm build | |
| - name: Run Prepack | |
| run: pnpm prepack:core | |
| - name: Install packed core into fixtures | |
| run: | | |
| TARBALL="$(pwd)/$(ls -t dist/*.tgz | head -n1)" | |
| pnpm --dir packages/core/__tests__/fixtures/next add "$TARBALL" | |
| pnpm --dir packages/core/__tests__/fixtures/next install --no-frozen-lockfile | |
| pnpm --dir packages/core/__tests__/fixtures/vite add "$TARBALL" | |
| pnpm --dir packages/core/__tests__/fixtures/vite install --no-frozen-lockfile | |
| - name: Run Vite tests | |
| run: pnpm test:vite | |
| - name: Run Next.js tests | |
| run: pnpm test:next | |
| - name: Run unit tests | |
| run: pnpm test:unit | |
| - name: Run CLI tests | |
| run: pnpm test:cli | |
| - name: Run integration tests | |
| run: pnpm test:integration |