name: Coverity Scan fixes branch on a weekly basis

on:
  workflow_dispatch:
  schedule:
    - cron: "7 3 * * 3"

jobs:
  coverity:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6
      with:
        ref: fixes

    - name: Dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y \
            docbook-xsl \
            lcov \
            libc-ares-dev \
            libcjson-dev \
            libcjson1 \
            libcunit1-dev \
            libedit-dev \
            libmicrohttpd-dev \
            libssl-dev \
            libwrap0-dev \
            microsocks \
            python3-all \
            python3-paho-mqtt \
            python3-psutil \
            uthash-dev \
            xsltproc

    - uses: vapier/coverity-scan-action@v1
      with:
        build_language: 'cxx'
        project: "eclipse/mosquitto"
        token: ${{ secrets.COVERITY_SCAN_TOKEN }}
        email: ${{ secrets.COVERITY_SCAN_EMAIL }}
        command: "make binary-all"
