name: Test

on: [push, pull_request]

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        # https://nodejs.org/en/about/releases/
        node: [20, 22, 24, 25]
    runs-on: ${{ matrix.os }}
    steps:
      # https://github.com/actions/checkout/issues/135
      - run: |
          git config --global core.autocrlf false
          git config --global core.eol lf
      # check out repo
      - uses: actions/checkout@v2
      # install node
      - uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node }}
      # install deps
      - run: npm install
      # lint project
      - run: npm run lint
      # try to install and test all engines
      - run: node src/bin.js --engines=all
