name: CI on: push: branches: [main] pull_request: branches: [main] concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: verify: name: Verify (Node ${{ matrix.node-version }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: # Node 20 reached EOL on 2026-04-30. 22.12 is the oldest supported line # and is engines.node — it is the floor that catches an ES2025 built-in # that the runtime does not actually have yet. node-version: ['22.12', '24.x', '26.x'] steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - uses: actions/setup-node@v5 with: node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - name: Build run: npm run build - name: Lint and format (Biome) run: npm run lint - name: Typecheck (TypeScript 6) run: npm run check:types - name: Validate published exports (attw) run: npm run check:exports - name: Test run: npm run test:coverage - name: Test against React's own createRoot (no Testing Library) run: npm run test:react-root - name: Verify built ESM + CJS entrypoints load run: npm run test:modules - name: Spellcheck docs run: npm run spellcheck - name: Fail if the build dirtied the tree run: git diff --exit-code - name: Publish coverage to codecov.io if: matrix.node-version == '26.x' uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} # React 19 is the only supported major, so there is no React install matrix # any more. This job still swaps React in for real rather than trusting the # lockfile, so a peer range that has drifted from what the code needs fails # here instead of in a consumer's install. react-install: name: Full suite on a fresh React 19 install runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: node-version: 26.x cache: npm - run: npm ci - name: Install the latest React 19 run: | npm install --no-save --workspace-root react@19 react-dom@19 node -e "console.log('react', require('react/package.json').version)" - run: npm run build - run: npm test - run: npm run test:react-root