ci: bump changesets/action from 1 to 2 #575
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: 'Tests' | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint-build: | |
| name: 'lint & build (Node ${{ matrix.node }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node: [22, 24, 26] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| cache: pnpm | |
| node-version: ${{ matrix.node }} | |
| - run: pnpm --version | |
| - run: pnpm install | |
| - run: pnpm lint | |
| - run: pnpm prettier:check | |
| - run: pnpm test:ts | |
| - run: pnpm build | |
| - uses: actions/upload-artifact@v7 | |
| name: Cache build output | |
| with: | |
| name: build-output-node-${{ matrix.node }} | |
| path: | | |
| bin/ | |
| dist/ | |
| # Satisfies branch protection that requires a check named "lint & build" | |
| lint-build-complete: | |
| name: lint & build | |
| needs: lint-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "Lint and build passed on all Node versions" | |
| test-unit: | |
| needs: 'lint-build' | |
| name: 'test:unit (${{ matrix.node }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| # A test failing on windows doesn't mean it'll fail on macos. It's useful to let all tests run to its completion to get the full picture | |
| fail-fast: false | |
| matrix: | |
| node: [22, 24, 26] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| cache: pnpm | |
| node-version: ${{ matrix.node }} | |
| - run: pnpm --version | |
| - run: pnpm install | |
| - uses: actions/download-artifact@v8 | |
| name: Restore build output | |
| with: | |
| name: build-output-node-${{ matrix.node }} | |
| # On Node < 24.9, Jest can't load pure-ESM deps (commander 15) via its normal | |
| # import, so we fall back to a native dynamic import that escapes Jest's per-file | |
| # environment. If a worker is reused across test files, a later file's import hits | |
| # the previous file's torn-down environment ("import after teardown"). Forcing one | |
| # worker per suite (we have 8) prevents reuse. Node 24/26 load ESM natively and | |
| # don't need this. | |
| - if: matrix.node == 22 | |
| run: pnpm test:unit --maxWorkers=8 | |
| - if: matrix.node != 22 | |
| run: pnpm test:unit |