blob: 5ff30cf7515276b6da1d62222f1e3e887d68911a [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:
Yuxuan 'fishy' Wang7e45f582025-04-17 08:41:21 -070044 os:
45 - ubuntu-22.04
46 - ubuntu-24.04
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -070047 fail-fast: false
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080048 runs-on: ${{ matrix.os }}
49 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -040050 - uses: actions/checkout@v4
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080051
52 - name: Install dependencies
53 run: |
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080054 sudo apt-get update -yq
Jiayu Liuab83ffc2022-05-10 01:56:30 +080055 sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS
Jiayu Liu6a61c4e2022-04-29 01:25:39 +080056
57 - name: Run bootstrap
58 run: ./bootstrap.sh
59
60 - name: Run configure
61 run: ./configure --disable-debug --disable-tests --disable-libs
62
63 - name: Run make
64 run: make -j$(nproc)
65
66 - name: Run install
67 run: make install
68
69 - name: Run thrift version
70 run: /usr/local/bin/thrift -version
Jiayu Liuc77d91a2022-05-03 20:55:50 +080071
Jiayu Liue7f1a262024-11-06 11:37:25 +080072 # only upload while building ubuntu-24.04
Jiayu Liuc77d91a2022-05-03 20:55:50 +080073 - name: Archive built thrift compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +080074 if: matrix.os == 'ubuntu-24.04'
Sven Roederer18b0de62024-07-06 03:59:37 +020075 uses: actions/upload-artifact@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +080076 with:
77 name: thrift-compiler
78 path: compiler/cpp/thrift
79 retention-days: 3
80
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010081 lib-php:
82 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +080083 runs-on: ubuntu-24.04
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010084 strategy:
85 matrix:
vladimir.panivkof6927022024-02-24 17:12:10 +010086 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 +010087 fail-fast: false
88 steps:
89 - uses: actions/checkout@v4
90
91 - name: Set up PHP
92 uses: shivammathur/setup-php@v2
93 with:
94 php-version: ${{ matrix.php-version }}
Volodymyr Panivko99130042024-03-02 21:41:01 +010095 extensions: mbstring, intl, xml, curl
Volodymyr Panivkoac52d8d2024-02-22 22:09:00 +010096 ini-values: "error_reporting=E_ALL"
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010097
98 - name: Install Dependencies
99 run: composer install
100
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100101 - name: Run bootstrap
102 run: ./bootstrap.sh
103
104 - name: Run configure
105 run: |
106 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-php/with-php/' | sed 's/without-php_extension/with-php_extension/' )
107
Sven Roederer3d02c0f2024-07-06 07:36:30 +0200108 - uses: actions/download-artifact@v4
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100109 with:
110 name: thrift-compiler
111 path: compiler/cpp
112
113 - name: Run thrift-compiler
114 run: |
115 chmod a+x compiler/cpp/thrift
116 compiler/cpp/thrift -version
117
118 - name: Build Thrift Classes
119 run: |
120 mkdir -p ./lib/php/test/Resources/packages/php
121 mkdir -p ./lib/php/test/Resources/packages/phpv
122 mkdir -p ./lib/php/test/Resources/packages/phpvo
123 mkdir -p ./lib/php/test/Resources/packages/phpjs
Volodymyr Panivko14fc2be2024-02-22 18:17:40 +0100124 mkdir -p ./lib/php/test/Resources/packages/phpcm
Volodymyr Panivko68139d12024-03-19 23:14:07 +0100125 compiler/cpp/thrift --gen php:nsglobal="Basic" -r --out ./lib/php/test/Resources/packages/php lib/php/test/Resources/ThriftTest.thrift
126 compiler/cpp/thrift --gen php:validate,nsglobal="Validate" -r --out ./lib/php/test/Resources/packages/phpv lib/php/test/Resources/ThriftTest.thrift
127 compiler/cpp/thrift --gen php:validate,oop,nsglobal="ValidateOop" -r --out ./lib/php/test/Resources/packages/phpvo lib/php/test/Resources/ThriftTest.thrift
128 compiler/cpp/thrift --gen php:json,nsglobal="Json" -r --out ./lib/php/test/Resources/packages/phpjs lib/php/test/Resources/ThriftTest.thrift
129 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 +0100130
131 - name: Run Tests
132 run: vendor/bin/phpunit -c lib/php/phpunit.xml
133
Jiayu Liud21e95a2022-10-09 08:49:29 +0800134 lib-go:
135 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800136 runs-on: ubuntu-24.04
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700137 strategy:
138 matrix:
139 go:
Yuxuan 'fishy' Wang91565d42024-08-14 09:01:15 -0700140 - '1.23'
Yuxuan 'fishy' Wang624118f2025-02-11 12:52:42 -0800141 - '1.24'
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700142 fail-fast: false
Jiayu Liud21e95a2022-10-09 08:49:29 +0800143 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400144 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800145
dependabot[bot]1ebfcf82024-01-03 16:59:31 +0000146 - uses: actions/setup-go@v5
Jiayu Liud21e95a2022-10-09 08:49:29 +0800147 with:
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700148 go-version: ${{ matrix.go }}
Jiayu Liud21e95a2022-10-09 08:49:29 +0800149
150 - name: Install dependencies
151 run: |
152 sudo apt-get update -yq
153 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
154
155 - name: Run bootstrap
156 run: ./bootstrap.sh
157
158 - name: Run configure
159 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800160 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-go/with-go/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800161
Sven Roederer18b0de62024-07-06 03:59:37 +0200162 - uses: actions/download-artifact@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800163 with:
164 name: thrift-compiler
165 path: compiler/cpp
166
167 - name: Run thrift-compiler
168 run: |
169 chmod a+x compiler/cpp/thrift
170 compiler/cpp/thrift -version
171
172 - name: Run make for go
173 run: make -C lib/go
174
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700175 - name: Run make check for lib/go
Jiayu Liud21e95a2022-10-09 08:49:29 +0800176 run: make -C lib/go check
177
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700178 - name: Run make check for test/go
179 run: make -C test/go check
180
Jiayu Liud21e95a2022-10-09 08:49:29 +0800181 - name: Run make precross for go test
182 run: make -C test/go precross
183
184 - name: Upload go precross artifacts
Yuxuan 'fishy' Wang624118f2025-02-11 12:52:42 -0800185 if: matrix.go == '1.24'
Sven Roederer18b0de62024-07-06 03:59:37 +0200186 uses: actions/upload-artifact@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800187 with:
188 name: go-precross
189 if-no-files-found: error
190 path: |
191 test/go/bin/*
192 retention-days: 3
193
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800194 lib-java-kotlin:
195 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800196 runs-on: ubuntu-24.04
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800197 env:
Jiayu Liud40dd722023-10-19 08:37:49 +0800198 GRADLE_VERSION: "8.4"
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800199 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400200 - uses: actions/checkout@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800201
dependabot[bot]f4b6d962023-12-01 06:30:44 +0000202 - uses: actions/setup-java@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800203 with:
204 distribution: temurin
Jiayu Liu92b007f2022-10-14 13:16:18 +0800205 java-version: 17
Jiayu Liubcac9782022-05-07 08:35:09 +0800206 cache: "gradle"
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800207
208 - name: Install dependencies
209 run: |
210 sudo apt-get update -yq
211 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
212 sudo apt-get install -y wget unzip ant maven
213
214 - name: Setup gradle
215 run: |
216 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 +0800217 (echo "3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -)
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800218 unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip
219 sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle
220 sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin
221 gradle --version
222
Jiayu Liubcac9782022-05-07 08:35:09 +0800223 - name: Run spotlessCheck for Java
Jiayu Liu53ec0822022-05-06 12:56:42 +0800224 run: |
225 cd lib/java
226 gradle spotlessCheck
227
Jiayu Liubcac9782022-05-07 08:35:09 +0800228 - name: Run ktfmtCheck for Kotlin
229 run: |
230 cd lib/kotlin
231 gradle ktfmtCheck
232
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800233 - name: Run bootstrap
234 run: ./bootstrap.sh
235
236 - name: Run configure
237 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800238 ./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 +0800239
Sven Roederer18b0de62024-07-06 03:59:37 +0200240 - uses: actions/download-artifact@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800241 with:
242 name: thrift-compiler
243 path: compiler/cpp
244
245 - name: Run thrift-compiler
246 run: |
247 chmod a+x compiler/cpp/thrift
248 compiler/cpp/thrift -version
249
Jiayu Liubcac9782022-05-07 08:35:09 +0800250 - name: Run make for java
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800251 run: make -C lib/java
252
Jiayu Liu5b158382022-05-12 00:20:37 +0800253 # this will invoke publishToMavenLocal and install locally
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800254 - name: Run make install for java
255 run: make -C lib/java install
256
257 - name: Upload java libthrift artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200258 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800259 with:
260 name: libthrift
261 if-no-files-found: error
262 path: ~/.m2/repository/org/apache/thrift
263
Jiayu Liubcac9782022-05-07 08:35:09 +0800264 - name: Run make check for java
265 run: make -C lib/java check
266
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800267 - name: Run make precross for java
268 run: make -C lib/java precross
269
270 - name: Upload java precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200271 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800272 with:
273 name: java-precross
274 if-no-files-found: error
275 path: |
276 lib/java/build/functionalTestJar/
277 lib/java/build/runclient
278 lib/java/build/runnonblockingserver
279 lib/java/build/runserver
280 lib/java/build/runservletserver
281 retention-days: 3
282
Jiayu Liubcac9782022-05-07 08:35:09 +0800283 - name: Run make for kotlin
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800284 run: make -C lib/kotlin
Jiayu Liubcac9782022-05-07 08:35:09 +0800285
286 - name: Run make check for kotlin
287 run: make -C lib/kotlin check
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800288
289 - name: Run make precross for kotlin
290 run: make -C lib/kotlin precross
291
292 - name: Upload kotlin precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200293 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800294 with:
295 name: kotlin-precross
296 if-no-files-found: error
297 path: |
298 lib/kotlin/cross-test-client/build/install/TestClient/
299 lib/kotlin/cross-test-server/build/install/TestServer/
300 retention-days: 3
301
Sven Roederercb9cead2024-07-05 12:47:41 +0200302 lib-netstd:
303 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800304 runs-on: ubuntu-24.04
Sven Roederercb9cead2024-07-05 12:47:41 +0200305 strategy:
306 fail-fast: false
307 steps:
308 - uses: actions/checkout@v4
309
310 - name: Install dependencies
311 run: |
312 sudo apt-get update -yq
313 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
314 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
315
316# the sdk is installed by default, but keep this step for reference
Jens Geyer3a37d152024-11-14 23:03:25 +0100317# caveat: net9 is (currently?) NOT installed, so manually again
318 - name: Set up .NET SDK
319 run: |
Jens Geyer1834bfc2025-04-18 11:13:32 +0200320 sudo add-apt-repository -y ppa:dotnet/backports
Jens Geyer3a37d152024-11-14 23:03:25 +0100321 sudo apt-get install -y --no-install-recommends dotnet-sdk-9.0
322# end
Sven Roederercb9cead2024-07-05 12:47:41 +0200323
324 - name: Run bootstrap
325 run: ./bootstrap.sh
326
327 - name: Run configure for netstd
328 run: |
329 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-netstd/with-netstd/')
330
331 - uses: actions/download-artifact@v4
332 with:
333 name: thrift-compiler
334 path: compiler/cpp
335
336 - name: Run thrift-compiler
337 run: |
338 chmod a+x compiler/cpp/thrift
339 compiler/cpp/thrift -version
340
341 - name: Run make for netstd
342 run: make -C lib/netstd
343
344 - name: Run make install for netstd
345 run: sudo make -C lib/netstd install
346
347 - name: Run make check for netstd
348 run: make -C lib/netstd check
349
350 - name: Run make check for test/netstd
351 run: make -C test/netstd check
352
353 - name: Run make precross for test/netstd
354 run: make -C test/netstd precross
355
356 - name: Upload netstd precross artifacts
357 uses: actions/upload-artifact@v4
358 with:
359 name: netstd-precross
360 if-no-files-found: error
361 path: |
362 test/netstd/Client/bin/Release/
363 test/netstd/Server/bin/Release/
364 retention-days: 3
365
Kino Roya9da9eb2022-10-07 23:13:01 -0700366 lib-swift:
367 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800368 runs-on: ubuntu-24.04
Kino Roya9da9eb2022-10-07 23:13:01 -0700369 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400370 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800371
Kino Roya9da9eb2022-10-07 23:13:01 -0700372 - name: Run bootstrap
373 run: ./bootstrap.sh
374
375 - name: Run configure
376 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800377 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-swift/with-swift/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800378
Sven Roederer18b0de62024-07-06 03:59:37 +0200379 - uses: actions/download-artifact@v4
Kino Roya9da9eb2022-10-07 23:13:01 -0700380 with:
381 name: thrift-compiler
382 path: compiler/cpp
383
384 - name: Run thrift-compiler
385 run: |
386 chmod a+x compiler/cpp/thrift
387 compiler/cpp/thrift -version
Jiayu Liud21e95a2022-10-09 08:49:29 +0800388
Kino Roya9da9eb2022-10-07 23:13:01 -0700389 - name: Run make precross for swift
390 run: make -C test/swift precross
391
392 - name: Upload swift precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200393 uses: actions/upload-artifact@v4
Kino Roya9da9eb2022-10-07 23:13:01 -0700394 with:
395 name: swift-precross
396 if-no-files-found: error
397 path: |
398 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestServer
399 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient
400 retention-days: 3
401
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800402 lib-rust:
403 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800404 runs-on: ubuntu-24.04
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800405 env:
Cameron Martinda54fc82025-01-12 08:55:45 +0000406 TOOLCHAIN_VERSION: 1.83.0
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800407 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400408 - uses: actions/checkout@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800409
410 - name: Install dependencies
411 run: |
412 sudo apt-get update -yq
413 sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS
414
415 - name: Setup cargo
416 run: |
417 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
418 rustup update
419 rustup install $TOOLCHAIN_VERSION
420 rustup default $TOOLCHAIN_VERSION
421 rustup --version
422 cargo --version
423 rustc --version
424
425 - name: Run bootstrap
426 run: ./bootstrap.sh
427
428 - name: Run configure
429 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800430 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-rs/with-rs/')
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800431
Sven Roederer18b0de62024-07-06 03:59:37 +0200432 - uses: actions/download-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800433 with:
434 name: thrift-compiler
435 path: compiler/cpp
436
437 - name: Run thrift-compiler
438 run: |
439 chmod a+x compiler/cpp/thrift
440 compiler/cpp/thrift -version
441
442 - name: Run make for rust
443 run: make -C lib/rs
444
445 - name: Run make check for rust
446 run: make -C lib/rs check
447
448 - name: Run make test for rust
449 run: make -C lib/rs/test check
450
451 - name: Run make precross for test rust
452 run: make -C test/rs precross
453
454 - name: Upload rust precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200455 uses: actions/upload-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800456 with:
457 name: rs-precross
458 if-no-files-found: error
459 path: |
460 test/rs/bin/test_server
461 test/rs/bin/test_client
462 retention-days: 3
463
464 - name: Run make test_recursive for rust
465 run: make -C lib/rs/test_recursive check
466
Jiayu Liu6f339002023-04-20 07:39:35 +0800467 lib-python:
468 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800469 runs-on: ubuntu-24.04
Jiayu Liu6f339002023-04-20 07:39:35 +0800470 strategy:
471 matrix:
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700472 python-version:
473 - "3.x"
474 fail-fast: false
Jiayu Liu6f339002023-04-20 07:39:35 +0800475 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400476 - uses: actions/checkout@v4
Jiayu Liu6f339002023-04-20 07:39:35 +0800477
478 - name: Install dependencies
479 run: |
480 sudo apt-get update -yq
481 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
482 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
483
484 - name: Set up Python
dependabot[bot]30c28452024-01-03 16:59:14 +0000485 uses: actions/setup-python@v5
Jiayu Liu6f339002023-04-20 07:39:35 +0800486 with:
487 python-version: ${{ matrix.python-version }}
488
489 - name: Python setup
490 run: |
Alexandre Detiste8f9fba82024-08-28 14:28:39 +0200491 python -m pip install --upgrade pip setuptools wheel flake8 tornado twisted zope.interface
Jiayu Liu6f339002023-04-20 07:39:35 +0800492 python --version
493 pip --version
494
Jiayu Liu6f339002023-04-20 07:39:35 +0800495 - name: Run bootstrap
496 run: ./bootstrap.sh
497
Jiayu Liu6f339002023-04-20 07:39:35 +0800498 - name: Run configure 3.x
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700499 if: matrix.python-version == '3.x'
Jiayu Liu6f339002023-04-20 07:39:35 +0800500 run: |
501 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/')
502
Sven Roederer18b0de62024-07-06 03:59:37 +0200503 - uses: actions/download-artifact@v4
Jiayu Liu6f339002023-04-20 07:39:35 +0800504 with:
505 name: thrift-compiler
506 path: compiler/cpp
507
508 - name: Run thrift-compiler
509 run: |
510 chmod a+x compiler/cpp/thrift
511 compiler/cpp/thrift -version
512
513 - name: Run make for python
514 run: make -C lib/py
515
516 - name: Run make install for python
517 run: sudo make -C lib/py install
518
519 # - name: Run make install-exec-hook for python
520 # run: sudo make -C lib/py install-exec-hook
521
522 - name: Run make check for python
523 run: make -C lib/py check
524
Cameron Martinab706522025-01-12 08:54:49 +0000525 lib-nodejs:
526 needs: compiler
527 runs-on: ubuntu-24.04
528 steps:
529 - uses: actions/checkout@v4
530
531 - name: Run bootstrap
532 run: ./bootstrap.sh
533
534 - name: Run configure
535 run: |
Cameron Martina675c4f2025-01-15 16:38:07 +0000536 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-node([tj])s/with-node\1s/g')
Cameron Martinab706522025-01-12 08:54:49 +0000537
538 - uses: actions/download-artifact@v4
539 with:
540 name: thrift-compiler
541 path: compiler/cpp
542
543 - name: Run thrift-compiler
544 run: |
545 chmod a+x compiler/cpp/thrift
546 compiler/cpp/thrift -version
547
Cameron Martina675c4f2025-01-15 16:38:07 +0000548 - name: Run js tests
Cameron Martinab706522025-01-12 08:54:49 +0000549 run: make -C lib/nodejs check
550
Cameron Martina675c4f2025-01-15 16:38:07 +0000551 - name: Run ts tests
552 run: make -C lib/nodets check
553
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800554 cross-test:
555 needs:
556 - lib-java-kotlin
Kino Roya9da9eb2022-10-07 23:13:01 -0700557 - lib-swift
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800558 - lib-rust
Jiayu Liud21e95a2022-10-09 08:49:29 +0800559 - lib-go
Jiayu Liu6f339002023-04-20 07:39:35 +0800560 - lib-python
Jiayu Liue7f1a262024-11-06 11:37:25 +0800561 runs-on: ubuntu-24.04
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800562 strategy:
563 matrix:
564 server_lang: ['java', 'kotlin', 'go', 'rs', 'swift']
565 # we always use comma join as many client langs as possible, to reduce the number of jobs
566 client_lang: ['java,kotlin', 'go,rs', 'swift']
567 fail-fast: false
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800568 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400569 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800570
dependabot[bot]30c28452024-01-03 16:59:14 +0000571 - uses: actions/setup-python@v5
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800572 with:
573 python-version: "3.x"
Jiayu Liud21e95a2022-10-09 08:49:29 +0800574
dependabot[bot]f4b6d962023-12-01 06:30:44 +0000575 - uses: actions/setup-java@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800576 with:
577 distribution: temurin
Jiayu Liube73a572023-04-14 11:02:43 +0800578 # here we intentionally use an older version so that we also verify Java 17 compiles to it
Fokko Driesprong0b14a1b2023-04-14 11:06:15 +0200579 java-version: 8
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800580 cache: "gradle"
581
Jiayu Liud21e95a2022-10-09 08:49:29 +0800582 - name: Install openssl and certificates (for SSL tests)
583 run: |
584 sudo apt-get update -yq
585 sudo apt-get install -y --no-install-recommends openssl ca-certificates
586
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800587 - name: Download java precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200588 uses: actions/download-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800589 with:
590 name: java-precross
591 path: lib/java/build
592
593 - name: Download kotlin precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200594 uses: actions/download-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800595 with:
596 name: kotlin-precross
597 path: lib/kotlin
598
Kino Roya9da9eb2022-10-07 23:13:01 -0700599 - name: Download swift precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200600 uses: actions/download-artifact@v4
Kino Roya9da9eb2022-10-07 23:13:01 -0700601 with:
602 name: swift-precross
603 path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug
604
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800605 - name: Download rust precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200606 uses: actions/download-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800607 with:
608 name: rs-precross
609 path: test/rs/bin
610
Jiayu Liud21e95a2022-10-09 08:49:29 +0800611 - name: Download go precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200612 uses: actions/download-artifact@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800613 with:
614 name: go-precross
615 path: test/go/bin
616
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800617 - name: Set back executable flags
618 run: |
619 chmod a+x \
620 lib/java/build/run* \
621 lib/kotlin/cross-test-client/build/install/TestClient/bin/* \
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800622 lib/kotlin/cross-test-server/build/install/TestServer/bin/* \
Kino Roya9da9eb2022-10-07 23:13:01 -0700623 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/* \
Jiayu Liud21e95a2022-10-09 08:49:29 +0800624 test/rs/bin/* \
625 test/go/bin/*
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800626
627 - name: Run cross test
628 env:
629 THRIFT_CROSSTEST_CONCURRENCY: 4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800630 run: |
631 python test/test.py \
632 --retry-count 5 \
633 --skip-known-failures \
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800634 --server ${{ matrix.server_lang }} \
635 --client ${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800636
637 - name: Upload log files from failed cross test runs
Sven Roederer18b0de62024-07-06 03:59:37 +0200638 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800639 if: failure()
640 with:
Sven Roederer18b0de62024-07-06 03:59:37 +0200641 name: cross-test-log_${{ matrix.server_lang }}-${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800642 path: test/log/
643 retention-days: 3
Jiayu Liu6f339002023-04-20 07:39:35 +0800644