-
Notifications
You must be signed in to change notification settings - Fork 1.1k
132 lines (120 loc) · 4.49 KB
/
Copy pathclient-cpp-source-build.yml
File metadata and controls
132 lines (120 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Fast signal workflow for source-build viability.
# Verifies client-cpp can fetch/build dependencies from source on each OS.
# This complements (not replaces) the packaging matrix workflow.
name: C++ Client source build
on:
push:
branches:
- master
- "rc/*"
paths:
- "iotdb-client/pom.xml"
- "iotdb-client/client-cpp/**"
- "example/client-cpp-example/**"
- "iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift"
- "iotdb-protocol/thrift-commons/src/main/thrift/common.thrift"
- ".github/workflows/client-cpp-source-build.yml"
- ".github/workflows/client-cpp-package.yml"
- ".github/scripts/package-client-cpp-*.sh"
pull_request:
branches:
- master
- "rc/*"
- "force_ci/**"
paths:
- "iotdb-client/pom.xml"
- "iotdb-client/client-cpp/**"
- "example/client-cpp-example/**"
- "iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift"
- "iotdb-protocol/thrift-commons/src/main/thrift/common.thrift"
- ".github/workflows/client-cpp-source-build.yml"
- ".github/workflows/client-cpp-package.yml"
- ".github/scripts/package-client-cpp-*.sh"
workflow_dispatch:
concurrency:
group: client-cpp-source-build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
MAVEN_ARGS: --batch-mode --no-transfer-progress
jobs:
source-build:
name: Source build (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- name: linux
runs-on: ubuntu-22.04
- name: macos
runs-on: macos-latest
- name: windows-vs2022
runs-on: windows-2022
cmake_generator: ""
- name: windows-vs2026
runs-on: windows-2025-vs2026
cmake_generator: Visual Studio 18 2026
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v5
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Install minimal toolchain (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
set -euxo pipefail
sudo apt-get update
# Compiler + CMake only; Boost/flex/bison/m4 come from CMake fetch.
sudo apt-get install -y build-essential cmake wget
- name: Install minimal toolchain (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
set -euxo pipefail
# Xcode CLT ships bison 2.3 which cannot build Thrift 0.21.0 (%code).
brew install bison cmake
echo "$(brew --prefix bison)/bin" >> "$GITHUB_PATH"
bison --version
- name: Install minimal toolchain (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
# No choco boost / winflexbison: CMake downloads into third-party/windows/.
Write-Host "Using preinstalled VS + CMake on the runner image."
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-${{ runner.arch }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-m2-
- name: Configure and build (CMake fetch, online)
# Keep this job focused on buildability; package workflow validates release classifiers.
shell: bash
env:
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
run: |
set -euxo pipefail
MVN_ARGS=(./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests)
MVN_ARGS+=("-Diotdb.offline=OFF" "-Dspotless.skip=true")
if [ -n "${CMAKE_GENERATOR:-}" ]; then
MVN_ARGS+=("-Dcmake.generator=${CMAKE_GENERATOR}")
fi
"${MVN_ARGS[@]}"
- name: Verify install artifacts
shell: bash
run: |
set -euxo pipefail
INSTALL="iotdb-client/client-cpp/target/install"
if [ "${{ runner.os }}" = "Windows" ]; then
test -d "${INSTALL}/include"
ls "${INSTALL}/lib/iotdb_session.dll" "${INSTALL}/lib/iotdb_session.lib"
else
test -f "${INSTALL}/lib/libiotdb_session.so" \
|| test -f "${INSTALL}/lib/libiotdb_session.dylib"
fi
ls -la "${INSTALL}/include" | head -20