From 0d98e39d3f582516ecd20be7f85bbb13293badfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Kosobucki?= Date: Thu, 11 Jul 2024 16:07:58 +0200 Subject: [PATCH] Report error from clang-tidy check 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". --- .github/workflows/nightly.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1bdfb0a..1d288d1 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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 + }