name: Build and Lint

on: [push, pull_request]

jobs:
  build:

    strategy:
      matrix:
        node-version: [18.x, 20.x, 22.x]
        os: [ubuntu-latest]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }} 
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: npm install, lint, build and test
        run: |
          npm install
          npm run lint
          npm run build
          npm run test
        env:
          CI: true