name: CI
on:
  - push
  - pull_request
jobs:
  test:
    name: Node.js ${{ matrix.node-version }} on ${{ matrix.os }} with stylelint ${{ matrix.stylelint-version }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        node-version:
          - 18
          - 16
          - 14
          - 12
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest
        stylelint-version:
          - 14
          - 13
          - 12
          - 11
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - env:
          STYLELINT_VERSION: ${{ matrix.stylelint-version}}
        run: npm install --no-save "stylelint@${STYLELINT_VERSION}"
      - run: npm test
