Skip to content

Commit fd3a017

Browse files
authored
Install clang-tidy only in ubuntu clang-21 image (#97)
1 parent 328d34f commit fd3a017

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.github/workflows/ubuntu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ jobs:
186186
- release: noble
187187
compiler_name: clang
188188
compiler_version: 20
189+
- release: noble
190+
compiler_name: clang
191+
compiler_version: 21
189192
runs-on: ubuntu-24.04
190193
needs:
191194
- build

docker/ubuntu/Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,21 @@ printf "%s\n" \
228228
"Acquire::AllowWeakRepositories \"true\";" \
229229
| tee /etc/apt/apt.conf.d/99llvm-allow-weak
230230

231-
# Add LLVM repository for versions above 20 because it is not available in the default repo
232-
if [[ "${CLANG_VERSION}" -gt 20 ]]; then
231+
if [[ "${CLANG_VERSION}" -eq 21 ]]; then
233232
apt-get update
233+
# Add LLVM repository for versions above 20 because it is not available in the default repo
234234
apt-get install -y --no-install-recommends lsb-release software-properties-common gnupg
235235
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
236236
DISTRO_CODENAME=$(lsb_release -cs)
237237
echo "deb http://apt.llvm.org/${DISTRO_CODENAME}/ llvm-toolchain-${DISTRO_CODENAME}-${CLANG_VERSION} main" \
238238
| tee /etc/apt/sources.list.d/llvm.list
239+
apt-get update
240+
apt-get install -y --no-install-recommends --allow-unauthenticated \
241+
clang-tidy-${CLANG_VERSION}
242+
update-alternatives \
243+
--install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} 100
244+
update-alternatives \
245+
--install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-${CLANG_VERSION} 100
239246
apt-get clean
240247
rm -rf /var/lib/apt/lists/*
241248
fi
@@ -245,7 +252,6 @@ apt-get install -y --no-install-recommends --allow-unauthenticated \
245252
clang-${CLANG_VERSION} \
246253
libclang-rt-${CLANG_VERSION}-dev \
247254
llvm-${CLANG_VERSION} \
248-
clang-tidy-${CLANG_VERSION} \
249255
gcc \
250256
g++
251257
apt-get clean
@@ -259,10 +265,6 @@ update-alternatives \
259265
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION}
260266
update-alternatives \
261267
--install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${CLANG_VERSION} 100
262-
update-alternatives \
263-
--install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} 100
264-
update-alternatives \
265-
--install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-${CLANG_VERSION} 100
266268
update-alternatives --auto cc
267269
update-alternatives --auto c++
268270
update-alternatives --auto clang

0 commit comments

Comments
 (0)