Skip to content

Commit 2bb87d0

Browse files
committed
Add clang-tidy support to GitHub CI workflows
- Install `clang-tidy` as a dependency across all platforms. - Enable `USE_CLANG_TIDY` option in CMake configurations.
1 parent d6a443a commit 2bb87d0

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
sudo apt-get update
23-
sudo apt-get install -y cmake build-essential zlib1g-dev libzip-dev opencl-headers ocl-icd-opencl-dev
23+
sudo apt-get install -y cmake build-essential zlib1g-dev libzip-dev opencl-headers ocl-icd-opencl-dev clang-tidy
2424
2525
- name: Cache CMake build
2626
uses: actions/cache@v4
@@ -35,7 +35,7 @@ jobs:
3535
- name: Configure CMake
3636
working-directory: cpp
3737
run: |
38-
cmake . -DUSE_BACKEND=OPENCL -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="-s"
38+
cmake . -DUSE_BACKEND=OPENCL -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="-s" -DUSE_CLANG_TIDY=1
3939
4040
- name: Build
4141
working-directory: cpp
@@ -65,7 +65,7 @@ jobs:
6565

6666
- name: Install dependencies
6767
run: |
68-
brew install zlib libzip opencl-headers
68+
brew install zlib libzip opencl-headers llvm
6969
- name: Cache CMake build
7070
uses: actions/cache@v4
7171
with:
@@ -81,7 +81,7 @@ jobs:
8181
- name: Configure CMake
8282
working-directory: cpp
8383
run: |
84-
cmake . -G Ninja -DUSE_BACKEND=OPENCL -DCMAKE_BUILD_TYPE=Release
84+
cmake . -G Ninja -DUSE_BACKEND=OPENCL -DCMAKE_BUILD_TYPE=Release -DUSE_CLANG_TIDY=1
8585
- name: Build
8686
working-directory: cpp
8787
run: |
@@ -128,7 +128,8 @@ jobs:
128128
run: |
129129
cmake . -G "Visual Studio 17 2022" -A x64 `
130130
-DUSE_BACKEND=OPENCL `
131-
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
131+
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
132+
-DUSE_CLANG_TIDY=1
132133
133134
- name: Build
134135
working-directory: cpp

0 commit comments

Comments
 (0)