name: test-javascript

permissions: {}

on:
  push:
    branches:
      - main
      - renovate/**
  pull_request:
    branches:
      - main

jobs:
  test-javascript:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
        node-version: ["22.x", "24.x", "26.x"]
        include:
          - os: windows-latest
            node-version: "22.x"
          - os: macos-latest
            node-version: "22.x"

    steps:
      - name: set git core.autocrlf to 'input'
        run: git config --global core.autocrlf input

      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
        with:
          persist-credentials: false

      - name: with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
        uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
        with:
          node-version: ${{ matrix.node-version }}
          cache: "npm"
          cache-dependency-path: package-lock.json

      - run: npm --version

      - run: npm install-ci-test

      - run: npm run build

      - run: npm run lint
