@@ -94,55 +94,77 @@ jobs:
9494
9595 - name : Install dependencies
9696 run : |
97+ # Install LLVM 19 with libc++
98+ wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | \
99+ sudo tee /etc/apt/trusted.gpg.d/llvm.asc
100+ sudo add-apt-repository -y \
101+ 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main'
97102 sudo apt-get update
98103 sudo apt-get install -y \
99- clang-tidy \
100- gcc-14 \
101- g++-14 \
104+ clang-19 \
105+ clang-tidy-19 \
106+ llvm-19 \
107+ llvm-19-dev \
108+ lld-19 \
109+ libc++-19-dev \
110+ libc++abi-19-dev \
102111 cmake \
103112 ninja-build \
104113 libudev-dev \
105114 libsystemd-dev \
106115 pkg-config
107116
108- - name : Cache clang-tidy results
109- uses : actions/cache@v4
110- with :
111- path : .clang-tidy-cache
112- key : >-
113- clang-tidy-${{ runner.os }}-${{
114- hashFiles('**/*.cpp', '**/*.cc', '**/*.h', '**/*.hpp',
115- '.clang-tidy') }}
116- restore-keys : |
117- clang-tidy-${{ runner.os }}-
118-
119117 - name : Configure CMake for clang-tidy
120118 run : |
121119 mkdir -p build
122120 cd build
123121 cmake .. -GNinja \
124122 -DCMAKE_BUILD_TYPE=Release \
125- -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
123+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
124+ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \
125+ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" \
126+ -DLLVM_CONFIG=/usr/bin/llvm-config-19
127+
128+ sed -i \
129+ -e 's/-fdeps-format=p1689r5//g' \
130+ -e 's/-fmodules-ts//g' \
131+ -e 's/-fmodule-mapper=[^ ]*//g' \
132+ -e 's/@[^ ]*\.modmap//g' \
133+ compile_commands.json
134+
126135 env :
127- CC : gcc-14
128- CXX : g ++-14
136+ CC : clang-19
137+ CXX : clang ++-19
129138
130139 - name : Run clang-tidy
131140 run : |
132- # Create cache directory if it doesn't exist
133- mkdir -p .clang-tidy-cache
134-
135141 # Find all C++ source files and run clang-tidy
136142 # Exclude third_party directory from analysis
137- find src -type f \( -name "*.cpp" -o -name "*.cc" \) | \
138- while read file; do
139- echo "Analyzing $file..."
140- clang-tidy "$file" \
141- -p build \
142- --warnings-as-errors='*' \
143- --header-filter='^(?!.*third_party).*$' \
144- --system-headers=false || exit 1
145- done
143+ export FILE_LIST=$(find src -type d -name third_party -prune -false -o -name '*.cc' -o -name '*.hpp' -o -name '*.h')
144+
145+ clang-tidy-19 --version
146+ clang-tidy-19 --help
147+
148+ clang-tidy-19 \
149+ -p build \
150+ -export-fixes=tidy-results-suggested-fixes.txt \
151+ -extra-arg='-Ithird_party/glaze/include' \
152+ -extra-arg='-Ithird_party/sdbus-cpp/include' \
153+ -extra-arg='-Ithird_party/spdlog/include' \
154+ -warnings-as-errors='*' \
155+ -header-filter='^(?!.*third_party).*$' \
156+ --dump-config
157+
158+ run-clang-tidy-19 \
159+ -p build \
160+ -export-fixes=tidy-results-suggested-fixes.txt \
161+ -extra-arg='-Ithird_party/glaze/include' \
162+ -extra-arg='-Ithird_party/sdbus-cpp/include' \
163+ -extra-arg='-Ithird_party/spdlog/include' \
164+ -warnings-as-errors='*' \
165+ -header-filter='^(?!.*third_party).*$' \
166+ $FILE_LIST
167+
146168 shell : bash
147169
148170 build :
0 commit comments