name: Test
on:
  push:
    branches:
      - main
  pull_request:
permissions:
  contents: read
jobs:
  full:
    name: Node.js Latest Full
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - name: Install pnpm
        uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
        with:
          version: 10
      - name: Install Node.js
        uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
        with:
          node-version: 25
          cache: pnpm
      - name: Install dependencies
        run: pnpm install --ignore-scripts
      - name: Run tests
        run: pnpm test
  short:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version:
          - 24
          - 22
          - 20
          - 18
    name: Node.js ${{ matrix.node-version }} Quick
    steps:
      - name: Checkout the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - name: Install pnpm
        uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
        with:
          version: 10
      - name: Install Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
        with:
          node-version: ${{ matrix.node-version }}
          cache: pnpm
      - name: Install dependencies
        run: pnpm install --ignore-scripts
      - name: Run unit tests
        run: pnpm run unit
  old:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version:
          - 16
          - 14
          - 12
          - 10
    name: Node.js ${{ matrix.node-version }} Quick
    steps:
      - name: Checkout the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - name: Install pnpm
        uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
        with:
          version: 3
        env:
          ACTIONS_ALLOW_UNSECURE_COMMANDS: true
      - name: Install Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
        with:
          node-version: ${{ matrix.node-version }}
      - name: Install dependencies
        run: pnpm install --ignore-scripts
      - name: Downgrade TypeScript
        run: pnpm install typescript@4
      - name: Run unit tests
        run: pnpm run old
  windows:
    runs-on: windows-latest
    name: Windows Quick
    steps:
      - name: Checkout the repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - name: Install pnpm
        uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
        with:
          version: 10
      - name: Install Node.js LTS
        uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
        with:
          node-version: 24
          cache: pnpm
      - name: Install dependencies
        run: pnpm install --ignore-scripts
      - name: Run unit tests
        run: pnpm run unit
