-
Notifications
You must be signed in to change notification settings - Fork 5k
248 lines (220 loc) · 7.28 KB
/
tdengine-build.yml
File metadata and controls
248 lines (220 loc) · 7.28 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
name: TDengine Build
on:
pull_request:
branches:
- 'main'
- '3.0'
- '3.3.8'
paths-ignore:
- 'docs/**'
- 'packaging/**'
- 'tests/**'
- '**/*.md'
- 'test/**'
- '.github/workflows/**'
- '!.github/workflows/tdengine-build.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Run on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
- macos-14
- macos-15
- windows-2022
env:
TD_CONFIG: Release
steps:
- name: Get CPU Cores
shell: bash
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
CPU_CORES=$(nproc)
elif [ "${{ runner.os }}" == "macOS" ]; then
CPU_CORES=$(sysctl -n hw.ncpu)
elif [ "${{ runner.os }}" == "Windows" ]; then
CPU_CORES=$(powershell -Command "(Get-CimInstance -ClassName Win32_Processor).NumberOfCores")
fi
echo "CPU Cores: $CPU_CORES"
echo "CPU_CORES=$CPU_CORES" >> $GITHUB_ENV
- name: Dump CPU Cores
run: |
echo "The number of CPU cores is: ${{ env.CPU_CORES }}"
- name: prepare install path
if: runner.os == 'macOS'
run: |
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/include
- name: Checkout the repository
uses: actions/checkout@v4
- name: Cache Go modules on Linux and macOS
if: runner.os != 'Windows'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Homebrew on macOS
if: runner.os == 'macOS'
uses: actions/cache@v3
with:
path: /usr/local/Homebrew
key: ${{ runner.os }}-brew-${{ hashFiles('**/Brewfile') }}
restore-keys: |
${{ runner.os }}-brew-
- name: Cache Go modules on Windows
if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: |
C:\Users\runneradmin\go\pkg\mod
C:\Users\runneradmin\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: |
sudo apt update -y
sudo apt install -y \
build-essential \
cmake \
gawk \
libgeos-dev \
libjansson-dev \
liblzma-dev \
libsnappy-dev \
libssl-dev \
libz-dev \
pkg-config \
zlib1g \
groff
- name: Install dependencies on macOS
if: runner.os == 'macOS'
run: |
brew update
brew install \
argp-standalone \
gawk \
gflags \
geos \
jansson \
openssl \
pkg-config \
snappy \
zlib
- name: Show software version
run: |
cmake --version
- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.31.6
- name: Install dependencies on Windows
if: runner.os == 'Windows'
run: |
choco install jom --yes
- name: Cache externals built
uses: actions/cache@v4
id: cache-ext
with:
path: ${{ github.workspace }}/.externals
key: ${{ runner.os }}-${{ matrix.os }}-${{ hashFiles('cmake/external.cmake', 'cmake/in/**') }}-debug-build-ext-v3 # this is tailing cache-version-tick
- if: ${{ steps.cache-ext.outputs.cache-hit != 'true' && runner.os != 'Windows' }}
name: Build externals on Linux and macOS
continue-on-error: false
run: |
./build.sh gen -DTAOSADAPTER_GIT_TAG:STRING=3.3.8
./build.sh bld --target build_externals
- if: ${{ steps.cache-ext.outputs.cache-hit != 'true' && runner.os == 'Windows' }}
name: Build externals on Windows
continue-on-error: false
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
set CL=/MP8
set TD_CONFIG=Release
call .\build.bat gen -G "NMake Makefiles JOM" -DTAOSADAPTER_GIT_TAG:STRING=3.3.8
call .\build.bat bld --target build_externals
- name: Build TDengine on Linux and macOS
if: runner.os != 'Windows'
run: |
./build.sh gen -DTD_EXTERNALS_USE_ONLY:BOOL=ON -DTAOSADAPTER_GIT_TAG:STRING=3.3.8
./build.sh bld
./build.sh install
which taosd
which taosadapter
which taoskeeper
which taos
taosd --help
taosadapter --help
- name: Build and install TDengine on Windows
if: runner.os == 'Windows'
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
set CL=/MP8
set TD_CONFIG=Release
call .\build.bat gen -DTD_EXTERNALS_USE_ONLY:BOOL=ON -G "NMake Makefiles JOM" -DTAOSADAPTER_GIT_TAG:STRING=3.3.8
call .\build.bat bld
call .\build.bat install
echo %PATH%
dir C:\TDengine
set PATH=%PATH%;C:\TDengine
echo %PATH%
where taos.exe
where taosd.exe
where taosadapter.exe
where taoskeeper.exe
taosd.exe --help
taosadapter.exe --help
- name: Statistics ldd
if: runner.os == 'Linux'
run: |
find ${{ github.workspace }}/debug/build/lib -type f -name "*.so" -print0 | xargs -0 ldd || true
find ${{ github.workspace }}/debug/build/bin -type f -print0 | xargs -0 ldd || true
- name: Statistics otool
if: runner.os == 'macOS'
run: |
find ${{ github.workspace }}/debug/build/lib -type f -name "*.dylib" -print0 | xargs -0 otool -L || true
find ${{ github.workspace }}/debug/build/bin -type f -print0 | xargs -0 otool -L || true
- name: Start taosd on Linux and macOS
if: runner.os != 'Windows'
run: |
taosd -V
taosadapter -V
taosBenchmark -V
taos -V
export TAOS_FQDN=localhost
nohup taosd &
nohup taosadapter &
pgrep -l taos
sleep 6 # NOTE: wait for taosd initialization to complete
pgrep -l taos
taos -s "show databases"
taos -s "show dnodes"
- name: Run tests with taosBenchmark
if: runner.os != 'Windows'
run: |
export TAOS_FQDN=localhost
taos -s "show databases"
taosBenchmark -t 10 -n 10 -s 1744951233012 -y
taos -s "select count(*) from test.meters"
- name: Clean up on Linux and macOS
if: runner.os != 'Windows'
run: |
./build.sh stop