Skip to content

Commit

Permalink
Report error from clang-tidy check
Browse files Browse the repository at this point in the history
We search the compilation log file for string "warning:". I haven't
found a better way than that to achieve the goal of "compile the whole
codebase and report if there were warnings".
  • Loading branch information
MiKom committed Jul 12, 2024
1 parent e5393b6 commit 0d98e39
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,21 @@ jobs:
sudo apt update -qq
sudo apt install -y libxkbcommon-dev libxcb-xkb-dev \
libxkbcommon-x11-dev wayland-scanner++ wayland-protocols \
libwayland-dev xvfb ninja-build
libwayland-dev xvfb ninja-build cppcheck
- name: Configure project
run: >
cmake -S . -B build -G Ninja -DKDUTILS_BUILD_TESTS=True -DCMAKE_CXX_CLANG_TIDY="${{matrix.tidy-executable}}" \
cmake -S . -B build -G Ninja -DKDUTILS_BUILD_TESTS=True
-DCMAKE_CXX_CLANG_TIDY="${{matrix.tidy-executable}}" \
-DCMAKE_BUILD_TYPE=Release
- name: Build Project
run: cmake --build build
shell: pwsh
run: |
cmake --build build | Tee-Object -File log.txt
$numWarnings = (Get-Content log.txt | Select-String "warning:").Length
if($numWarnings -gt 0) {
echo "::error title=clang-tidy failed::See job log for details"
exit 1
}

0 comments on commit 0d98e39

Please sign in to comment.