name: Test
on: [push, pull_request]
jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
        node: [20, 22, 24]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node }}
      - name: Install system deps (Ubuntu)
        if: runner.os == 'Linux'
        run: sudo apt-get install -y graphicsmagick imagemagick ghostscript
      - name: Install system deps (macOS)
        if: runner.os == 'macOS'
        run: brew install graphicsmagick imagemagick ghostscript
      - run: npm ci
      - run: npm run lint
      - run: npm test
      - run: npm run test-ts
