name: Node CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        node-version: [20.x, 22.x, 24.x]

    steps:
    - uses: actions/checkout@v3

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}

    - name: npm install, build
      run: |
        npm ci
        npm run build --if-present
      env:
        CI: true

    - name: npm test
      run: |
        npm test
      env:
        CI: true
