blob: 423a0b5aef8d31265adfbad1ad51fcf0ca0a37a6 [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
Jens Geyer63b7a262025-05-25 14:48:57 +0200369 if: false # swift is currently broken and no maintainers around -> see THRIFT-5864
Kino Roya9da9eb2022-10-07 23:13:01 -0700370 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400371 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800372
Kino Roya9da9eb2022-10-07 23:13:01 -0700373 - name: Run bootstrap
374 run: ./bootstrap.sh
375
376 - name: Run configure
377 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800378 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-swift/with-swift/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800379
Sven Roederer18b0de62024-07-06 03:59:37 +0200380 - uses: actions/download-artifact@v4
Kino Roya9da9eb2022-10-07 23:13:01 -0700381 with:
382 name: thrift-compiler
383 path: compiler/cpp
384
385 - name: Run thrift-compiler
386 run: |
387 chmod a+x compiler/cpp/thrift
388 compiler/cpp/thrift -version
Jiayu Liud21e95a2022-10-09 08:49:29 +0800389
Kino Roya9da9eb2022-10-07 23:13:01 -0700390 - name: Run make precross for swift
391 run: make -C test/swift precross
392
393 - name: Upload swift precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200394 uses: actions/upload-artifact@v4
Kino Roya9da9eb2022-10-07 23:13:01 -0700395 with:
396 name: swift-precross
397 if-no-files-found: error
398 path: |
399 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestServer
400 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient
401 retention-days: 3
402
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800403 lib-rust:
404 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800405 runs-on: ubuntu-24.04
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800406 env:
Cameron Martinda54fc82025-01-12 08:55:45 +0000407 TOOLCHAIN_VERSION: 1.83.0
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800408 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400409 - uses: actions/checkout@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800410
411 - name: Install dependencies
412 run: |
413 sudo apt-get update -yq
414 sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS
415
416 - name: Setup cargo
417 run: |
418 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
419 rustup update
420 rustup install $TOOLCHAIN_VERSION
421 rustup default $TOOLCHAIN_VERSION
422 rustup --version
423 cargo --version
424 rustc --version
425
426 - name: Run bootstrap
427 run: ./bootstrap.sh
428
429 - name: Run configure
430 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800431 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-rs/with-rs/')
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800432
Sven Roederer18b0de62024-07-06 03:59:37 +0200433 - uses: actions/download-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800434 with:
435 name: thrift-compiler
436 path: compiler/cpp
437
438 - name: Run thrift-compiler
439 run: |
440 chmod a+x compiler/cpp/thrift
441 compiler/cpp/thrift -version
442
443 - name: Run make for rust
444 run: make -C lib/rs
445
446 - name: Run make check for rust
447 run: make -C lib/rs check
448
449 - name: Run make test for rust
450 run: make -C lib/rs/test check
451
452 - name: Run make precross for test rust
453 run: make -C test/rs precross
454
455 - name: Upload rust precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200456 uses: actions/upload-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800457 with:
458 name: rs-precross
459 if-no-files-found: error
460 path: |
461 test/rs/bin/test_server
462 test/rs/bin/test_client
463 retention-days: 3
464
465 - name: Run make test_recursive for rust
466 run: make -C lib/rs/test_recursive check
467
Jiayu Liu6f339002023-04-20 07:39:35 +0800468 lib-python:
469 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800470 runs-on: ubuntu-24.04
Jiayu Liu6f339002023-04-20 07:39:35 +0800471 strategy:
472 matrix:
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700473 python-version:
474 - "3.x"
475 fail-fast: false
Jiayu Liu6f339002023-04-20 07:39:35 +0800476 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400477 - uses: actions/checkout@v4
Jiayu Liu6f339002023-04-20 07:39:35 +0800478
479 - name: Install dependencies
480 run: |
481 sudo apt-get update -yq
482 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
483 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
484
485 - name: Set up Python
dependabot[bot]30c28452024-01-03 16:59:14 +0000486 uses: actions/setup-python@v5
Jiayu Liu6f339002023-04-20 07:39:35 +0800487 with:
488 python-version: ${{ matrix.python-version }}
489
490 - name: Python setup
491 run: |
Alexandre Detiste8f9fba82024-08-28 14:28:39 +0200492 python -m pip install --upgrade pip setuptools wheel flake8 tornado twisted zope.interface
Jiayu Liu6f339002023-04-20 07:39:35 +0800493 python --version
494 pip --version
495
Jiayu Liu6f339002023-04-20 07:39:35 +0800496 - name: Run bootstrap
497 run: ./bootstrap.sh
498
Jiayu Liu6f339002023-04-20 07:39:35 +0800499 - name: Run configure 3.x
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700500 if: matrix.python-version == '3.x'
Jiayu Liu6f339002023-04-20 07:39:35 +0800501 run: |
502 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/')
503
Sven Roederer18b0de62024-07-06 03:59:37 +0200504 - uses: actions/download-artifact@v4
Jiayu Liu6f339002023-04-20 07:39:35 +0800505 with:
506 name: thrift-compiler
507 path: compiler/cpp
508
509 - name: Run thrift-compiler
510 run: |
511 chmod a+x compiler/cpp/thrift
512 compiler/cpp/thrift -version
513
514 - name: Run make for python
515 run: make -C lib/py
516
517 - name: Run make install for python
518 run: sudo make -C lib/py install
519
520 # - name: Run make install-exec-hook for python
521 # run: sudo make -C lib/py install-exec-hook
522
523 - name: Run make check for python
524 run: make -C lib/py check
525
Cameron Martinab706522025-01-12 08:54:49 +0000526 lib-nodejs:
527 needs: compiler
528 runs-on: ubuntu-24.04
529 steps:
530 - uses: actions/checkout@v4
531
532 - name: Run bootstrap
533 run: ./bootstrap.sh
534
535 - name: Run configure
536 run: |
Cameron Martina675c4f2025-01-15 16:38:07 +0000537 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-node([tj])s/with-node\1s/g')
Cameron Martinab706522025-01-12 08:54:49 +0000538
539 - uses: actions/download-artifact@v4
540 with:
541 name: thrift-compiler
542 path: compiler/cpp
543
544 - name: Run thrift-compiler
545 run: |
546 chmod a+x compiler/cpp/thrift
547 compiler/cpp/thrift -version
548
Cameron Martina675c4f2025-01-15 16:38:07 +0000549 - name: Run js tests
Cameron Martinab706522025-01-12 08:54:49 +0000550 run: make -C lib/nodejs check
551
Cameron Martina675c4f2025-01-15 16:38:07 +0000552 - name: Run ts tests
553 run: make -C lib/nodets check
554
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800555 cross-test:
556 needs:
557 - lib-java-kotlin
Jens Geyer63b7a262025-05-25 14:48:57 +0200558 #- lib-swift # swift is currently broken and no maintainers around -> see THRIFT-5864
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800559 - lib-rust
Jiayu Liud21e95a2022-10-09 08:49:29 +0800560 - lib-go
Jiayu Liu6f339002023-04-20 07:39:35 +0800561 - lib-python
Jiayu Liue7f1a262024-11-06 11:37:25 +0800562 runs-on: ubuntu-24.04
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800563 strategy:
564 matrix:
Jens Geyer63b7a262025-05-25 14:48:57 +0200565 # swift is currently broken and no maintainers around -> see THRIFT-5864
566 server_lang: ['java', 'kotlin', 'go', 'rs'] # ['java', 'kotlin', 'go', 'rs', 'swift']
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800567 # we always use comma join as many client langs as possible, to reduce the number of jobs
Jens Geyer63b7a262025-05-25 14:48:57 +0200568 client_lang: ['java,kotlin', 'go,rs'] # ['java,kotlin', 'go,rs', 'swift']
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800569 fail-fast: false
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800570 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400571 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800572
dependabot[bot]30c28452024-01-03 16:59:14 +0000573 - uses: actions/setup-python@v5
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800574 with:
575 python-version: "3.x"
Jiayu Liud21e95a2022-10-09 08:49:29 +0800576
dependabot[bot]f4b6d962023-12-01 06:30:44 +0000577 - uses: actions/setup-java@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800578 with:
579 distribution: temurin
Jiayu Liube73a572023-04-14 11:02:43 +0800580 # here we intentionally use an older version so that we also verify Java 17 compiles to it
Fokko Driesprong0b14a1b2023-04-14 11:06:15 +0200581 java-version: 8
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800582 cache: "gradle"
583
Jiayu Liud21e95a2022-10-09 08:49:29 +0800584 - name: Install openssl and certificates (for SSL tests)
585 run: |
586 sudo apt-get update -yq
587 sudo apt-get install -y --no-install-recommends openssl ca-certificates
588
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800589 - name: Download java precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200590 uses: actions/download-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800591 with:
592 name: java-precross
593 path: lib/java/build
594
595 - name: Download kotlin precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200596 uses: actions/download-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800597 with:
598 name: kotlin-precross
599 path: lib/kotlin
600
Jens Geyer63b7a262025-05-25 14:48:57 +0200601 # swift is currently broken and no maintainers around -> see THRIFT-5864
602 #- name: Download swift precross artifacts
603 # uses: actions/download-artifact@v4
604 # with:
605 # name: swift-precross
606 # path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug
Kino Roya9da9eb2022-10-07 23:13:01 -0700607
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800608 - name: Download rust precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200609 uses: actions/download-artifact@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800610 with:
611 name: rs-precross
612 path: test/rs/bin
613
Jiayu Liud21e95a2022-10-09 08:49:29 +0800614 - name: Download go precross artifacts
Sven Roederer18b0de62024-07-06 03:59:37 +0200615 uses: actions/download-artifact@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800616 with:
617 name: go-precross
618 path: test/go/bin
619
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800620 - name: Set back executable flags
621 run: |
Yuxuan 'fishy' Wang716835f2025-05-28 15:44:53 -0700622 chmod a+x lib/java/build/run*
623 chmod a+x lib/kotlin/cross-test-client/build/install/TestClient/bin/*
624 chmod a+x lib/kotlin/cross-test-server/build/install/TestServer/bin/*
625 # THRIFT-5864 chmod a+x test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/*
626 chmod a+x test/rs/bin/*
627 chmod a+x test/go/bin/*
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800628
Kino Roy29d87732023-02-20 22:32:43 -0800629 - name: Create tmp domain socket folder
630 run: mkdir /tmp/v0.16
631
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800632 - name: Run cross test
633 env:
634 THRIFT_CROSSTEST_CONCURRENCY: 4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800635 run: |
636 python test/test.py \
637 --retry-count 5 \
638 --skip-known-failures \
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800639 --server ${{ matrix.server_lang }} \
640 --client ${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800641
642 - name: Upload log files from failed cross test runs
Sven Roederer18b0de62024-07-06 03:59:37 +0200643 uses: actions/upload-artifact@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800644 if: failure()
645 with:
Sven Roederer18b0de62024-07-06 03:59:37 +0200646 name: cross-test-log_${{ matrix.server_lang }}-${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800647 path: test/log/
648 retention-days: 3
Jiayu Liu6f339002023-04-20 07:39:35 +0800649