-
Notifications
You must be signed in to change notification settings - Fork 447
79 lines (72 loc) · 2.22 KB
/
clang-tidy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: clang-tidy
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
clang-tidy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Environment
env:
PROTOBUF_VERSION: '23.3'
ABSEIL_CPP_VERSION: '20230125.3'
CXX_STANDARD: '14'
run: |
sudo apt update -y
sudo apt install -y --no-install-recommends --no-install-suggests \
build-essential \
iwyu \
cmake \
ninja-build \
libssl-dev \
libcurl4-openssl-dev \
libprotobuf-dev \
protobuf-compiler \
libgmock-dev \
libgtest-dev \
libbenchmark-dev
# sudo -E ./ci/install_abseil.sh
# sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp
- name: Prepare CMake
run: |
echo "Using clang-tidy version: $(clang-tidy --version)"
mkdir -p build && cd build
echo "Running cmake..."
CC="clang" CXX="clang++" cmake .. \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_STL=CXX14 \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_ZIPKIN=ON \
-DWITH_ELASTICSEARCH=ON \
-DWITH_OTLP_HTTP_COMPRESSION=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
-DBUILD_W3CTRACECONTEXT_TEST=ON \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy)"
# -DWITH_ABSEIL=ON \
# -DWITH_OTLP_GRPC=ON \
# -DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON \
- name: clang-tidy
run: |
cd build
make 2>&1 | tee -a clang-tidy.log
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Logs (clang-tidy)
path: ./build/*.log
- name: count warnings
run: |
cd build
COUNT=`grep -c "warning:" clang-tidy.log`
echo "clang-tidy reported ${COUNT} warning(s)"