name: CI on: pull_request: push: branches: [main] # Cancel superseded runs on the same branch so the latest commit's CI always # represents the head, and PR queues don't pile up on rapid pushes. concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: check: name: Lint, type-check, test runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v4 # Pin pnpm to the same major as `packageManager` in root package.json. # We intentionally don't use corepack auto-detect here — explicit # versions are more reproducible and the lockfile is pinned to 9.x. - name: Set up pnpm uses: pnpm/action-setup@v4 with: version: 9 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 20 # `setup-node`'s built-in pnpm cache key is keyed off # `pnpm-lock.yaml`, so we don't need a separate `actions/cache` # block. See https://github.com/actions/setup-node#caching-global-packages-data. cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile - name: Lint run: pnpm lint - name: Type-check run: pnpm type-check - name: Test run: pnpm test