fix wrong string compare on python device repr #8
Workflow file for this run
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
| name: Clang-Tidy CI | |
| on: | |
| push: | |
| branches: ['**'] | |
| pull_request: | |
| branches: ['**'] | |
| jobs: | |
| clang-tidy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install clang tidy dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y clang clang-tidy cmake g++ ninja-build | |
| - name: Install SDK dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt-get install -qq build-essential xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev libglm-dev; | |
| sudo apt-get install -qq libusb-1.0-0-dev; | |
| sudo apt-get install -qq libgtk-3-dev; | |
| sudo apt-get install libglfw3-dev libglfw3; | |
| - name: Configure project with CMake | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_CXX_COMPILER=clang++ \ | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | |
| -DCHECK_FOR_UPDATES=OFF \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| - name: Build project | |
| run: cmake --build build -j$(nproc) | |
| - name: Create .clang-tidy config | |
| run: | | |
| cat <<'EOF' > .clang-tidy | |
| Checks: > | |
| -*, | |
| readability-string-compare, | |
| bugprone-suspicious-string-compare, | |
| bugprone-*, | |
| readability-implicit-bool-conversion, | |
| performance-inefficient-string-concatenation, | |
| modernize-use-nullptr, | |
| modernize-use-override, | |
| modernize-use-auto, | |
| misc-unused-parameters | |
| # WarningsAsErrors: '*' # <-- Commented out to not fail on all warnings | |
| HeaderFilterRegex: 'src/(?!third-party).*' # consider adding some third party that are not actually third party like realdds | |
| FormatStyle: none | |
| CheckOptions: | |
| - key: readability-implicit-bool-conversion.AllowIntegerConditions | |
| value: 'false' | |
| EOF | |
| - name: Run clang-tidy | |
| run: | | |
| echo "Running clang-tidy..." | |
| cp build/compile_commands.json . | |
| clang-tidy -p . $(find src -name '*.cpp') 2>&1 | tee clang-tidy.log | |
| - name: Summarize clang-tidy errors | |
| run: | | |
| echo "Clang-Tidy Error Summary:" | |
| awk '/^(.*):(.*):.*(warning|error):/ {print $0}' clang-tidy.log > clang-tidy-msgs.log | |
| total=$(cat clang-tidy-msgs.log | wc -l) | |
| echo "" | |
| echo "Total clang-tidy errors/warnings found: $total" | |
| echo "" | |
| if (( total > 0 )); then | |
| echo "Top error/warning types:" | |
| grep -oE '\[[^][]+\]' clang-tidy-msgs.log | sort | uniq -c | sort -nr | head -20 | |
| echo "" | |
| echo "CI failed. See clang-tidy.log for details." | |
| exit 1 | |
| else | |
| echo "✅ Clang-Tidy passed cleanly." | |
| fi | |
| - name: Upload full clang-tidy log as Artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: clang-tidy-log | |
| path: clang-tidy.log |