Skip to content

Commit

Permalink
Fix scripts after review comments #2114
Browse files Browse the repository at this point in the history
  • Loading branch information
cngzhnp committed Jul 4, 2023
1 parent 9e0ddaf commit 8900a2f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 32 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
path: /home/runner/.cache/bazel
key: bazel_benchmark
- name: setup
env:
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand Down
22 changes: 2 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand Down Expand Up @@ -77,7 +76,6 @@ jobs:
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
GOOGLETEST_VERSION: 1.13.0
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
Expand Down Expand Up @@ -110,7 +108,6 @@ jobs:
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
GOOGLETEST_VERSION: 1.13.0
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
Expand Down Expand Up @@ -143,7 +140,6 @@ jobs:
env:
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
GOOGLETEST_VERSION: 1.13.0
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
Expand Down Expand Up @@ -176,7 +172,6 @@ jobs:
env:
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
GOOGLETEST_VERSION: 1.13.0
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
Expand Down Expand Up @@ -223,7 +218,6 @@ jobs:
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand All @@ -242,8 +236,6 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand All @@ -260,8 +252,6 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand All @@ -287,6 +277,7 @@ jobs:
env:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8
GOOGLETEST_VERSION: 1.10.0
run: |
sudo -E ./ci/setup_cmake.sh
- name: run tests
Expand Down Expand Up @@ -314,6 +305,7 @@ jobs:
env:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8
GOOGLETEST_VERSION: 1.10.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_grpc.sh -v 4.8
Expand All @@ -333,7 +325,6 @@ jobs:
- name: setup
env:
CMAKE_VERSION: 3.20.6
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
Expand All @@ -355,7 +346,6 @@ jobs:
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
CMAKE_VERSION: 3.20.6
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
Expand All @@ -380,8 +370,6 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand All @@ -398,8 +386,6 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand All @@ -416,8 +402,6 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand All @@ -437,7 +421,6 @@ jobs:
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand Down Expand Up @@ -767,7 +750,6 @@ jobs:
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
GOOGLETEST_VERSION: 1.13.0
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")

include(CTest)
if(BUILD_TESTING)
set(CMAKE_CXX_STANDARD 20)
add_definitions(-DENABLE_TEST)
if(EXISTS ${CMAKE_BINARY_DIR}/lib/libgtest.a)
# Prefer GTest from build tree. GTest is not always working with
Expand Down
17 changes: 14 additions & 3 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ if [[ "$1" == "cmake.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_PROMETHEUS=ON \
-DWITH_ZIPKIN=ON \
-DWITH_ELASTICSEARCH=ON \
Expand All @@ -93,6 +94,7 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
Expand All @@ -115,6 +117,7 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
Expand Down Expand Up @@ -160,6 +163,7 @@ elif [[ "$1" == "cmake.with_async_export.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_PROMETHEUS=ON \
-DWITH_ZIPKIN=ON \
-DWITH_ELASTICSEARCH=ON \
Expand All @@ -175,6 +179,7 @@ elif [[ "$1" == "cmake.abseil.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DWITH_LOGS_PREVIEW=ON \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
Expand All @@ -188,6 +193,7 @@ elif [[ "$1" == "cmake.opentracing_shim.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_CXX_FLAGS="-Werror -Wno-error=redundant-move $CXXFLAGS" \
-DWITH_OPENTRACING=ON \
"${SRC_DIR}"
Expand All @@ -198,9 +204,9 @@ elif [[ "$1" == "cmake.c++20.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DCMAKE_CXX_STANDARD=20 \
"${SRC_DIR}"
make -j $(nproc)
make test
Expand All @@ -209,11 +215,11 @@ elif [[ "$1" == "cmake.c++20.stl.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=20 \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DWITH_LOGS_PREVIEW=ON \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DCMAKE_CXX_STANDARD=20 \
-DWITH_STL=ON \
"${SRC_DIR}"
make -j $(nproc)
Expand All @@ -225,8 +231,8 @@ elif [[ "$1" == "cmake.legacy.test" ]]; then
export BUILD_ROOT="${BUILD_DIR}"
${SRC_DIR}/tools/build-benchmark.sh
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
-DCMAKE_CXX_STANDARD=11 \
-DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS" \
"${SRC_DIR}"
make -j $(nproc)
make test
Expand All @@ -252,6 +258,7 @@ elif [[ "$1" == "cmake.exporter.otprotocol.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON \
Expand All @@ -266,6 +273,7 @@ elif [[ "$1" == "cmake.exporter.otprotocol.shared_libs.with_static_grpc.test" ]]
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DBUILD_SHARED_LIBS=ON \
Expand All @@ -280,6 +288,7 @@ elif [[ "$1" == "cmake.exporter.otprotocol.with_async_export.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
Expand All @@ -294,6 +303,7 @@ elif [[ "$1" == "cmake.do_not_install.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
Expand Down Expand Up @@ -420,6 +430,7 @@ elif [[ "$1" == "code.coverage" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_CXX_FLAGS="-Werror --coverage $CXXFLAGS" \
"${SRC_DIR}"
make
Expand Down
13 changes: 8 additions & 5 deletions ci/setup_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ export DEBIAN_FRONTEND=noninteractive
apt-get update

if [ "x$CMAKE_VERSION" = "x" ]; then
# By default, CMake version set the following version.
export CMAKE_VERSION=3.15.2
fi

# This variable not set on CI pipeline for only legacy environment(GCC 4.8).
# With 1.13.0 version, C++14 must be set which does not supported by legacy environment anymore.
# Also with this version, release version path needs to be adapted.
if [ "x$GOOGLETEST_VERSION" = "x" ]; then
export GOOGLETEST_VERSION=1.10.0
GOOGLETEST_VERSION_PATH="release-${GOOGLETEST_VERSION}"
GOOGLETEST_FOLDER_PATH="googletest-release-${GOOGLETEST_VERSION}"
else
if [ -z "${GOOGLETEST_VERSION}" ]; then
# By default, GoogleTest version set the following version.
export GOOGLETEST_VERSION=1.13.0
GOOGLETEST_VERSION_PATH="v${GOOGLETEST_VERSION}"
GOOGLETEST_FOLDER_PATH="googletest-${GOOGLETEST_VERSION}"
else
GOOGLETEST_VERSION_PATH="release-${GOOGLETEST_VERSION}"
GOOGLETEST_FOLDER_PATH="googletest-release-${GOOGLETEST_VERSION}"

fi

cmake_install() {
Expand Down

0 comments on commit 8900a2f

Please sign in to comment.