name: clang-tidy-review
on:
  pull_request:
    branches: [ master, stable* ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    # Run clang-tidy
    - uses: akallabeth/clang-tidy-review@master
      id: review
      with:
        split_workflow: true
        clang_tidy_checks: ''
        apt_packages: devscripts,equivs
        install_commands: 'ln -s packaging/deb/freerdp-nightly debian; mk-build-deps -i -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y"'

        # CMake command to run in order to generate compile_commands.json
        build_dir: tidy
        cmake_command: cmake -Btidy -S. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -C ci/cmake-preloads/config-qa.cmake

    # Uploads an artefact containing clang_fixes.json
    - uses: akallabeth/clang-tidy-review/upload@master
      id: upload-review
