Skip to content

Commit

Permalink
[CI] Use platform CMake (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored Apr 4, 2024
1 parent e86ceba commit 848db57
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 77 deletions.
60 changes: 22 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
env:
Expand All @@ -41,7 +41,7 @@ jobs:
CXX: /usr/bin/g++-13
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode, sync)
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
CXX: /usr/bin/g++-13
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode, async)
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
CXX: /usr/bin/clang++-15
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, sync)
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
CXX: /usr/bin/clang++-15
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, async)
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
CXX: /usr/bin/clang++-15
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, abiv2)
Expand Down Expand Up @@ -197,7 +197,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
- name: run tests
run: ./ci/do_ci.ps1 cmake.maintainer.test
Expand All @@ -211,7 +210,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
- name: run tests
env:
Expand All @@ -230,7 +228,7 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
env:
Expand All @@ -248,7 +246,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (enable abseil-cpp)
run: |
Expand All @@ -264,7 +262,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake tests (enable opentracing-shim)
run: ./ci/do_ci.sh cmake.opentracing_shim.test
Expand All @@ -277,11 +275,9 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests (enable stl)
env:
CXX_STANDARD: '14'
Expand All @@ -295,11 +291,9 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests (enable stl)
env:
CXX_STANDARD: '17'
Expand All @@ -313,11 +307,9 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CXX_STANDARD: '20'
Expand All @@ -339,10 +331,9 @@ jobs:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CC: /usr/bin/clang
Expand All @@ -366,11 +357,9 @@ jobs:
with:
submodules: 'recursive'
- name: setup
env:
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CXX_STANDARD: '23'
Expand All @@ -392,10 +381,9 @@ jobs:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CXXFLAGS: "-stdlib=libc++"
CMAKE_VERSION: 3.20.6
run: |
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
- name: run tests
env:
CC: /usr/bin/clang
Expand All @@ -420,7 +408,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run otlp exporter tests
run: |
Expand All @@ -440,7 +428,7 @@ jobs:
ABSEIL_CPP_VERSION: '20230125.3'
CXX_STANDARD: '14'
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_googletest.sh
sudo ./ci/setup_ci_environment.sh
sudo -E ./ci/install_abseil.sh
sudo -E ./ci/install_protobuf.sh
Expand All @@ -461,7 +449,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run otlp exporter tests
run: |
Expand All @@ -477,7 +465,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run otlp exporter tests
run: |
Expand All @@ -493,7 +481,7 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run cmake install (with abseil)
run: |
Expand All @@ -515,7 +503,7 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run tests
env:
Expand Down Expand Up @@ -763,7 +751,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
./ci/install_windows_protobuf.ps1
- name: run cmake test
Expand All @@ -780,7 +767,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
./ci/install_windows_protobuf.ps1
- name: run cmake test (DLL build)
Expand All @@ -799,7 +785,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
./ci/install_windows_protobuf.ps1
- name: run cmake test
Expand Down Expand Up @@ -829,7 +814,6 @@ jobs:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
- name: run tests
run: ./ci/do_ci.ps1 cmake.test_example_plugin
Expand All @@ -846,7 +830,7 @@ jobs:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: run tests and generate report
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
CXX: /usr/bin/g++-10
GOOGLETEST_VERSION: 1.12.1
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Increment the:
[#2530](https://github.com/open-telemetry/opentelemetry-cpp/pull/2530)
* [EXPORTER] Support URL-encoded values for `OTEL_EXPORTER_OTLP_HEADERS`
[#2579](https://github.com/open-telemetry/opentelemetry-cpp/pull/2579)
* [CI] Use platform CMake
[#2627](https://github.com/open-telemetry/opentelemetry-cpp/pull/2627)

Important changes:

Expand All @@ -34,6 +36,13 @@ Important changes:
dependency on zlib.
* [SDK] Change OTLP HTTP content_type default to binary
[#2558](https://github.com/open-telemetry/opentelemetry-cpp/pull/2558)
* [CI] Use platform CMake
[#2627](https://github.com/open-telemetry/opentelemetry-cpp/pull/2627)
* The `CI` in github no longer install a different version of `cmake`.
* It now always use the `cmake` provided by the platform.
* As part of this change, the script `ci/setup_cmake.sh` was renamed
to `ci/setup_googletest.sh`, for clarity, now that this script
only installs googletest.

## [1.14.2] 2024-02-27

Expand Down
18 changes: 0 additions & 18 deletions ci/setup_cmake.sh → ci/setup_googletest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ set -e
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.16.3
fi

if [ -z "${GOOGLETEST_VERSION}" ]; then
# Version by default. Requires C++14.
export GOOGLETEST_VERSION=1.14.0
Expand All @@ -30,17 +25,6 @@ else
GOOGLETEST_FOLDER_PATH="googletest-${GOOGLETEST_VERSION}"
fi

cmake_install()
{
tmp_dir=$(mktemp -d)
pushd $tmp_dir
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh
chmod +x cmake-${CMAKE_VERSION}-Linux-x86_64.sh
./cmake-${CMAKE_VERSION}-Linux-x86_64.sh --prefix=/usr/local --skip-license
rm cmake-${CMAKE_VERSION}-Linux-x86_64.sh
popd
}

googletest_install()
{
# Follows these instructions
Expand All @@ -58,8 +42,6 @@ googletest_install()
popd
}

cmake_install

set +e
echo \
libbenchmark-dev \
Expand Down
20 changes: 0 additions & 20 deletions ci/setup_windows_cmake.ps1

This file was deleted.

1 comment on commit 848db57

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 848db57 Previous: e86ceba Ratio
BM_ThreadYieldSpinLockThrashing/1/process_time/real_time 26.052284240722656 ms/iter 6.097457625649192 ms/iter 4.27

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.