Skip to content

Commit 52ed4cb

Browse files
authored
Merge branch 'main' into ks/bazel-enable-incompatible_disallow_empty_glob
2 parents 46f37c7 + 6292a6a commit 52ed4cb

File tree

433 files changed

+8224
-4031
lines changed

Some content is hidden

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

433 files changed

+8224
-4031
lines changed

.bazelrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
# bazel configurations for running tests under sanitizers.
55
# Based on https://github.com/bazelment/trunk/blob/master/tools/bazel.rc
66

7-
# TODO: Remove once support is added, avoid MODULE.bazel creation for now
8-
common --enable_bzlmod=false
9-
107
# Enable automatic configs based on platform
118
common --enable_platform_specific_config
129

.clang-tidy

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
Checks: >
5+
-*,
6+
performance-*,
7+
portability-*,
8+
abseil-*,
9+
-abseil-string-find-str-contains,
10+
bugprone-*,
11+
-bugprone-easily-swappable-parameters,
12+
-bugprone-implicit-widening-of-multiplication-result,
13+
-bugprone-inc-dec-in-conditions,
14+
-bugprone-narrowing-conversions,
15+
-bugprone-unchecked-optional-access,
16+
-bugprone-unhandled-exception-at-new,
17+
-bugprone-unused-local-non-trivial-variable,
18+
google-*,
19+
-google-build-using-namespace,
20+
-google-default-arguments,
21+
-google-explicit-constructor,
22+
-google-readability-avoid-underscore-in-googletest-name,
23+
-google-readability-braces-around-statements,
24+
-google-readability-namespace-comments,
25+
-google-readability-todo,
26+
-google-runtime-references,
27+
misc-*,
28+
-misc-const-correctness,
29+
-misc-include-cleaner,
30+
-misc-non-private-member-variables-in-classes,
31+
-misc-unused-alias-decls,
32+
-misc-use-anonymous-namespace,
33+
cppcoreguidelines-*,
34+
-cppcoreguidelines-owning-memory,
35+
-cppcoreguidelines-avoid-do-while,
36+
-cppcoreguidelines-avoid-c-arrays,
37+
-cppcoreguidelines-avoid-magic-numbers,
38+
-cppcoreguidelines-init-variables,
39+
-cppcoreguidelines-macro-usage,
40+
-cppcoreguidelines-non-private-member-variables-in-classes,
41+
-cppcoreguidelines-avoid-non-const-global-variables,
42+
-cppcoreguidelines-pro-*

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,37 @@ on:
77
branches: [ main ]
88

99
jobs:
10+
arm64_test:
11+
name: CMake test arm64 (with modern protobuf,grpc and abseil)
12+
runs-on: actuated-arm64-4cpu-16gb
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: 'recursive'
17+
- name: setup
18+
env:
19+
PROTOBUF_VERSION: '23.3'
20+
ABSEIL_CPP_VERSION: '20230125.3'
21+
CXX_STANDARD: '14'
22+
CC: /usr/bin/gcc-10
23+
CXX: /usr/bin/g++-10
24+
run: |
25+
sudo -E ./ci/setup_gcc10.sh
26+
sudo -E ./ci/setup_cmake.sh
27+
sudo -E ./ci/setup_ci_environment.sh
28+
sudo -E ./ci/setup_googletest.sh
29+
sudo -E ./ci/install_abseil.sh
30+
sudo -E ./ci/install_protobuf.sh
31+
- name: run otlp exporter tests
32+
env:
33+
CC: /usr/bin/gcc-10
34+
CXX: /usr/bin/g++-10
35+
WITH_ABSEIL: 'ON'
36+
CXX_STANDARD: '14'
37+
run: |
38+
sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp
39+
./ci/do_ci.sh cmake.exporter.otprotocol.test
40+
1041
cmake_test:
1142
name: CMake test (without otlp-exporter)
1243
runs-on: ubuntu-latest
@@ -537,6 +568,27 @@ jobs:
537568
- name: run tests
538569
run: ./ci/do_ci.sh bazel.test
539570

571+
bazel_no_bzlmod_test:
572+
name: Bazel without bzlmod
573+
runs-on: ubuntu-latest
574+
steps:
575+
- uses: actions/checkout@v4
576+
with:
577+
submodules: 'recursive'
578+
- name: Mount Bazel Cache
579+
uses: actions/cache@v4
580+
env:
581+
cache-name: bazel_cache
582+
with:
583+
path: /home/runner/.cache/bazel
584+
key: bazel_test
585+
- name: setup
586+
run: |
587+
sudo ./ci/setup_ci_environment.sh
588+
sudo ./ci/install_bazelisk.sh
589+
- name: run tests
590+
run: ./ci/do_ci.sh bazel.no_bzlmod.test
591+
540592
bazel_test_async:
541593
name: Bazel with async export
542594
runs-on: ubuntu-latest

.github/workflows/clang-tidy.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: clang-tidy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
clang-tidy:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
17+
- name: Setup Environment
18+
env:
19+
PROTOBUF_VERSION: '23.3'
20+
ABSEIL_CPP_VERSION: '20230125.3'
21+
CXX_STANDARD: '14'
22+
run: |
23+
sudo apt update -y
24+
sudo apt install -y --no-install-recommends --no-install-suggests \
25+
build-essential \
26+
iwyu \
27+
cmake \
28+
libssl-dev \
29+
libcurl4-openssl-dev \
30+
libprotobuf-dev \
31+
protobuf-compiler \
32+
libgmock-dev \
33+
libgtest-dev \
34+
libbenchmark-dev
35+
36+
if ! command -v clang-tidy &> /dev/null; then
37+
echo "clang-tidy could not be found"
38+
exit 1
39+
fi
40+
echo "Using clang-tidy version: $(clang-tidy --version)"
41+
echo "clang-tidy installed at: $(which clang-tidy)"
42+
43+
44+
- name: Prepare CMake
45+
env:
46+
CC: clang
47+
CXX: clang++
48+
run: |
49+
mkdir -p build && cd build
50+
echo "Running cmake..."
51+
cmake .. \
52+
-DCMAKE_CXX_STANDARD=14 \
53+
-DWITH_STL=CXX14 \
54+
-DWITH_OTLP_HTTP=ON \
55+
-DWITH_OTLP_FILE=ON \
56+
-DWITH_PROMETHEUS=ON \
57+
-DWITH_ZIPKIN=ON \
58+
-DWITH_ELASTICSEARCH=ON \
59+
-DWITH_OTLP_HTTP_COMPRESSION=ON \
60+
-DWITH_EXAMPLES=ON \
61+
-DWITH_EXAMPLES_HTTP=ON \
62+
-DBUILD_W3CTRACECONTEXT_TEST=ON \
63+
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
64+
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
65+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
66+
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
67+
68+
- name: Run clang-tidy
69+
run: |
70+
cd build
71+
make 2>&1 | tee -a clang-tidy.log || exit 1
72+
73+
- uses: actions/upload-artifact@v4
74+
with:
75+
name: Logs (clang-tidy)
76+
path: ./build/clang-tidy.log
77+
78+
- name: Count warnings
79+
run: |
80+
cd build
81+
COUNT=$(grep -c "warning:" clang-tidy.log)
82+
echo "clang-tidy reported ${COUNT} warning(s)"
83+
84+
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.

.github/workflows/dependencies_image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: docker/setup-buildx-action@v3
2222
-
2323
name: Build Image
24-
uses: docker/build-push-action@v5
24+
uses: docker/build-push-action@v6
2525
with:
2626
builder: ${{ steps.buildx.outputs.name }}
2727
context: ci/

.github/workflows/iwyu.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,17 @@ jobs:
3636
TOPDIR=`pwd`
3737
mkdir build && cd build
3838
CC="clang" CXX="clang++" cmake \
39+
-DCMAKE_CXX_STANDARD=14 \
40+
-DWITH_STL=CXX14 \
3941
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \
40-
-DBUILD_TESTING=OFF \
41-
-DBUILD_W3CTRACECONTEXT_TEST=OFF \
42+
-DBUILD_TESTING=ON \
43+
-DBUILD_W3CTRACECONTEXT_TEST=ON \
44+
-DWITH_OTLP_GRPC=OFF \
45+
-DWITH_OTLP_HTTP=ON \
46+
-DWITH_OTLP_FILE=ON \
47+
-DWITH_OTLP_HTTP_COMPRESSION=ON \
48+
-DWITH_ZIPKIN=ON \
49+
-DWITH_PROMETHEUS=OFF \
4250
..
4351
4452
- name: iwyu_tool

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
*.app
3838

3939
# Bazel files
40+
MODULE.bazel.lock
4041
/bazel-*
4142

4243
# Mac

.iwyu.imp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77
# Work around for C++ STL
88
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },
99

10-
# Local opentelemetry-cpp
10+
# Local opentelemetry-cpp style
1111

12+
# We prefer to include <gtest/gtest.h> for simplicity
13+
{ "include": ["<gtest/gtest-message.h>", "private", "<gtest/gtest.h>", "public"] },
14+
{ "include": ["<gtest/gtest-test-part.h>", "private", "<gtest/gtest.h>", "public"] },
15+
{ "include": ["<gtest/gtest-param-test.h>", "private", "<gtest/gtest.h>", "public"] },
16+
{ "include": ["<gtest/gtest_pred_impl.h>", "private", "<gtest/gtest.h>", "public"] },
17+
18+
# We prefer to include <gmock/gmock.h> for simplicity
19+
{ "include": ["<gmock/gmock-function-mocker.h>", "private", "<gmock/gmock.h>", "public"] },
20+
{ "include": ["<gmock/gmock-spec-builders.h>", "private", "<gmock/gmock.h>", "public"] },
1221
]
1322

0 commit comments

Comments
 (0)