Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .devcontainer/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ ENV GRPC_VERSION=${GRPC_VERSION}
COPY ci /opt/ci

RUN apt update && apt install -y wget \
ninja-build \
libcurl4-openssl-dev \
clang-tidy \
shellcheck
ninja-build \
llvm-dev \
libclang-dev \
libcurl4-openssl-dev \
clang-tidy \
shellcheck

RUN cd /opt/ci && bash setup_cmake.sh
RUN cd /opt/ci && bash setup_ci_environment.sh
RUN cd /opt/ci && bash install_iwyu.sh
RUN cd /opt && bash ci/setup_googletest.sh \
&& bash ci/install_abseil.sh \
&& bash ci/install_protobuf.sh \
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/clang-tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
sudo apt update -y
sudo apt install -y --no-install-recommends --no-install-suggests \
build-essential \
iwyu \
cmake \
libssl-dev \
libcurl4-openssl-dev \
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,23 @@ jobs:
sudo apt update -y
sudo apt install -y --no-install-recommends --no-install-suggests \
build-essential \
iwyu \
ninja-build \
libssl-dev \
libcurl4-openssl-dev \
libabsl-dev \
libprotobuf-dev \
libgrpc++-dev \
protobuf-compiler \
protobuf-compiler-grpc \
libgmock-dev \
libgtest-dev \
libbenchmark-dev
libbenchmark-dev \
llvm-dev \
libclang-dev
sudo ./ci/setup_cmake.sh


- name: setup grpc
- name: Install include-what-you-use
run: |
sudo ./ci/setup_grpc.sh

sudo ./ci/install_iwyu.sh
- name: Prepare CMake
run: |
TOPDIR=`pwd`
Expand Down Expand Up @@ -80,11 +81,13 @@ jobs:
- name: count warnings
run: |
set +e
echo "include-what-you-use version:"
include-what-you-use --version
cd build
readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
echo "include-what-you-use reported ${WARNING_COUNT} warning(s)"
# Acceptable limit, to decrease over time down to 0
readonly WARNING_LIMIT=0
readonly WARNING_LIMIT=122
# FAIL the build if WARNING_COUNT > WARNING_LIMIT
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
exit 1
Expand Down
31 changes: 31 additions & 0 deletions ci/install_iwyu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

set -e

INSTALL_PREFIX="/usr/local"

LLVM_VERSION=$(llvm-config --version 2>/dev/null | cut -d. -f1)

if [ -z "$LLVM_VERSION" ]; then
echo "Error: LLVM not found. Exiting."
exit 1
fi

echo "LLVM_VERSION=$LLVM_VERSION"
echo "Installing IWYU..."

cd /tmp
git clone --depth 1 --branch clang_$LLVM_VERSION https://github.com/include-what-you-use/include-what-you-use.git
cd include-what-you-use
mkdir -p build
cd build

cmake -DCMAKE_PREFIX_PATH=/usr/lib/llvm-$LLVM_VERSION -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
make -j$(nproc)
make install

echo "IWYU install complete. Verifying installation..."
include-what-you-use --version
1 change: 0 additions & 1 deletion ci/setup_ci_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ apt-get install --no-install-recommends --no-install-suggests -y \
git \
valgrind \
lcov \
iwyu \
pkg-config
Loading