Skip to content

Commit 6d0f68d

Browse files
authored
ci(v3): test windows-cmake using gha (#15951)
1 parent 9d1230a commit 6d0f68d

File tree

8 files changed

+157
-60
lines changed

8 files changed

+157
-60
lines changed

.github/workflows/test-runner.yml

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,17 @@ jobs:
8888
execute-integration-tests: true
8989
secrets: inherit
9090
windows-bazel:
91+
# Disabled
92+
if: false
9193
# Build the full matrix only on push events to the default branch, or
9294
# when PR gets the has a `gha:full-build` label, or when it had the
9395
# label already and it gets a new commit.
94-
if: |-
95-
${{
96-
github.event_name == 'schedule' ||
97-
github.event_name == 'push' ||
98-
contains(github.event.pull_request.labels.*.name, 'gha:full-build')
99-
}}
96+
# if: |-
97+
# ${{
98+
# github.event_name == 'schedule' ||
99+
# github.event_name == 'push' ||
100+
# contains(github.event.pull_request.labels.*.name, 'gha:full-build')
101+
# }}
100102
name: Windows-Bazel
101103
needs: [pre-flight]
102104
uses: ./.github/workflows/windows-bazel.yml
@@ -127,8 +129,6 @@ jobs:
127129
execute-integration-tests: true
128130
secrets: inherit
129131
windows-cmake:
130-
# Disabled
131-
if: false
132132
name: Windows-CMake
133133
needs: [pre-flight]
134134
uses: ./.github/workflows/windows-cmake.yml
@@ -147,39 +147,3 @@ jobs:
147147
vcpkg-cache-mode: 'readwrite'
148148
execute-integration-tests: true
149149
secrets: inherit
150-
notify:
151-
name: Notify-Google-Chat
152-
# Wait until all the other jobs have completed.
153-
needs:
154-
# macos-bazel is disabled
155-
# macos-cmake is disabled
156-
- windows-bazel
157-
# windows-cmake is disabled is disabled
158-
# Run even if the other jobs failed or were skipped.
159-
if: always()
160-
runs-on: ubuntu-latest
161-
steps:
162-
- name: Notify Google Chat
163-
shell: bash
164-
run: |
165-
event_name="${{ github.event_name }}"
166-
case "${event_name}" in
167-
schedule)
168-
;;
169-
push)
170-
;;
171-
*)
172-
exit 0
173-
;;
174-
esac
175-
failure="${{ contains(needs.*.result, 'failure') }}"
176-
cancelled="${{ contains(needs.*.result, 'cancelled') }}"
177-
status=""
178-
# Report whether any of the jobs failed or were cancelled.
179-
if [[ "${cancelled}" == "true" ]]; then status="cancelled"; fi
180-
if [[ "${failure}" == "true" ]]; then status="failure"; fi
181-
# Exit early if there is nothing interesting to report.
182-
if [[ -z "${status}" ]]; then exit 0; fi
183-
printf '{"text": "GHA Build %s %s/%s/actions/runs/%s"}' \
184-
"${status}" "${{ github.server_url }}" "${{ github.repository }}" "${{ github.run_id }}" |
185-
curl -fsX POST -o /dev/null -d@- -H "Content-Type: application/json; charset=UTF-8" '${{ secrets.CLOUD_CPP_BUILD_ALERTS_WEBHOOK }}'

.github/workflows/windows-cmake.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
msvc: [ msvc-2022 ]
4242
build_type: [ Release ]
4343
arch: [ x64 ]
44-
shard: [ Core3, Core4 ]
44+
shard: [ Core1, Core2, Core3, Core4, Core5, Compute, AIPlatform, Shard1, Shard2, Shard3, Shard4, Shard5 ]
4545
exclude:
4646
# Also skip shards (Compute and Other) that contain only generated code.
4747
- exclude-from-full-trick: ${{ ! inputs.full-matrix }}
@@ -103,6 +103,7 @@ jobs:
103103
dataproc
104104
discoveryengine
105105
monitoring
106+
opentelemetry
106107
retail
107108
sql
108109
dialogflow_cx
@@ -209,6 +210,8 @@ jobs:
209210
universe_domain
210211
)
211212
shard5_features=(
213+
asset
214+
channel
212215
video
213216
datacatalog
214217
iam
@@ -269,10 +272,6 @@ jobs:
269272
skipped_features+=("${shard3_features[@]}")
270273
skipped_features+=("${shard4_features[@]}")
271274
skipped_features+=("${shard5_features[@]}")
272-
# We use vcpkg in this build, which ships with Protobuf v21.x.
273-
# Both `asset` and `channel` require Protobuf >= 23.x to compile on
274-
# Windows.
275-
skipped_features+=(asset channel)
276275
skipped="$(printf ",-%s" "${skipped_features[@]}")"
277276
echo "features=__ga_libraries__,__experimental_libraries__,${skipped:1}" >> "${GITHUB_OUTPUT}"
278277
fi

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ if (APPLE
9797
" cmake -DGOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK=OFF ...")
9898
endif ()
9999

100+
if (WIN32)
101+
add_definitions(-DNOMINMAX)
102+
endif ()
103+
100104
# If ccache is installed use it for the build.
101105
option(GOOGLE_CLOUD_CPP_ENABLE_CCACHE "Automatically use ccache if available"
102106
OFF)

ci/etc/vcpkg-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.10.17
1+
3895230f38e498525f2560a281223d12066fa74a

ci/gha/builds/lib/cmake.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function cmake::common_args() {
4444
fi
4545
local args
4646
args=(
47+
-DCMAKE_CXX_STANDARD=17
4748
-DGOOGLE_CLOUD_CPP_ENABLE_CCACHE=OFF
4849
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=ON
4950
-GNinja
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/cmake/opentracing-cpp.cmake b/cmake/opentracing-cpp.cmake
2+
index f014ecd..fd8898a 100644
3+
--- a/cmake/opentracing-cpp.cmake
4+
+++ b/cmake/opentracing-cpp.cmake
5+
@@ -1,7 +1,11 @@
6+
# Copyright The OpenTelemetry Authors
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
-find_package(OpenTracing CONFIG QUIET)
10+
+find_package(OpenTracing CONFIG REQUIRED)
11+
+if(NOT TARGET OpenTracing::opentracing AND TARGET OpenTracing::opentracing-static)
12+
+ add_library(OpenTracing::opentracing ALIAS OpenTracing::opentracing-static)
13+
+endif()
14+
+
15+
set(OpenTracing_PROVIDER "find_package")
16+
17+
if(NOT OpenTracing_FOUND)

ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/portfile.cmake

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ vcpkg_from_github(
1010
REF
1111
"v${VERSION}"
1212
SHA512
13-
c93005c9b24b358a9998141f6c7fd9675778731775dacaad18f0e81117fd00aaabff371c04cf96688a9c86117727181052a141d961d4db28fc457b454351c570
13+
6dc0357d8b3410852d3f970f72b8bec59dba9d6c533ca600432102e65de161903bd9170d98cef7ff0af5191309577ffd2a69ccd004b840914a910a6a282204e4
1414
HEAD_REF
1515
main
1616
PATCHES
17-
# Missing find_dependency for Abseil
18-
add-missing-find-dependency.patch)
17+
fix-target_link.patch)
1918

2019
vcpkg_check_features(
2120
OUT_FEATURE_OPTIONS
@@ -29,6 +28,8 @@ vcpkg_check_features(
2928
WITH_PROMETHEUS
3029
elasticsearch
3130
WITH_ELASTICSEARCH
31+
otlp-file
32+
WITH_OTLP_FILE
3233
otlp-http
3334
WITH_OTLP_HTTP
3435
otlp-grpc
@@ -37,22 +38,26 @@ vcpkg_check_features(
3738
WITH_GENEVA
3839
user-events
3940
WITH_USER_EVENTS
41+
opentracing
42+
WITH_OPENTRACING
4043
INVERTED_FEATURES
4144
user-events
4245
BUILD_TRACEPOINTS)
4346

4447
# opentelemetry-proto is a third party submodule and opentelemetry-cpp release
4548
# did not pack it.
46-
if (WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
47-
set(OTEL_PROTO_VERSION "1.3.1")
49+
if (WITH_OTLP_FILE
50+
OR WITH_OTLP_GRPC
51+
OR WITH_OTLP_HTTP)
52+
set(OTEL_PROTO_VERSION "1.6.0")
4853
vcpkg_download_distfile(
4954
ARCHIVE
5055
URLS
5156
"https://github.com/open-telemetry/opentelemetry-proto/archive/v${OTEL_PROTO_VERSION}.tar.gz"
5257
FILENAME
5358
"opentelemetry-proto-${OTEL_PROTO_VERSION}.tar.gz"
5459
SHA512
55-
8c75e4ff79c4b5b251e0ec8ece92ec901d70ec601644505ffdd137fb728daac91fd9203e1f448500124906737d91d80f10b694977688c655418b94f61c828d06
60+
0e72e0c32d2d699d7a832a4c57a9dbe60e844d4c4e8d7b39eb45e4282cde89fccfeef893eae70b9d018643782090a7228c3ef60863b00747498e80f0cf1db8ae
5661
)
5762

5863
vcpkg_extract_source_archive(src ARCHIVE "${ARCHIVE}")
@@ -62,13 +67,13 @@ if (WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
6267
# Create empty .git directory to prevent opentelemetry from cloning it
6368
# during build time
6469
file(MAKE_DIRECTORY "${SOURCE_PATH}/third_party/opentelemetry-proto/.git")
65-
list(APPEND FEATURE_OPTIONS -DCMAKE_CXX_STANDARD=14)
6670
list(
6771
APPEND
6872
FEATURE_OPTIONS
6973
"-DgRPC_CPP_PLUGIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/grpc/grpc_cpp_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX}"
7074
)
7175
endif ()
76+
list(APPEND FEATURE_OPTIONS -DCMAKE_CXX_STANDARD=17 -DWITH_STL=CXX17)
7277

7378
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "OFF")
7479

@@ -111,15 +116,14 @@ vcpkg_cmake_configure(
111116
-DBUILD_TESTING=OFF
112117
-DWITH_EXAMPLES=OFF
113118
-DOPENTELEMETRY_INSTALL=ON
114-
-DWITH_STL=CXX14
115-
-DWITH_ABSEIL=ON
116119
-DWITH_BENCHMARK=OFF
117120
-DOPENTELEMETRY_EXTERNAL_COMPONENT_PATH=${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}
118121
${FEATURE_OPTIONS}
119122
MAYBE_UNUSED_VARIABLES
120123
WITH_GENEVA
121124
WITH_USER_EVENTS
122-
BUILD_TRACEPOINTS)
125+
BUILD_TRACEPOINTS
126+
gRPC_CPP_PLUGIN_EXECUTABLE)
123127

124128
vcpkg_cmake_install()
125129
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
3+
"name": "opentelemetry-cpp",
4+
"version-semver": "1.23.0",
5+
"description": [
6+
"OpenTelemetry is a collection of tools, APIs, and SDKs.",
7+
"You use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis in order to understand your software's performance and behavior."
8+
],
9+
"homepage": "https://github.com/open-telemetry/opentelemetry-cpp",
10+
"license": "Apache-2.0",
11+
"dependencies": [
12+
"abseil",
13+
"nlohmann-json",
14+
{
15+
"name": "vcpkg-cmake",
16+
"host": true
17+
},
18+
{
19+
"name": "vcpkg-cmake-config",
20+
"host": true
21+
}
22+
],
23+
"features": {
24+
"elasticsearch": {
25+
"description": "Whether to include the Elasticsearch Client in the SDK",
26+
"dependencies": [
27+
{
28+
"name": "curl",
29+
"default-features": false
30+
}
31+
]
32+
},
33+
"etw": {
34+
"description": "Whether to include the ETW Exporter in the SDK",
35+
"supports": "windows"
36+
},
37+
"geneva": {
38+
"description": "Whether to include the Geneva Exporter from the opentelemetry-cpp-contrib repository",
39+
"dependencies": [
40+
{
41+
"name": "opentelemetry-cpp",
42+
"features": [
43+
"etw"
44+
],
45+
"platform": "windows"
46+
},
47+
"opentelemetry-cpp-contrib-version"
48+
]
49+
},
50+
"opentracing": {
51+
"description": "Whether to include the Opentracing shim",
52+
"dependencies": [
53+
"opentracing"
54+
]
55+
},
56+
"otlp-file": {
57+
"description": "Whether to include the OpenTelemetry Protocol to File exporter in the SDK",
58+
"supports": "!uwp",
59+
"dependencies": [
60+
"protobuf"
61+
]
62+
},
63+
"otlp-grpc": {
64+
"description": "Whether to include the OTLP gRPC exporter in the SDK",
65+
"dependencies": [
66+
"grpc",
67+
{
68+
"name": "grpc",
69+
"host": true
70+
}
71+
]
72+
},
73+
"otlp-http": {
74+
"description": "Whether to include the OpenTelemetry Protocol over HTTP in the SDK",
75+
"dependencies": [
76+
"curl",
77+
"protobuf"
78+
]
79+
},
80+
"prometheus": {
81+
"description": "Whether to include the Prometheus Client in the SDK",
82+
"dependencies": [
83+
"prometheus-cpp"
84+
]
85+
},
86+
"user-events": {
87+
"description": "Whether to include the User Events Exporter from the opentelemetry-cpp-contrib repository",
88+
"supports": "linux",
89+
"dependencies": [
90+
"libeventheader-tracepoint",
91+
"libtracepoint",
92+
{
93+
"name": "opentelemetry-cpp",
94+
"features": [
95+
"otlp-http"
96+
]
97+
},
98+
"opentelemetry-cpp-contrib-version"
99+
]
100+
},
101+
"zipkin": {
102+
"description": "Whether to include the Zipkin exporter in the SDK",
103+
"dependencies": [
104+
"curl"
105+
]
106+
}
107+
}
108+
}

0 commit comments

Comments
 (0)