From 3b0ff5dcc8accb639f3498f30b2af46400d8c41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 00:03:59 +0200 Subject: [PATCH] clang-tidy CI integration --- .clang-tidy | 8 ++++++++ .github/workflows/clang-tidy.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .clang-tidy create mode 100644 .github/workflows/clang-tidy.yml diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..13d377ea81 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,8 @@ +--- +Checks: > + *-, + cppcoreguidelines-macro-usage, + modernize-use-nullptr, + modernize-use-override +WarningsAsErrors: true +FormatStyle: 'file' diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml new file mode 100644 index 0000000000..f83bf6a02b --- /dev/null +++ b/.github/workflows/clang-tidy.yml @@ -0,0 +1,32 @@ +name: clang-tidy-check +on: + pull_request: + paths-ignore: + - '.editorconfig' + - '.gitattributes' + - '.github/*_TEMPLATE/**' + - '.github/workflows/localisation.yml' + - '.gitignore' + - '.vscode/**' + +jobs: + clang-tidy-check: + runs-on: ubuntu-latest + container: openrct2/openrct2-build:12-jammy + steps: + - uses: actions/checkout@v4 + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: linux-clang + - name: Setup CCache environment + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + - name: Get clang-tidy + run: | + apt-get update + apt-get install -y clang-tidy + - uses: ZehMatt/clang-tidy-annotations@v1 + with: + build_dir: 'build' + cmake_args: '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DDISABLE_DISCORD_RPC=ON'