From d539f7723eee7f19511bf88bda0b16e413116ca5 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Wed, 27 Nov 2024 07:42:46 -0600 Subject: [PATCH] Add clang-tidy-review --- .clang-tidy | 9 ++ .github/workflows/clang-tidy-review.yml | 107 ++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 .clang-tidy create mode 100644 .github/workflows/clang-tidy-review.yml diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 00000000..6b7191fd --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,9 @@ +Checks: + - '-*' + - 'bugprone-*' + - 'clang-analyzer-*' + - 'cppcoreguidelines-*' + - 'misc-*','modernize-*' + - 'performance-*' + - '-misc-include-cleaner' +FormatStyle: 'file' diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml new file mode 100644 index 00000000..e76ab6dc --- /dev/null +++ b/.github/workflows/clang-tidy-review.yml @@ -0,0 +1,107 @@ +name: clang-tidy-review + +on: + pull_request: + branches: + - 'develop' + +concurrency: + # Cancel in-progress jobs for the same pull request + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + strategy: + matrix: + include: + - name: linux64_clang + os: ubuntu-24.04 + build_type: Release + qt_version: 6.8.0 + qt_arch_aqt: linux_gcc_64 + qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport + qt_tools: '' + conan_arch: x86_64 + conan_compiler: gcc + conan_compiler_version: 14 + conan_compiler_libcxx: --settings compiler.libcxx=libstdc++ + conan_compiler_runtime: '' + conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True + compiler_packages: clang-17 + runs-on: ${{ matrix.os }} + steps: + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: ${{ matrix.qt_version }} + arch: ${{ matrix.qt_arch_aqt }} + modules: ${{ matrix.qt_modules }} + tools: ${{ matrix.qt_tools }} + + - name: Setup Ubuntu Environment + if: ${{ startsWith(matrix.os, 'ubuntu') }} + shell: bash + run: | + sudo apt-get install doxygen \ + libfuse2 \ + ninja-build \ + ${{ matrix.compiler_packages }} + + - name: Setup Python Environment + shell: pwsh + run: | + pip install geopandas ` + GitPython + + - name: Install Conan Packages + shell: pwsh + run: | + pip install "conan<2.0" + conan profile new default --detect + conan install ./ ` + --remote conancenter ` + --build missing ` + --settings arch=${{ matrix.conan_arch }} ` + --settings build_type=${{ matrix.build_type }} ` + --settings compiler="${{ matrix.conan_compiler }}" ` + --settings compiler.version=${{ matrix.conan_compiler_version }} ` + ${{ matrix.conan_compiler_libcxx }} ` + ${{ matrix.conan_compiler_runtime }} ` + ${{ matrix.conan_package_manager }} + + - name: Autogenerate + shell: pwsh + run: | + mkdir build + cd build + cmake ../ ` + -G Ninja ` + -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" ` + -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx" ` + -DCMAKE_EXPORT_COMPILE_COMMANDS=on + ninja scwx-qt_generate_counties_db ` + scwx-qt_generate_versions ` + scwx-qt_update_radar_sites ` + scwx-qt_autogen + + - name: Review + id: review + uses: ZedThree/clang-tidy-review@v0.14.0 + with: + config_file: .clang-tidy + build_dir: build + lgtm_comment_body: '' + + - name: Upload Review + uses: ZedThree/clang-tidy-review/upload@v0.20.1 + + - name: Status Check + if: steps.review.outputs.total_comments > 0 + run: exit 1