fix wrong string compare on python device repr #11
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, | |
| misc-strcmp | |
| # 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 | |
| clang-tidy -p . $(find common examples tools wrappers/python src third-party/rsutils third-party/realdds -name '*.cpp') 2>&1 | tee clang-tidy.log | |
| # === NEW: Extract errors only to a separate log === | |
| - name: Extract errors from clang-tidy log | |
| run: | | |
| awk '/error:/ && !/\[clang-diagnostic-error\]/' clang-tidy.log > clang-tidy-errors.log | |
| # === NEW: Summarize only errors at the end === | |
| - name: Errors Only Summary | |
| run: | | |
| echo "Clang-Tidy Errors Only Summary:" | |
| total_errors=$(cat clang-tidy-errors.log | wc -l) | |
| echo "" | |
| echo "Total errors found: $total_errors" | |
| echo "" | |
| if (( total_errors > 0 )); then | |
| echo "Top error types:" | |
| grep -oE '\[[^][]+\]' clang-tidy-errors.log | sort | uniq -c | sort -nr | head -20 | |
| echo "" | |
| echo "CI failed due to errors. See clang-tidy-errors.log for details." | |
| exit 1 | |
| else | |
| echo "✅ No clang-tidy errors found." | |
| 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 | |
| # === NEW: Upload errors-only log as artifact === | |
| - name: Upload clang-tidy errors-only log as Artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: clang-tidy-errors-log | |
| path: clang-tidy-errors.log |