name: Node.js CI

on:
  push:
    branches: main
    paths-ignore:
      - 'CHANGELOG.md'
      - 'README.md'
  pull_request:
    branches: main
    paths-ignore:
      - 'CHANGELOG.md'
      - 'README.md'

jobs:
  release:
    strategy:
      fail-fast: false
      matrix:
        platform: [ ubuntu-latest, ubuntu-22.04, windows-latest, macos-13, macos-14 ]
    uses:
      ./.github/workflows/build.yml
    with:
      platform: ${{ matrix.platform }}


  debug:
    strategy:
      fail-fast: false
      matrix:
        platform: [ ubuntu-latest, macos-13 ]
    uses:
      ./.github/workflows/build.yml
    with:
      platform: ${{ matrix.platform }}
      debug: true


  lint:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v5
      with:
        fetch-depth: 0
        submodules: true
    - name: Use Node.js 18.x
      uses: actions/setup-node@v4
      with:
        node-version: 18.x
    - uses: actions/setup-python@v5
      with:
        python-version: "3.11"
    - run: npm install --ignore-scripts
    - run: npm install typescript
    - run: npm run lint


  asan:
    uses:
      ./.github/workflows/build.yml
    with:
      platform: ubuntu-22.04
      asan: true


  codecov:
    uses:
      ./.github/workflows/build.yml
    with:
      platform: ubuntu-22.04
      codecov: true
