Updated License on RPM Specs #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ───────────────────────────────────────────────────────────────────────────── | |
| # CXXGraph – Static Analysis | |
| # | |
| # Runs clang-tidy against the full source tree using the compile_commands.json | |
| # generated by CMake. Failures are reported as annotations on the diff. | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| name: Static Analysis | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CPM_SOURCE_CACHE: ~/.cache/cpm | |
| jobs: | |
| clang-tidy: | |
| name: "clang-tidy · Clang 18 · C++17" | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install Clang 18 + clang-tidy | |
| run: | | |
| sudo apt-get update -q | |
| wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 18 all | |
| sudo apt-get install -y --no-install-recommends \ | |
| clang-18 clang++-18 clang-tidy-18 | |
| sudo update-alternatives --install \ | |
| /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 100 | |
| - name: Install Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@v6 | |
| - name: Cache CPM packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/cpm | |
| key: cpm-ubuntu-tidy-${{ hashFiles('**/CMakeLists.txt') }} | |
| restore-keys: cpm-ubuntu-tidy- | |
| # Generate compile_commands.json (required by clang-tidy) | |
| - name: Configure CMake | |
| env: | |
| CC: clang-18 | |
| CXX: clang++-18 | |
| run: | | |
| cmake -B build \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DCMAKE_CXX_STANDARD=17 \ | |
| -DCMAKE_CXX_STANDARD_REQUIRED=ON \ | |
| -DCMAKE_CXX_EXTENSIONS=OFF \ | |
| -DTEST=ON \ | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| # Fetch all headers / generated files needed for analysis | |
| - name: Build (generate all headers) | |
| run: cmake --build build --parallel | |
| - name: Run clang-tidy | |
| run: | | |
| # Analyse only project headers – exclude vendored / generated paths | |
| find include/CXXGraph -name '*.hpp' -o -name '*.h' | \ | |
| xargs clang-tidy-18 \ | |
| -p build \ | |
| --warnings-as-errors='*' \ | |
| --extra-arg="-std=c++17" \ | |
| 2>&1 | tee clang-tidy-report.txt | |
| - name: Upload clang-tidy report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: clang-tidy-report | |
| path: clang-tidy-report.txt | |
| retention-days: 14 |