Skip to content

Commit f68dbd7

Browse files
committed
add iwyu install script and update the ci job
1 parent 05ac106 commit f68dbd7

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

.github/workflows/iwyu.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,23 @@ jobs:
2828
sudo apt update -y
2929
sudo apt install -y --no-install-recommends --no-install-suggests \
3030
build-essential \
31-
iwyu \
3231
ninja-build \
3332
libssl-dev \
3433
libcurl4-openssl-dev \
34+
libabsl-dev \
3535
libprotobuf-dev \
36+
libgrpc++-dev \
3637
protobuf-compiler \
38+
protobuf-compiler-grpc \
3739
libgmock-dev \
3840
libgtest-dev \
39-
libbenchmark-dev
41+
libbenchmark-dev \
42+
llvm-dev \
43+
libclang-dev
4044
sudo ./ci/setup_cmake.sh
41-
42-
43-
- name: setup grpc
45+
- name: Install include-what-you-use
4446
run: |
45-
sudo ./ci/setup_grpc.sh
46-
47+
sudo ./ci/install_iwyu.sh
4748
- name: Prepare CMake
4849
run: |
4950
TOPDIR=`pwd`

ci/install_iwyu.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Copyright The OpenTelemetry Authors
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
set -e
7+
8+
INSTALL_PREFIX="/usr/local"
9+
10+
LLVM_VERSION=$(llvm-config --version 2>/dev/null | cut -d. -f1)
11+
12+
if [ -z "$LLVM_VERSION" ]; then
13+
echo "Error: LLVM not found. Exiting."
14+
exit 1
15+
fi
16+
17+
echo "LLVM_VERSION=$LLVM_VERSION"
18+
echo "Installing IWYU..."
19+
20+
git clone --depth 1 --branch clang_$LLVM_VERSION https://github.com/include-what-you-use/include-what-you-use.git
21+
cd include-what-you-use
22+
mkdir -p build
23+
cd build
24+
25+
cmake -DCMAKE_PREFIX_PATH=/usr/lib/llvm-$LLVM_VERSION -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
26+
make -j$(nproc)
27+
make install
28+
29+
echo "IWYU install complete. Verifying installation..."
30+
include-what-you-use --version

0 commit comments

Comments
 (0)