From 738afab550a1df657bc936b35123392ef5e29db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Kosobucki?= Date: Tue, 2 Jul 2024 11:26:57 +0200 Subject: [PATCH] Add clang-tidy on Windows on GitHub Actions Action turtlesec-no/get-ninja is used instead of aseprite/get-ninja as the latter one puts ninja in some place that makes it not discoverable for CMake in later steps. --- .github/workflows/nightly.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 05bb9ee..4a726bb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company +# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company # # SPDX-License-Identifier: MIT @@ -11,31 +11,44 @@ on: push: env: - CC: "/usr/bin/clang" - CXX: "/usr/bin/clang++" + CC: "clang" + CXX: "clang++" jobs: build: - runs-on: ubuntu-24.04 + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - name: Ubuntu + os: ubuntu-24.04 + # Specify executable name on Linux to have control over the version. + # Sadly, on Linux these per-version executables aren't there. + tidy-executable: clang-tidy-18 + - name: Windows + os: windows-2022 + tidy-executble: clang-tidy steps: - name: Checkout sources uses: actions/checkout@v4 - name: Install ninja-build tool - uses: aseprite/get-ninja@main + if: runner.os == 'Windows' + uses: turtlesec-no/get-ninja@main - name: Install linux dependencies + if: runner.os == 'Linux' run: | sudo apt update -qq sudo apt install -y libxkbcommon-dev libxcb-xkb-dev \ libxkbcommon-x11-dev wayland-scanner++ wayland-protocols \ - libwayland-dev xvfb + libwayland-dev xvfb ninja-build - name: Configure project run: > - cmake -S . -B ./build -G Ninja -DKDUTILS_BUILD_TESTS=True -DCMAKE_CXX_CLANG_TIDY="clang-tidy-18" \ + 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 \ No newline at end of file + run: cmake --build ./build