Skip to content

Commit a842a0b

Browse files
authored
Merge branch 'main' into 3118-devcontainer
2 parents 29b860a + 92bf8da commit a842a0b

File tree

300 files changed

+20286
-2206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+20286
-2206
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# Enable automatic configs based on platform
88
common --enable_platform_specific_config
99

10+
# Make globs that don't match anything fail
11+
common --incompatible_disallow_empty_glob
12+
1013
# Needed by gRPC to build on some platforms.
1114
build --copt -DGRPC_BAZEL_BUILD
1215

.github/workflows/ci.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ jobs:
4949
submodules: 'recursive'
5050
- name: setup
5151
env:
52-
CC: /usr/bin/gcc-10
53-
CXX: /usr/bin/g++-10
52+
CC: /usr/bin/gcc-12
53+
CXX: /usr/bin/g++-12
5454
run: |
5555
sudo -E ./ci/setup_googletest.sh
5656
sudo -E ./ci/setup_ci_environment.sh
5757
- name: run cmake tests (without otlp-exporter)
5858
env:
59-
CC: /usr/bin/gcc-10
60-
CXX: /usr/bin/g++-10
59+
CC: /usr/bin/gcc-12
60+
CXX: /usr/bin/g++-12
6161
run: |
6262
./ci/do_ci.sh cmake.test
6363
@@ -263,15 +263,15 @@ jobs:
263263
submodules: 'recursive'
264264
- name: setup
265265
env:
266-
CC: /usr/bin/gcc-10
267-
CXX: /usr/bin/g++-10
266+
CC: /usr/bin/gcc-12
267+
CXX: /usr/bin/g++-12
268268
run: |
269269
sudo -E ./ci/setup_googletest.sh
270270
sudo -E ./ci/setup_ci_environment.sh
271271
- name: run cmake tests (without otlp-exporter)
272272
env:
273-
CC: /usr/bin/gcc-10
274-
CXX: /usr/bin/g++-10
273+
CC: /usr/bin/gcc-12
274+
CXX: /usr/bin/g++-12
275275
run: |
276276
./ci/do_ci.sh cmake.with_async_export.test
277277
@@ -359,7 +359,7 @@ jobs:
359359

360360
cmake_test_cxx20_clang:
361361
name: CMake C++20 test(Clang with libc++)
362-
runs-on: ubuntu-latest
362+
runs-on: ubuntu-22.04
363363
steps:
364364
- uses: actions/checkout@v4
365365
with:
@@ -409,7 +409,7 @@ jobs:
409409

410410
cmake_test_cxx23_clang:
411411
name: CMake C++23 test(Clang with libc++)
412-
runs-on: ubuntu-latest
412+
runs-on: ubuntu-22.04
413413
steps:
414414
- uses: actions/checkout@v4
415415
with:
@@ -538,15 +538,15 @@ jobs:
538538
submodules: 'recursive'
539539
- name: setup
540540
env:
541-
CC: /usr/bin/gcc-10
542-
CXX: /usr/bin/g++-10
541+
CC: /usr/bin/gcc-12
542+
CXX: /usr/bin/g++-12
543543
run: |
544544
sudo -E ./ci/setup_googletest.sh
545545
sudo -E ./ci/setup_ci_environment.sh
546546
- name: run tests
547547
env:
548-
CC: /usr/bin/gcc-10
549-
CXX: /usr/bin/g++-10
548+
CC: /usr/bin/gcc-12
549+
CXX: /usr/bin/g++-12
550550
run: ./ci/do_ci.sh cmake.test_example_plugin
551551

552552
bazel_test:
@@ -858,7 +858,7 @@ jobs:
858858

859859
code_coverage:
860860
name: Code coverage
861-
runs-on: ubuntu-latest
861+
runs-on: ubuntu-22.04
862862
steps:
863863
- uses: actions/checkout@v4
864864
with:
@@ -876,9 +876,9 @@ jobs:
876876
CXX: /usr/bin/g++-10
877877
run: ./ci/do_ci.sh code.coverage
878878
- name: upload report
879-
uses: codecov/codecov-action@v4
879+
uses: codecov/codecov-action@v5
880880
with:
881-
file: /home/runner/build/coverage.info
881+
files: /home/runner/build/coverage.info
882882

883883
markdown-lint:
884884
runs-on: ubuntu-latest
@@ -936,8 +936,8 @@ jobs:
936936
submodules: 'recursive'
937937
- name: setup
938938
env:
939-
CC: /usr/bin/gcc-10
940-
CXX: /usr/bin/g++-10
939+
CC: /usr/bin/gcc-12
940+
CXX: /usr/bin/g++-12
941941
run: |
942942
sudo -E ./ci/setup_googletest.sh
943943
sudo -E ./ci/setup_ci_environment.sh
@@ -946,8 +946,8 @@ jobs:
946946
CXX_STANDARD: '14'
947947
run: |
948948
./ci/do_ci.sh cmake.w3c.trace-context.build-server
949-
cd $HOME/build/ext/test/w3c_tracecontext_test
950-
./w3c_tracecontext_test &
949+
cd $HOME/build/ext/test/w3c_tracecontext_http_test_server
950+
./w3c_tracecontext_http_test_server &
951951
- name: Checkout w3c/trace-context repo
952952
uses: actions/checkout@v4
953953
with:

.github/workflows/clang-tidy.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ jobs:
4646
CC: clang
4747
CXX: clang++
4848
run: |
49-
mkdir -p build && cd build
5049
echo "Running cmake..."
51-
cmake .. \
50+
cmake -B build \
5251
-DCMAKE_CXX_STANDARD=14 \
5352
-DWITH_STL=CXX14 \
5453
-DWITH_OTLP_HTTP=ON \
@@ -62,23 +61,21 @@ jobs:
6261
-DBUILD_W3CTRACECONTEXT_TEST=ON \
6362
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
6463
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
65-
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
66-
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
64+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
6765
6866
- name: Run clang-tidy
6967
run: |
70-
cd build
71-
make 2>&1 | tee -a clang-tidy.log || exit 1
68+
cmake --build build --target opentelemetry_proto
69+
jq -r .[].file build/compile_commands.json | grep -vE '/(generated|third_party)/' | xargs -P $(nproc) -n 1 clang-tidy --quiet -p build 2>&1 | tee -a clang-tidy.log
7270
7371
- uses: actions/upload-artifact@v4
7472
with:
7573
name: Logs (clang-tidy)
76-
path: ./build/clang-tidy.log
74+
path: ./clang-tidy.log
7775

7876
- name: Count warnings
7977
run: |
80-
cd build
8178
COUNT=$(grep -c "warning:" clang-tidy.log)
8279
echo "clang-tidy reported ${COUNT} warning(s)"
8380
84-
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.
81+
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
rm -rf third_party
2121
- name: Setup
2222
env:
23-
CC: /usr/bin/gcc-10
24-
CXX: /usr/bin/g++-10
23+
CC: /usr/bin/gcc-12
24+
CXX: /usr/bin/g++-12
2525
GOOGLETEST_VERSION: 1.12.1
2626
run: |
2727
sudo -E ./ci/setup_googletest.sh

.github/workflows/cppcheck.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
name: cppcheck
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
cppcheck:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: 'recursive'
17+
18+
- name: Set up dependencies
19+
run: |
20+
sudo apt update -y
21+
sudo apt install -y cppcheck
22+
23+
- name: Run cppcheck
24+
run: |
25+
cppcheck --version | tee cppcheck.log
26+
cppcheck \
27+
--force \
28+
--enable=warning,performance,portability \
29+
--inline-suppr \
30+
--suppress=unknownMacro:exporters/etw/include/opentelemetry/exporters/etw/TraceLoggingDynamic.h \
31+
--language=c++ \
32+
--std=c++14 \
33+
-I api/include \
34+
-I exporters/elasticsearch/include \
35+
-I exporters/etw/include \
36+
-I exporters/memory/include \
37+
-I exporters/ostream/include \
38+
-I exporters/otlp/include \
39+
-I exporters/prometheus/include \
40+
-I exporters/zipkin/include \
41+
-I ext/include \
42+
-I opentracing-shim/include \
43+
-I sdk/include \
44+
-i build \
45+
-i test \
46+
-i third_party \
47+
-j $(nproc) \
48+
. 2>&1 | tee --append cppcheck.log
49+
50+
- uses: actions/upload-artifact@v4
51+
if: success() || failure()
52+
with:
53+
name: Logs (cppcheck)
54+
path: ./cppcheck.log
55+
56+
- name: Count warnings
57+
run: |
58+
set +e
59+
readonly WARNING_COUNT=`grep -c -E "\[.+\]" cppcheck.log`
60+
echo "cppcheck reported ${WARNING_COUNT} warning(s)"
61+
# Acceptable limit, to decrease over time down to 0
62+
readonly WARNING_LIMIT=10
63+
# FAIL the build if WARNING_COUNT > WARNING_LIMIT
64+
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
65+
exit 1
66+
# WARN in annotations if WARNING_COUNT > 0
67+
elif [ $WARNING_COUNT -gt 0 ] ; then
68+
echo "::warning::cppcheck reported ${WARNING_COUNT} warning(s)"
69+
fi

.github/workflows/iwyu.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,16 @@ jobs:
6262

6363
- name: count warnings
6464
run: |
65+
set +e
6566
cd build
66-
COUNT=`grep -c "Warning:" iwyu.log`
67-
echo "include-what-you-use reported ${COUNT} warning(s)"
68-
67+
readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
68+
echo "include-what-you-use reported ${WARNING_COUNT} warning(s)"
69+
# Acceptable limit, to decrease over time down to 0
70+
readonly WARNING_LIMIT=180
71+
# FAIL the build if WARNING_COUNT > WARNING_LIMIT
72+
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
73+
exit 1
74+
# WARN in annotations if WARNING_COUNT > 0
75+
elif [ $WARNING_COUNT -gt 0 ] ; then
76+
echo "::warning::include-what-you-use reported ${WARNING_COUNT} warning(s)"
77+
fi

.iwyu.imp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
[
77
# Work around for C++ STL
88
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },
9+
{ "include": ["<bits/std_abs.h>", "private", "<cstdlib>", "public"] },
10+
{ "include": ["<ext/alloc_traits.h>", "private", "<memory>", "public"] },
11+
{ "include": ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
12+
{ "include": ["<bits/types/struct_FILE.h>", "private", "<stdio.h>", "public"] },
913

1014
# Local opentelemetry-cpp style
1115

@@ -14,6 +18,7 @@
1418
{ "include": ["<gtest/gtest-test-part.h>", "private", "<gtest/gtest.h>", "public"] },
1519
{ "include": ["<gtest/gtest-param-test.h>", "private", "<gtest/gtest.h>", "public"] },
1620
{ "include": ["<gtest/gtest_pred_impl.h>", "private", "<gtest/gtest.h>", "public"] },
21+
{ "include": ["<gtest/gtest-typed-test.h>", "private", "<gtest/gtest.h>", "public"] },
1722

1823
# We prefer to include <gmock/gmock.h> for simplicity
1924
{ "include": ["<gmock/gmock-function-mocker.h>", "private", "<gmock/gmock.h>", "public"] },

0 commit comments

Comments
 (0)