From 262aacf4577c155e6dfec5d874a173f81eeb26cc Mon Sep 17 00:00:00 2001 From: Cengizhan Pasaoglu Date: Tue, 4 Jul 2023 11:19:13 +0200 Subject: [PATCH] Fix scripts after review comments #2114 --- .github/workflows/benchmark.yml | 2 -- .github/workflows/ci.yml | 22 ++-------------------- .github/workflows/codeql-analysis.yml | 1 - CMakeLists.txt | 2 +- ci/setup_cmake.sh | 13 ++++++++----- 5 files changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9823252c58..cc63677a24 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ace58fe8dc..99b7e71247 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -293,6 +283,7 @@ jobs: env: CC: /usr/bin/gcc-4.8 CXX: /usr/bin/g++-4.8 + GOOGLETEST_VERSION: 1.10.0 run: ./ci/do_ci.sh cmake.legacy.test cmake_gcc_48_otlp_exporter_test: @@ -321,6 +312,7 @@ jobs: env: CC: /usr/bin/gcc-4.8 CXX: /usr/bin/g++-4.8 + GOOGLETEST_VERSION: 1.10.0 run: ./ci/do_ci.sh cmake.legacy.exporter.otprotocol.test cmake_test_cxx20_gcc: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b751e6d407..8d0071ce11 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index db42f74a33..ee0009a452 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -512,7 +512,7 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}") include(CTest) if(BUILD_TESTING) - set(CMAKE_CXX_STANDARD 20) + set(CMAKE_CXX_STANDARD 14) add_definitions(-DENABLE_TEST) if(EXISTS ${CMAKE_BINARY_DIR}/lib/libgtest.a) # Prefer GTest from build tree. GTest is not always working with diff --git a/ci/setup_cmake.sh b/ci/setup_cmake.sh index 02f6a20f7d..7c96d17c88 100755 --- a/ci/setup_cmake.sh +++ b/ci/setup_cmake.sh @@ -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() {