Merge pull request #21408 from ZehMatt/clang-tidy

Add clang-tidy CI step
This commit is contained in:
Matt 2024-02-21 12:50:44 +02:00 committed by GitHub
commit fdbdbd405f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 0 deletions

8
.clang-tidy Normal file
View File

@ -0,0 +1,8 @@
---
Checks: >
*-,
cppcoreguidelines-macro-usage,
modernize-use-nullptr,
modernize-use-override
WarningsAsErrors: true
FormatStyle: 'file'

32
.github/workflows/clang-tidy.yml vendored Normal file
View File

@ -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'