-
Notifications
You must be signed in to change notification settings - Fork 1.1k
199 lines (189 loc) · 7.42 KB
/
Copy pathmulti-language-client.yml
File metadata and controls
199 lines (189 loc) · 7.42 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Multi-Language Client
on:
push:
branches:
- master
- "rc/*"
paths:
- 'pom.xml'
- 'iotdb-client/pom.xml'
- 'iotdb-client/client-py/**'
- '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/multi-language-client.yml'
pull_request:
branches:
- master
- "rc/*"
- 'force_ci/**'
paths:
- 'pom.xml'
- 'iotdb-client/pom.xml'
- 'iotdb-client/client-py/**'
- '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/multi-language-client.yml'
# allow manually run the action:
workflow_dispatch:
concurrency:
group: ${{ 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:
cpp:
strategy:
fail-fast: false
max-parallel: 15
matrix:
os: [ubuntu-22.04, ubuntu-24.04, windows-2022, windows-latest, windows-2025-vs2026, macos-latest]
runs-on: ${{ matrix.os}}
steps:
- uses: actions/checkout@v5
- name: Install CPP Dependencies (Ubuntu)
if: runner.os == 'Linux'
shell: bash
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y libboost-all-dev openssl libssl-dev wget
# jammy (22.04): no clang-format-17 in default repos — use apt.llvm.org (same LLVM 17 as noble/choco/brew)
. /etc/os-release
if [[ "${VERSION_CODENAME}" == "jammy" ]]; then
wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
chmod +x /tmp/llvm.sh
sudo DEBIAN_FRONTEND=noninteractive /tmp/llvm.sh 17
else
sudo apt-get install -y clang-format-17
fi
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 100
sudo update-alternatives --set clang-format /usr/bin/clang-format-17
clang-format --version
- name: Install CPP Dependencies (Mac)
# remove some xcode to release disk space
if: runner.os == 'macOS'
shell: bash
run: |
brew install boost
brew install openssl llvm@17
ln -sf "$(brew --prefix llvm@17)/bin/clang-format" "$(brew --prefix)/bin/clang-format"
echo "$(brew --prefix llvm@17)/bin" >> "$GITHUB_PATH"
clang-format --version
sudo rm -rf /Applications/Xcode_14.3.1.app
sudo rm -rf /Applications/Xcode_15.0.1.app
sudo rm -rf /Applications/Xcode_15.1.app
sudo rm -rf /Applications/Xcode_15.2.app
sudo rm -rf /Applications/Xcode_15.3.app
- name: Install CPP Dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install winflexbison3 -y
choco install boost-msvc-14.3 -y
$boost_path = (Get-ChildItem -Path 'C:\local\' -Filter 'boost_*').FullName
echo $boost_path >> $env:GITHUB_PATH
choco install openssl -y
$sslPath = (Get-ChildItem 'C:\Program Files\OpenSSL*' -Directory | Select-Object -First 1).FullName
echo "$sslPath\bin" >> $env:GITHUB_PATH
echo "OPENSSL_ROOT_DIR=$sslPath" >> $env:GITHUB_ENV
choco install llvm --version=17.0.6 --force -y
clang-format --version
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Check C++ format (Spotless)
shell: bash
run: |
./mvnw -P with-cpp -pl iotdb-client/client-cpp spotless:check
./mvnw -P with-cpp -pl example/client-cpp-example spotless:check
- name: Build IoTDB server
shell: bash
run: ./mvnw clean install -pl distribution -am -DskipTests
- name: Test with Maven
shell: bash
# Explicitly using mvnw here as the build requires maven 3.9 and the default installation is older
# Explicitly using "install" instead of package in order to be sure we're using libs built on this machine
# (was causing problems on windows, but could cause problem on linux, when updating the thrift module)
run: |
if [[ "${{ matrix.os }}" == "windows-2025-vs2026" ]]; then
./mvnw clean verify -P with-cpp -pl iotdb-client/client-cpp,example/client-cpp-example -am -Dcmake.generator="Visual Studio 18 2026"
else
./mvnw clean verify -P with-cpp -pl iotdb-client/client-cpp,example/client-cpp-example -am
fi
- name: Upload Artifact
if: failure()
uses: actions/upload-artifact@v6
with:
name: cpp-IT-${{ runner.os }}
path: distribution/target/apache-iotdb-*-all-bin/apache-iotdb-*-all-bin/logs
retention-days: 1
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
token: ${{secrets.GITHUB_TOKEN}}
submodules: recursive
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Compile IoTDB Server
run: mvn clean package -pl distribution -am -DskipTests
- name: Integration test
shell: bash
run: |
cd iotdb-client
git clone https://github.com/apache/iotdb-client-go.git
cd iotdb-client-go
make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo
python:
strategy:
fail-fast: false
max-parallel: 15
matrix:
python: ['3.x']
runs-on: ${{ 'ubuntu-latest' }}
steps:
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- uses: actions/checkout@v5
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Cache pip packages
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Build IoTDB server distribution zip and python client
run: mvn -B clean install -pl distribution,iotdb-client/client-py -am -DskipTests
- name: Build IoTDB server docker image
run: |
docker build . -f docker/src/main/Dockerfile-1c1d -t "iotdb:dev"
docker images
- name: Install IoTDB python client requirements
run: pip3 install -r iotdb-client/client-py/requirements_dev.txt
- name: Check code style
if: ${{ matrix.python == '3.x'}}
shell: bash
run: black iotdb-client/client-py/ --check --diff
- name: Integration test and test make package
shell: bash
run: |
cd iotdb-client/client-py/ && pytest .
./release.sh