name: Param builder NodeJS CI

on:
  push:
    paths:
      - 'nodejs/**'
  pull_request:
    paths:
      - 'nodejs/**'
  workflow_dispatch:  # Enables manual trigger

jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: nodejs/capi-param-builder
    strategy:
      matrix:
        node-version: [18.x, 20.x, 22.x, 24.x]

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v4
      with:
        node-version: ${{ matrix.node-version }}
    - name: Install dependencies
      run: npm install
    - name: Run tests
      run: npm test
