name: Node.js CI

on:
  push:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [22.x, 24.x, 26.x]

    steps:
      - uses: actions/checkout@v4
      - name: Enable Corepack
        run: npm install -g corepack@latest && corepack enable
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          cache: pnpm
      - name: Install dependencies
        run: pnpm install --frozen-lockfile
      - run: pnpm test
