name: CI
on:
  - push
  - pull_request

permissions:
  contents: read

jobs:
  test:
    name: Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        node-version:
          - 20
          - 22
          - 23
          - 24
          - 25
        os:
          - ubuntu-latest
    env:
      API_KEY: 123abc
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - run: npm test
      - uses: qltysh/qlty-action/coverage@v2
        with:
          token: ${{secrets.QLTY_COVERAGE_TOKEN}}
          files: coverage/lcov.info
