[SDK] Add credentials option to OTLP gRPC client (#3402) (#3403) #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: include-what-you-use | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: read | |
jobs: | |
iwyu: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden the runner (Audit all outbound calls) | |
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: 'recursive' | |
- name: setup dependencies | |
run: | | |
sudo apt update -y | |
sudo apt install -y --no-install-recommends --no-install-suggests \ | |
build-essential \ | |
ninja-build \ | |
libssl-dev \ | |
libcurl4-openssl-dev \ | |
libabsl-dev \ | |
libprotobuf-dev \ | |
libgrpc++-dev \ | |
protobuf-compiler \ | |
protobuf-compiler-grpc \ | |
libgmock-dev \ | |
libgtest-dev \ | |
libbenchmark-dev \ | |
llvm-dev \ | |
libclang-dev | |
sudo ./ci/setup_cmake.sh | |
- name: Install include-what-you-use | |
run: | | |
sudo ./ci/install_iwyu.sh | |
- name: Prepare CMake | |
run: | | |
TOPDIR=`pwd` | |
mkdir build && cd build | |
CC="clang" CXX="clang++" cmake \ | |
-DCMAKE_CXX_STANDARD=14 \ | |
-DWITH_STL=CXX14 \ | |
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \ | |
-DBUILD_TESTING=ON \ | |
-DWITH_EXAMPLES=ON \ | |
-DWITH_EXAMPLES_HTTP=ON \ | |
-DBUILD_W3CTRACECONTEXT_TEST=ON \ | |
-DWITH_OTLP_GRPC=ON \ | |
-DWITH_OTLP_HTTP=ON \ | |
-DWITH_OTLP_FILE=ON \ | |
-DWITH_OPENTRACING=ON \ | |
-DWITH_OTLP_HTTP_COMPRESSION=ON \ | |
-DWITH_THREAD_INSTRUMENTATION=ON \ | |
-DWITH_ZIPKIN=ON \ | |
-DWITH_PROMETHEUS=ON \ | |
.. | |
- name: iwyu_tool | |
run: | | |
cd build | |
make -k 2>&1 | tee -a iwyu.log | |
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
if: success() || failure() | |
with: | |
name: Logs (include-what-you-use) | |
path: ./build/*.log | |
- 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=122 | |
# FAIL the build if WARNING_COUNT > WARNING_LIMIT | |
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then | |
exit 1 | |
# WARN in annotations if WARNING_COUNT > 0 | |
elif [ $WARNING_COUNT -gt 0 ] ; then | |
echo "::warning::include-what-you-use reported ${WARNING_COUNT} warning(s)" | |
fi |