name: Mosquitto - Make ASAN

on:
  push:
    branches:
      - master
      - develop
      - fixes
      - release/*
  pull_request:
    branches:
      - master
      - develop
      - fixes
      - release/*

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Install third party dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y \
          clang \
          docbook-xsl \
          lcov \
          libargon2-dev \
          libc-ares-dev \
          libcjson-dev \
          libcjson1 \
          libcunit1-dev \
          libedit-dev \
          libgmock-dev \
          libmicrohttpd-dev \
          libssl-dev \
          libwrap0-dev \
          microsocks \
          python3-all \
          python3-paho-mqtt \
          python3-psutil \
          uthash-dev \
          xsltproc
    -
      uses: actions/checkout@v6
      with:
        submodules: 'true'
    -
      name: make
      run: make WITH_ASAN=yes
    -
      name: make test
      run: |
        make WITH_ASAN=yes ptest
