blob: 57730c076fdefc5dde45a6d392eb776ee0c8322f [file] [log] [blame]
Jiayu Liubcac9782022-05-07 08:35:09 +08001name: "Build"
Jiayu Liuc77d91a2022-05-03 20:55:50 +08002
Jiayu Liu6a61c4e2022-04-29 01:25:39 +08003on:
4 push:
Jiayu Liubcac9782022-05-07 08:35:09 +08005 branches: ["*"]
Jiayu Liu6a61c4e2022-04-29 01:25:39 +08006 pull_request:
Jiayu Liubcac9782022-05-07 08:35:09 +08007 branches: ["*"]
Jiayu Liuc77d91a2022-05-03 20:55:50 +08008
9env:
Jiayu Liuab83ffc2022-05-10 01:56:30 +080010 BUILD_DEPS: automake bison flex git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config
Jiayu Liu1e3d90d2023-04-14 23:57:33 +080011 CONFIG_ARGS_FOR_LIBS: >
12 --disable-debug
Jiayu Liu1e3d90d2023-04-14 23:57:33 +080013 --disable-dependency-tracking
14 --without-cpp
15 --without-c_glib
16 --without-java
17 --without-kotlin
18 --without-python
19 --without-py3
20 --without-ruby
21 --without-haxe
22 --without-netstd
23 --without-perl
24 --without-php
25 --without-php_extension
26 --without-dart
27 --without-erlang
28 --without-go
29 --without-d
30 --without-nodejs
31 --without-nodets
32 --without-lua
33 --without-rs
34 --without-swift
Jiayu Liuc77d91a2022-05-03 20:55:50 +080035
Varun Sharmabd1e5db2022-09-14 07:31:30 -070036permissions:
37 contents: read
38
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080039jobs:
40 # TODO windows and macos
Jiayu Liuc77d91a2022-05-03 20:55:50 +080041 compiler:
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080042 strategy:
Jiayu Liuc77d91a2022-05-03 20:55:50 +080043 matrix:
Sven Roederer502a46a2024-07-06 05:56:05 +020044 os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -070045 fail-fast: false
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080046 runs-on: ${{ matrix.os }}
47 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -040048 - uses: actions/checkout@v4
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080049
50 - name: Install dependencies
51 run: |
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080052 sudo apt-get update -yq
Jiayu Liuab83ffc2022-05-10 01:56:30 +080053 sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080054
55 - name: Run bootstrap
56 run: ./bootstrap.sh
57
58 - name: Run configure
59 run: ./configure --disable-debug --disable-tests --disable-libs
60
61 - name: Run make
62 run: make -j$(nproc)
63
64 - name: Run install
65 run: make install
66
67 - name: Run thrift version
68 run: /usr/local/bin/thrift -version
Jiayu Liuc77d91a2022-05-03 20:55:50 +080069
Jiayu Liue7f1a262024-11-06 11:37:25 +080070 # only upload while building ubuntu-24.04
Jiayu Liuc77d91a2022-05-03 20:55:50 +080071 - name: Archive built thrift compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +080072 if: matrix.os == 'ubuntu-24.04'
Sven Roederer18b0de62024-07-06 03:59:37 +020073 uses: actions/upload-artifact@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +080074 with:
75 name: thrift-compiler
76 path: compiler/cpp/thrift
77 retention-days: 3
78
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010079 lib-php:
80 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +080081 runs-on: ubuntu-24.04
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010082 strategy:
83 matrix:
vladimir.panivkof6927022024-02-24 17:12:10 +010084 php-version: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010085 fail-fast: false
86 steps:
87 - uses: actions/checkout@v4
88
89 - name: Set up PHP
90 uses: shivammathur/setup-php@v2
91 with:
92 php-version: ${{ matrix.php-version }}
Volodymyr Panivko99130042024-03-02 21:41:01 +010093 extensions: mbstring, intl, xml, curl
Volodymyr Panivkoac52d8d2024-02-22 22:09:00 +010094 ini-values: "error_reporting=E_ALL"
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010095
96 - name: Install Dependencies
97 run: composer install
98
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010099 - name: Run bootstrap
100 run: ./bootstrap.sh
101
102 - name: Run configure
103 run: |
104 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-php/with-php/' | sed 's/without-php_extension/with-php_extension/' )
105
Sven Roederer3d02c0f2024-07-06 07:36:30 +0200106 - uses: actions/download-artifact@v4
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100107 with:
108 name: thrift-compiler
109 path: compiler/cpp
110
111 - name: Run thrift-compiler
112 run: |
113 chmod a+x compiler/cpp/thrift
114 compiler/cpp/thrift -version
115
116 - name: Build Thrift Classes
117 run: |
118 mkdir -p ./lib/php/test/Resources/packages/php
119 mkdir -p ./lib/php/test/Resources/packages/phpv
120 mkdir -p ./lib/php/test/Resources/packages/phpvo
121 mkdir -p ./lib/php/test/Resources/packages/phpjs
Volodymyr Panivko14fc2be2024-02-22 18:17:40 +0100122 mkdir -p ./lib/php/test/Resources/packages/phpcm
Volodymyr Panivko68139d12024-03-19 23:14:07 +0100123 compiler/cpp/thrift --gen php:nsglobal="Basic" -r --out ./lib/php/test/Resources/packages/php lib/php/test/Resources/ThriftTest.thrift
124 compiler/cpp/thrift --gen php:validate,nsglobal="Validate" -r --out ./lib/php/test/Resources/packages/phpv lib/php/test/Resources/ThriftTest.thrift
125 compiler/cpp/thrift --gen php:validate,oop,nsglobal="ValidateOop" -r --out ./lib/php/test/Resources/packages/phpvo lib/php/test/Resources/ThriftTest.thrift
126 compiler/cpp/thrift --gen php:json,nsglobal="Json" -r --out ./lib/php/test/Resources/packages/phpjs lib/php/test/Resources/ThriftTest.thrift
127 compiler/cpp/thrift --gen php:classmap,server,rest,nsglobal="Classmap" -r --out ./lib/php/test/Resources/packages/phpcm lib/php/test/Resources/ThriftTest.thrift
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100128
129 - name: Run Tests
130 run: vendor/bin/phpunit -c lib/php/phpunit.xml
131
Jiayu Liud21e95a2022-10-09 08:49:29 +0800132 lib-go:
133 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800134 runs-on: ubuntu-24.04
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700135 strategy:
136 matrix:
137 go:
Yuxuan 'fishy' Wang91565d42024-08-14 09:01:15 -0700138 - '1.23'
Yuxuan 'fishy' Wang624118f2025-02-11 12:52:42 -0800139 - '1.24'
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700140 fail-fast: false
Jiayu Liud21e95a2022-10-09 08:49:29 +0800141 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400142 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800143
dependabot[bot]1ebfcf82024-01-03 16:59:31 +0000144 - uses: actions/setup-go@v5
Jiayu Liud21e95a2022-10-09 08:49:29 +0800145 with:
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700146 go-version: ${{ matrix.go }}
Jiayu Liud21e95a2022-10-09 08:49:29 +0800147
148 - name: Install dependencies
149 run: |
150 sudo apt-get update -yq
151 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
152
153 - name: Run bootstrap
154 run: ./bootstrap.sh
155
156 - name: Run configure
157 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800158 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-go/with-go/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800159
Sven Roederer18b0de62024-07-06 03:59:37 +0200160 - uses: actions/download-artifact@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800161 with:
162 name: thrift-compiler
163 path: compiler/cpp
164
165 - name: Run thrift-compiler
166 run: |
167 chmod a+x compiler/cpp/thrift
168 compiler/cpp/thrift -version
169
170 - name: Run make for go
171 run: make -C lib/go
172
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700173 - name: Run make check for lib/go
Jiayu Liud21e95a2022-10-09 08:49:29 +0800174 run: make -C lib/go check
175
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700176 - name: Run make check for test/go
177 run: make -C test/go check
178
Jiayu Liud21e95a2022-10-09 08:49:29 +0800179 - name: Run make precross for go test
180 run: make -C test/go precross
181
182 - name: Upload go precross artifacts
Yuxuan 'fishy' Wang624118f2025-02-11 12:52:42 -0800183 if: matrix.go == '1.24'
Sven Roederer18b0de62024-07-06 03:59:37 +0200184 uses: actions/upload-artifact@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800185 with:
186 name: go-precross
187 if-no-files-found: error
188 path: |
189 test/go/bin/*
190 retention-days: 3
191
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800192 lib-java-kotlin:
193 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800194 runs-on: ubuntu-24.04
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800195 env:
Jiayu Liud40dd722023-10-19 08:37:49 +0800196 GRADLE_VERSION: "8.4"
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800197 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400198 - uses: actions/checkout@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800199
dependabot[bot]f4b6d962023-12-01 06:30:44 +0000200 - uses: actions/setup-java@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800201 with:
202 distribution: temurin
Jiayu Liu92b007f2022-10-14 13:16:18 +0800203 java-version: 17
Jiayu Liubcac9782022-05-07 08:35:09 +0800204 cache: "gradle"
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800205
206 - name: Install dependencies
207 run: |
208 sudo apt-get update -yq
209 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
210 sudo apt-get install -y wget unzip ant maven
211
212 - name: Setup gradle
213 run: |
214 wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip
Jiayu Liud40dd722023-10-19 08:37:49 +0800215 (echo "3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -)
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800216 unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip
217 sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle
218 sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin
219 gradle --version
220
Jiayu Liubcac9782022-05-07 08:35:09 +0800221 - name: Run spotlessCheck for Java
Jiayu Liu53ec0822022-05-06 12:56:42 +0800222 run: |
223 cd lib/java
224 gradle spotlessCheck
225
Jiayu Liubcac9782022-05-07 08:35:09 +0800226 - name: Run ktfmtCheck for Kotlin
227 run: |
228 cd lib/kotlin
229 gradle ktfmtCheck
230
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800231 - name: Run bootstrap
232 run: ./bootstrap.sh
233
234 - name: Run configure
235 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800236 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-java/with-java/' | sed 's/without-kotlin/with-kotlin/')
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800237
Sven Roederer18b0de62024-07-06 03:59:37 +0200238 - uses: actions/download-artifact@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800239 with:
240 name: thrift-compiler
241 path: compiler/cpp
242
243 - name: Run thrift-compiler
244 run: |
245 chmod a+x compiler/cpp/thrift
246 compiler/cpp/thrift -version
247
Jiayu Liubcac9782022-05-07 08:35:09 +0800248 - name: Run make for java
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800249 run: make -C lib/java
250
Jiayu Liu5b158382022-05-12 00:20:37 +0800251 # this will invoke publishToMavenLocal and install locally
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800252 - name: Run make install for java
253 run: make -C lib/java install
254
255 - name: Upload java libthrift artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200256 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800257 with:
258 name: libthrift
259 if-no-files-found: error
260 path: ~/.m2/repository/org/apache/thrift
261
Jiayu Liubcac9782022-05-07 08:35:09 +0800262 - name: Run make check for java
263 run: make -C lib/java check
264
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800265 - name: Run make precross for java
266 run: make -C lib/java precross
267
268 - name: Upload java precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200269 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800270 with:
271 name: java-precross
272 if-no-files-found: error
273 path: |
274 lib/java/build/functionalTestJar/
275 lib/java/build/runclient
276 lib/java/build/runnonblockingserver
277 lib/java/build/runserver
278 lib/java/build/runservletserver
279 retention-days: 3
280
Jiayu Liubcac9782022-05-07 08:35:09 +0800281 - name: Run make for kotlin
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800282 run: make -C lib/kotlin
Jiayu Liubcac9782022-05-07 08:35:09 +0800283
284 - name: Run make check for kotlin
285 run: make -C lib/kotlin check
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800286
287 - name: Run make precross for kotlin
288 run: make -C lib/kotlin precross
289
290 - name: Upload kotlin precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200291 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800292 with:
293 name: kotlin-precross
294 if-no-files-found: error
295 path: |
296 lib/kotlin/cross-test-client/build/install/TestClient/
297 lib/kotlin/cross-test-server/build/install/TestServer/
298 retention-days: 3
299
Sven Roederercb9cead2024-07-05 12:47:41 +0200300 lib-netstd:
301 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800302 runs-on: ubuntu-24.04
Sven Roederercb9cead2024-07-05 12:47:41 +0200303 strategy:
304 fail-fast: false
305 steps:
306 - uses: actions/checkout@v4
307
308 - name: Install dependencies
309 run: |
310 sudo apt-get update -yq
311 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
312 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
313
314# the sdk is installed by default, but keep this step for reference
Jens Geyer3a37d152024-11-14 23:03:25 +0100315# caveat: net9 is (currently?) NOT installed, so manually again
316 - name: Set up .NET SDK
317 run: |
Jens Geyer8a5538a2025-02-11 23:16:12 +0100318 sudo add-apt-repository ppa:dotnet/backports
Jens Geyer3a37d152024-11-14 23:03:25 +0100319 sudo apt-get install -y --no-install-recommends dotnet-sdk-9.0
320# end
Sven Roederercb9cead2024-07-05 12:47:41 +0200321
322 - name: Run bootstrap
323 run: ./bootstrap.sh
324
325 - name: Run configure for netstd
326 run: |
327 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-netstd/with-netstd/')
328
329 - uses: actions/download-artifact@v4
330 with:
331 name: thrift-compiler
332 path: compiler/cpp
333
334 - name: Run thrift-compiler
335 run: |
336 chmod a+x compiler/cpp/thrift
337 compiler/cpp/thrift -version
338
339 - name: Run make for netstd
340 run: make -C lib/netstd
341
342 - name: Run make install for netstd
343 run: sudo make -C lib/netstd install
344
345 - name: Run make check for netstd
346 run: make -C lib/netstd check
347
348 - name: Run make check for test/netstd
349 run: make -C test/netstd check
350
351 - name: Run make precross for test/netstd
352 run: make -C test/netstd precross
353
354 - name: Upload netstd precross artifacts
355 uses: actions/upload-artifact@v4
356 with:
357 name: netstd-precross
358 if-no-files-found: error
359 path: |
360 test/netstd/Client/bin/Release/
361 test/netstd/Server/bin/Release/
362 retention-days: 3
363
Kino Roya9da9eb2022-10-07 23:13:01 -0700364 lib-swift:
365 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800366 runs-on: ubuntu-24.04
Kino Roya9da9eb2022-10-07 23:13:01 -0700367 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400368 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800369
Kino Roya9da9eb2022-10-07 23:13:01 -0700370 - name: Run bootstrap
371 run: ./bootstrap.sh
372
373 - name: Run configure
374 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800375 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-swift/with-swift/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800376
Sven Roederer18b0de62024-07-06 03:59:37 +0200377 - uses: actions/download-artifact@v4
Kino Roya9da9eb2022-10-07 23:13:01 -0700378 with:
379 name: thrift-compiler
380 path: compiler/cpp
381
382 - name: Run thrift-compiler
383 run: |
384 chmod a+x compiler/cpp/thrift
385 compiler/cpp/thrift -version
Jiayu Liud21e95a2022-10-09 08:49:29 +0800386
Kino Roya9da9eb2022-10-07 23:13:01 -0700387 - name: Run make precross for swift
388 run: make -C test/swift precross
389
390 - name: Upload swift precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200391 uses: actions/upload-artifact@v4
Kino Roya9da9eb2022-10-07 23:13:01 -0700392 with:
393 name: swift-precross
394 if-no-files-found: error
395 path: |
396 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestServer
397 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient
398 retention-days: 3
399
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800400 lib-rust:
401 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800402 runs-on: ubuntu-24.04
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800403 env:
Cameron Martinda54fc82025-01-12 08:55:45 +0000404 TOOLCHAIN_VERSION: 1.83.0
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800405 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400406 - uses: actions/checkout@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800407
408 - name: Install dependencies
409 run: |
410 sudo apt-get update -yq
411 sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS
412
413 - name: Setup cargo
414 run: |
415 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
416 rustup update
417 rustup install $TOOLCHAIN_VERSION
418 rustup default $TOOLCHAIN_VERSION
419 rustup --version
420 cargo --version
421 rustc --version
422
423 - name: Run bootstrap
424 run: ./bootstrap.sh
425
426 - name: Run configure
427 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800428 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-rs/with-rs/')
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800429
Sven Roederer18b0de62024-07-06 03:59:37 +0200430 - uses: actions/download-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800431 with:
432 name: thrift-compiler
433 path: compiler/cpp
434
435 - name: Run thrift-compiler
436 run: |
437 chmod a+x compiler/cpp/thrift
438 compiler/cpp/thrift -version
439
440 - name: Run make for rust
441 run: make -C lib/rs
442
443 - name: Run make check for rust
444 run: make -C lib/rs check
445
446 - name: Run make test for rust
447 run: make -C lib/rs/test check
448
449 - name: Run make precross for test rust
450 run: make -C test/rs precross
451
452 - name: Upload rust precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200453 uses: actions/upload-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800454 with:
455 name: rs-precross
456 if-no-files-found: error
457 path: |
458 test/rs/bin/test_server
459 test/rs/bin/test_client
460 retention-days: 3
461
462 - name: Run make test_recursive for rust
463 run: make -C lib/rs/test_recursive check
464
Jiayu Liu6f339002023-04-20 07:39:35 +0800465 lib-python:
466 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800467 runs-on: ubuntu-24.04
Jiayu Liu6f339002023-04-20 07:39:35 +0800468 strategy:
469 matrix:
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700470 python-version:
471 - "3.x"
472 fail-fast: false
Jiayu Liu6f339002023-04-20 07:39:35 +0800473 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400474 - uses: actions/checkout@v4
Jiayu Liu6f339002023-04-20 07:39:35 +0800475
476 - name: Install dependencies
477 run: |
478 sudo apt-get update -yq
479 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
480 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
481
482 - name: Set up Python
dependabot[bot]30c28452024-01-03 16:59:14 +0000483 uses: actions/setup-python@v5
Jiayu Liu6f339002023-04-20 07:39:35 +0800484 with:
485 python-version: ${{ matrix.python-version }}
486
487 - name: Python setup
488 run: |
Alexandre Detiste8f9fba82024-08-28 14:28:39 +0200489 python -m pip install --upgrade pip setuptools wheel flake8 tornado twisted zope.interface
Jiayu Liu6f339002023-04-20 07:39:35 +0800490 python --version
491 pip --version
492
Jiayu Liu6f339002023-04-20 07:39:35 +0800493 - name: Run bootstrap
494 run: ./bootstrap.sh
495
Jiayu Liu6f339002023-04-20 07:39:35 +0800496 - name: Run configure 3.x
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700497 if: matrix.python-version == '3.x'
Jiayu Liu6f339002023-04-20 07:39:35 +0800498 run: |
499 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/')
500
Sven Roederer18b0de62024-07-06 03:59:37 +0200501 - uses: actions/download-artifact@v4
Jiayu Liu6f339002023-04-20 07:39:35 +0800502 with:
503 name: thrift-compiler
504 path: compiler/cpp
505
506 - name: Run thrift-compiler
507 run: |
508 chmod a+x compiler/cpp/thrift
509 compiler/cpp/thrift -version
510
511 - name: Run make for python
512 run: make -C lib/py
513
514 - name: Run make install for python
515 run: sudo make -C lib/py install
516
517 # - name: Run make install-exec-hook for python
518 # run: sudo make -C lib/py install-exec-hook
519
520 - name: Run make check for python
521 run: make -C lib/py check
522
Cameron Martinab706522025-01-12 08:54:49 +0000523 lib-nodejs:
524 needs: compiler
525 runs-on: ubuntu-24.04
526 steps:
527 - uses: actions/checkout@v4
528
529 - name: Run bootstrap
530 run: ./bootstrap.sh
531
532 - name: Run configure
533 run: |
Cameron Martina675c4f2025-01-15 16:38:07 +0000534 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-node([tj])s/with-node\1s/g')
Cameron Martinab706522025-01-12 08:54:49 +0000535
536 - uses: actions/download-artifact@v4
537 with:
538 name: thrift-compiler
539 path: compiler/cpp
540
541 - name: Run thrift-compiler
542 run: |
543 chmod a+x compiler/cpp/thrift
544 compiler/cpp/thrift -version
545
Cameron Martina675c4f2025-01-15 16:38:07 +0000546 - name: Run js tests
Cameron Martinab706522025-01-12 08:54:49 +0000547 run: make -C lib/nodejs check
548
Cameron Martina675c4f2025-01-15 16:38:07 +0000549 - name: Run ts tests
550 run: make -C lib/nodets check
551
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800552 cross-test:
553 needs:
554 - lib-java-kotlin
Kino Roya9da9eb2022-10-07 23:13:01 -0700555 - lib-swift
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800556 - lib-rust
Jiayu Liud21e95a2022-10-09 08:49:29 +0800557 - lib-go
Jiayu Liu6f339002023-04-20 07:39:35 +0800558 - lib-python
Jiayu Liue7f1a262024-11-06 11:37:25 +0800559 runs-on: ubuntu-24.04
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800560 strategy:
561 matrix:
562 server_lang: ['java', 'kotlin', 'go', 'rs', 'swift']
563 # we always use comma join as many client langs as possible, to reduce the number of jobs
564 client_lang: ['java,kotlin', 'go,rs', 'swift']
565 fail-fast: false
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800566 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400567 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800568
dependabot[bot]30c28452024-01-03 16:59:14 +0000569 - uses: actions/setup-python@v5
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800570 with:
571 python-version: "3.x"
Jiayu Liud21e95a2022-10-09 08:49:29 +0800572
dependabot[bot]f4b6d962023-12-01 06:30:44 +0000573 - uses: actions/setup-java@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800574 with:
575 distribution: temurin
Jiayu Liube73a572023-04-14 11:02:43 +0800576 # here we intentionally use an older version so that we also verify Java 17 compiles to it
Fokko Driesprong0b14a1b2023-04-14 11:06:15 +0200577 java-version: 8
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800578 cache: "gradle"
579
Jiayu Liud21e95a2022-10-09 08:49:29 +0800580 - name: Install openssl and certificates (for SSL tests)
581 run: |
582 sudo apt-get update -yq
583 sudo apt-get install -y --no-install-recommends openssl ca-certificates
584
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800585 - name: Download java precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200586 uses: actions/download-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800587 with:
588 name: java-precross
589 path: lib/java/build
590
591 - name: Download kotlin precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200592 uses: actions/download-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800593 with:
594 name: kotlin-precross
595 path: lib/kotlin
596
Kino Roya9da9eb2022-10-07 23:13:01 -0700597 - name: Download swift precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200598 uses: actions/download-artifact@v4
Kino Roya9da9eb2022-10-07 23:13:01 -0700599 with:
600 name: swift-precross
601 path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug
602
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800603 - name: Download rust precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200604 uses: actions/download-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800605 with:
606 name: rs-precross
607 path: test/rs/bin
608
Jiayu Liud21e95a2022-10-09 08:49:29 +0800609 - name: Download go precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200610 uses: actions/download-artifact@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800611 with:
612 name: go-precross
613 path: test/go/bin
614
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800615 - name: Set back executable flags
616 run: |
617 chmod a+x \
618 lib/java/build/run* \
619 lib/kotlin/cross-test-client/build/install/TestClient/bin/* \
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800620 lib/kotlin/cross-test-server/build/install/TestServer/bin/* \
Kino Roya9da9eb2022-10-07 23:13:01 -0700621 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/* \
Jiayu Liud21e95a2022-10-09 08:49:29 +0800622 test/rs/bin/* \
623 test/go/bin/*
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800624
625 - name: Run cross test
626 env:
627 THRIFT_CROSSTEST_CONCURRENCY: 4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800628 run: |
629 python test/test.py \
630 --retry-count 5 \
631 --skip-known-failures \
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800632 --server ${{ matrix.server_lang }} \
633 --client ${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800634
635 - name: Upload log files from failed cross test runs
Sven Roederer18b0de62024-07-06 03:59:37 +0200636 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800637 if: failure()
638 with:
Sven Roederer18b0de62024-07-06 03:59:37 +0200639 name: cross-test-log_${{ matrix.server_lang }}-${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800640 path: test/log/
641 retention-days: 3
Jiayu Liu6f339002023-04-20 07:39:35 +0800642