blob: aca1a37f12fa7f8fa0a38296e406fc5c9db12827 [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:
Jiayu Liu564b2872022-10-12 11:42:38 +080044 os: [ubuntu-20.04, ubuntu-22.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
70 # only upload while building ubuntu-20.04
71 - name: Archive built thrift compiler
72 if: matrix.os == 'ubuntu-20.04'
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -080073 uses: actions/upload-artifact@v3
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
81 runs-on: ubuntu-20.04
82 strategy:
83 matrix:
84 php-version: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
85 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 }}
93 extensions: mbstring, intl, xml
94
95 - name: Install Dependencies
96 run: composer install
97
98 - name: Backward compatibility for unit test in php greater then 7.1
99 if: matrix.php-version > 7.0
100 run: |
101 sed -i 's/setUp()/setUp():void/' lib/php/test/Unit/*Test.php
102 sed -i 's/setUpBeforeClass()/setUpBeforeClass():void/' lib/php/test/Unit/*Test.php
103
104 - name: Run bootstrap
105 run: ./bootstrap.sh
106
107 - name: Run configure
108 run: |
109 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-php/with-php/' | sed 's/without-php_extension/with-php_extension/' )
110
111 - uses: actions/download-artifact@v3
112 with:
113 name: thrift-compiler
114 path: compiler/cpp
115
116 - name: Run thrift-compiler
117 run: |
118 chmod a+x compiler/cpp/thrift
119 compiler/cpp/thrift -version
120
121 - name: Build Thrift Classes
122 run: |
123 mkdir -p ./lib/php/test/Resources/packages/php
124 mkdir -p ./lib/php/test/Resources/packages/phpv
125 mkdir -p ./lib/php/test/Resources/packages/phpvo
126 mkdir -p ./lib/php/test/Resources/packages/phpjs
127 compiler/cpp/thrift --gen php -r --out ./lib/php/test/Resources/packages/php lib/php/test/Resources/ThriftTest.thrift
128 compiler/cpp/thrift --gen php:validate -r --out ./lib/php/test/Resources/packages/phpv lib/php/test/Resources/ThriftTest.thrift
129 compiler/cpp/thrift --gen php:validate,oop -r --out ./lib/php/test/Resources/packages/phpvo lib/php/test/Resources/ThriftTest.thrift
130 compiler/cpp/thrift --gen php:json -r --out ./lib/php/test/Resources/packages/phpjs lib/php/test/Resources/ThriftTest.thrift
131
132 - name: Run Tests
133 run: vendor/bin/phpunit -c lib/php/phpunit.xml
134
Jiayu Liud21e95a2022-10-09 08:49:29 +0800135 lib-go:
136 needs: compiler
137 runs-on: ubuntu-20.04
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700138 strategy:
139 matrix:
140 go:
Yuxuan 'fishy' Wangdc733fa2023-06-23 09:29:25 -0700141 - '1.21'
Yuxuan 'fishy' Wang875178c2023-11-17 12:36:31 -0800142 - '1.22'
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700143 fail-fast: false
Jiayu Liud21e95a2022-10-09 08:49:29 +0800144 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400145 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800146
dependabot[bot]1ebfcf82024-01-03 16:59:31 +0000147 - uses: actions/setup-go@v5
Jiayu Liud21e95a2022-10-09 08:49:29 +0800148 with:
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700149 go-version: ${{ matrix.go }}
Jiayu Liud21e95a2022-10-09 08:49:29 +0800150
151 - name: Install dependencies
152 run: |
153 sudo apt-get update -yq
154 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
155
156 - name: Run bootstrap
157 run: ./bootstrap.sh
158
159 - name: Run configure
160 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800161 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-go/with-go/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800162
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800163 - uses: actions/download-artifact@v3
Jiayu Liud21e95a2022-10-09 08:49:29 +0800164 with:
165 name: thrift-compiler
166 path: compiler/cpp
167
168 - name: Run thrift-compiler
169 run: |
170 chmod a+x compiler/cpp/thrift
171 compiler/cpp/thrift -version
172
173 - name: Run make for go
174 run: make -C lib/go
175
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700176 - name: Run make check for lib/go
Jiayu Liud21e95a2022-10-09 08:49:29 +0800177 run: make -C lib/go check
178
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700179 - name: Run make check for test/go
180 run: make -C test/go check
181
Jiayu Liud21e95a2022-10-09 08:49:29 +0800182 - name: Run make precross for go test
183 run: make -C test/go precross
184
185 - name: Upload go precross artifacts
Yuxuan 'fishy' Wang875178c2023-11-17 12:36:31 -0800186 if: matrix.go == '1.22'
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800187 uses: actions/upload-artifact@v3
Jiayu Liud21e95a2022-10-09 08:49:29 +0800188 with:
189 name: go-precross
190 if-no-files-found: error
191 path: |
192 test/go/bin/*
193 retention-days: 3
194
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800195 lib-java-kotlin:
196 needs: compiler
197 runs-on: ubuntu-20.04
198 env:
Jiayu Liud40dd722023-10-19 08:37:49 +0800199 GRADLE_VERSION: "8.4"
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800200 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400201 - uses: actions/checkout@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800202
dependabot[bot]f4b6d962023-12-01 06:30:44 +0000203 - uses: actions/setup-java@v4
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800204 with:
205 distribution: temurin
Jiayu Liu92b007f2022-10-14 13:16:18 +0800206 java-version: 17
Jiayu Liubcac9782022-05-07 08:35:09 +0800207 cache: "gradle"
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800208
209 - name: Install dependencies
210 run: |
211 sudo apt-get update -yq
212 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
213 sudo apt-get install -y wget unzip ant maven
214
215 - name: Setup gradle
216 run: |
217 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 +0800218 (echo "3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -)
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800219 unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip
220 sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle
221 sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin
222 gradle --version
223
Jiayu Liubcac9782022-05-07 08:35:09 +0800224 - name: Run spotlessCheck for Java
Jiayu Liu53ec0822022-05-06 12:56:42 +0800225 run: |
226 cd lib/java
227 gradle spotlessCheck
228
Jiayu Liubcac9782022-05-07 08:35:09 +0800229 - name: Run ktfmtCheck for Kotlin
230 run: |
231 cd lib/kotlin
232 gradle ktfmtCheck
233
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800234 - name: Run bootstrap
235 run: ./bootstrap.sh
236
237 - name: Run configure
238 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800239 ./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 +0800240
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800241 - uses: actions/download-artifact@v3
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800242 with:
243 name: thrift-compiler
244 path: compiler/cpp
245
246 - name: Run thrift-compiler
247 run: |
248 chmod a+x compiler/cpp/thrift
249 compiler/cpp/thrift -version
250
Jiayu Liubcac9782022-05-07 08:35:09 +0800251 - name: Run make for java
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800252 run: make -C lib/java
253
Jiayu Liu5b158382022-05-12 00:20:37 +0800254 # this will invoke publishToMavenLocal and install locally
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800255 - name: Run make install for java
256 run: make -C lib/java install
257
258 - name: Upload java libthrift artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800259 uses: actions/upload-artifact@v3
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800260 with:
261 name: libthrift
262 if-no-files-found: error
263 path: ~/.m2/repository/org/apache/thrift
264
Jiayu Liubcac9782022-05-07 08:35:09 +0800265 - name: Run make check for java
266 run: make -C lib/java check
267
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800268 - name: Run make precross for java
269 run: make -C lib/java precross
270
271 - name: Upload java precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800272 uses: actions/upload-artifact@v3
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800273 with:
274 name: java-precross
275 if-no-files-found: error
276 path: |
277 lib/java/build/functionalTestJar/
278 lib/java/build/runclient
279 lib/java/build/runnonblockingserver
280 lib/java/build/runserver
281 lib/java/build/runservletserver
282 retention-days: 3
283
Jiayu Liubcac9782022-05-07 08:35:09 +0800284 - name: Run make for kotlin
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800285 run: make -C lib/kotlin
Jiayu Liubcac9782022-05-07 08:35:09 +0800286
287 - name: Run make check for kotlin
288 run: make -C lib/kotlin check
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800289
290 - name: Run make precross for kotlin
291 run: make -C lib/kotlin precross
292
293 - name: Upload kotlin precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800294 uses: actions/upload-artifact@v3
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800295 with:
296 name: kotlin-precross
297 if-no-files-found: error
298 path: |
299 lib/kotlin/cross-test-client/build/install/TestClient/
300 lib/kotlin/cross-test-server/build/install/TestServer/
301 retention-days: 3
302
Kino Roya9da9eb2022-10-07 23:13:01 -0700303 lib-swift:
304 needs: compiler
305 runs-on: ubuntu-20.04
306 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400307 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800308
Kino Roya9da9eb2022-10-07 23:13:01 -0700309 - name: Run bootstrap
310 run: ./bootstrap.sh
311
312 - name: Run configure
313 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800314 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-swift/with-swift/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800315
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800316 - uses: actions/download-artifact@v3
Kino Roya9da9eb2022-10-07 23:13:01 -0700317 with:
318 name: thrift-compiler
319 path: compiler/cpp
320
321 - name: Run thrift-compiler
322 run: |
323 chmod a+x compiler/cpp/thrift
324 compiler/cpp/thrift -version
Jiayu Liud21e95a2022-10-09 08:49:29 +0800325
Kino Roya9da9eb2022-10-07 23:13:01 -0700326 - name: Run make precross for swift
327 run: make -C test/swift precross
328
329 - name: Upload swift precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800330 uses: actions/upload-artifact@v3
Kino Roya9da9eb2022-10-07 23:13:01 -0700331 with:
332 name: swift-precross
333 if-no-files-found: error
334 path: |
335 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestServer
336 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient
337 retention-days: 3
338
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800339 lib-rust:
340 needs: compiler
341 runs-on: ubuntu-20.04
342 env:
Jiayu Liufbfa52c2023-11-07 13:47:24 +0800343 TOOLCHAIN_VERSION: 1.65.0
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800344 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400345 - uses: actions/checkout@v4
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800346
347 - name: Install dependencies
348 run: |
349 sudo apt-get update -yq
350 sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS
351
352 - name: Setup cargo
353 run: |
354 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
355 rustup update
356 rustup install $TOOLCHAIN_VERSION
357 rustup default $TOOLCHAIN_VERSION
358 rustup --version
359 cargo --version
360 rustc --version
361
362 - name: Run bootstrap
363 run: ./bootstrap.sh
364
365 - name: Run configure
366 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800367 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-rs/with-rs/')
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800368
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800369 - uses: actions/download-artifact@v3
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800370 with:
371 name: thrift-compiler
372 path: compiler/cpp
373
374 - name: Run thrift-compiler
375 run: |
376 chmod a+x compiler/cpp/thrift
377 compiler/cpp/thrift -version
378
379 - name: Run make for rust
380 run: make -C lib/rs
381
382 - name: Run make check for rust
383 run: make -C lib/rs check
384
385 - name: Run make test for rust
386 run: make -C lib/rs/test check
387
388 - name: Run make precross for test rust
389 run: make -C test/rs precross
390
391 - name: Upload rust precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800392 uses: actions/upload-artifact@v3
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800393 with:
394 name: rs-precross
395 if-no-files-found: error
396 path: |
397 test/rs/bin/test_server
398 test/rs/bin/test_client
399 retention-days: 3
400
401 - name: Run make test_recursive for rust
402 run: make -C lib/rs/test_recursive check
403
Jiayu Liu6f339002023-04-20 07:39:35 +0800404 lib-python:
405 needs: compiler
406 runs-on: ubuntu-20.04
407 strategy:
408 matrix:
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700409 python-version:
410 - "3.x"
411 fail-fast: false
Jiayu Liu6f339002023-04-20 07:39:35 +0800412 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400413 - uses: actions/checkout@v4
Jiayu Liu6f339002023-04-20 07:39:35 +0800414
415 - name: Install dependencies
416 run: |
417 sudo apt-get update -yq
418 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
419 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
420
421 - name: Set up Python
dependabot[bot]30c28452024-01-03 16:59:14 +0000422 uses: actions/setup-python@v5
Jiayu Liu6f339002023-04-20 07:39:35 +0800423 with:
424 python-version: ${{ matrix.python-version }}
425
426 - name: Python setup
427 run: |
428 python -m pip install --upgrade pip setuptools wheel flake8 tornado twisted zope.interface
429 python --version
430 pip --version
431
Jiayu Liu6f339002023-04-20 07:39:35 +0800432 - name: Run bootstrap
433 run: ./bootstrap.sh
434
Jiayu Liu6f339002023-04-20 07:39:35 +0800435 - name: Run configure 3.x
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700436 if: matrix.python-version == '3.x'
Jiayu Liu6f339002023-04-20 07:39:35 +0800437 run: |
438 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/')
439
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800440 - uses: actions/download-artifact@v3
Jiayu Liu6f339002023-04-20 07:39:35 +0800441 with:
442 name: thrift-compiler
443 path: compiler/cpp
444
445 - name: Run thrift-compiler
446 run: |
447 chmod a+x compiler/cpp/thrift
448 compiler/cpp/thrift -version
449
450 - name: Run make for python
451 run: make -C lib/py
452
453 - name: Run make install for python
454 run: sudo make -C lib/py install
455
456 # - name: Run make install-exec-hook for python
457 # run: sudo make -C lib/py install-exec-hook
458
459 - name: Run make check for python
460 run: make -C lib/py check
461
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800462 cross-test:
463 needs:
464 - lib-java-kotlin
Kino Roya9da9eb2022-10-07 23:13:01 -0700465 - lib-swift
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800466 - lib-rust
Jiayu Liud21e95a2022-10-09 08:49:29 +0800467 - lib-go
Jiayu Liu6f339002023-04-20 07:39:35 +0800468 - lib-python
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800469 runs-on: ubuntu-20.04
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800470 strategy:
471 matrix:
472 server_lang: ['java', 'kotlin', 'go', 'rs', 'swift']
473 # we always use comma join as many client langs as possible, to reduce the number of jobs
474 client_lang: ['java,kotlin', 'go,rs', 'swift']
475 fail-fast: false
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800476 steps:
dependabot[bot]a14231c2023-10-04 18:33:29 -0400477 - uses: actions/checkout@v4
Jiayu Liud21e95a2022-10-09 08:49:29 +0800478
dependabot[bot]30c28452024-01-03 16:59:14 +0000479 - uses: actions/setup-python@v5
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800480 with:
481 python-version: "3.x"
Jiayu Liud21e95a2022-10-09 08:49:29 +0800482
dependabot[bot]f4b6d962023-12-01 06:30:44 +0000483 - uses: actions/setup-java@v4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800484 with:
485 distribution: temurin
Jiayu Liube73a572023-04-14 11:02:43 +0800486 # here we intentionally use an older version so that we also verify Java 17 compiles to it
Fokko Driesprong0b14a1b2023-04-14 11:06:15 +0200487 java-version: 8
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800488 cache: "gradle"
489
Jiayu Liud21e95a2022-10-09 08:49:29 +0800490 - name: Install openssl and certificates (for SSL tests)
491 run: |
492 sudo apt-get update -yq
493 sudo apt-get install -y --no-install-recommends openssl ca-certificates
494
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800495 - name: Download java precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800496 uses: actions/download-artifact@v3
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800497 with:
498 name: java-precross
499 path: lib/java/build
500
501 - name: Download kotlin precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800502 uses: actions/download-artifact@v3
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800503 with:
504 name: kotlin-precross
505 path: lib/kotlin
506
Kino Roya9da9eb2022-10-07 23:13:01 -0700507 - name: Download swift precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800508 uses: actions/download-artifact@v3
Kino Roya9da9eb2022-10-07 23:13:01 -0700509 with:
510 name: swift-precross
511 path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug
512
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800513 - name: Download rust precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800514 uses: actions/download-artifact@v3
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800515 with:
516 name: rs-precross
517 path: test/rs/bin
518
Jiayu Liud21e95a2022-10-09 08:49:29 +0800519 - name: Download go precross artifacts
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800520 uses: actions/download-artifact@v3
Jiayu Liud21e95a2022-10-09 08:49:29 +0800521 with:
522 name: go-precross
523 path: test/go/bin
524
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800525 - name: Set back executable flags
526 run: |
527 chmod a+x \
528 lib/java/build/run* \
529 lib/kotlin/cross-test-client/build/install/TestClient/bin/* \
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800530 lib/kotlin/cross-test-server/build/install/TestServer/bin/* \
Kino Roya9da9eb2022-10-07 23:13:01 -0700531 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/* \
Jiayu Liud21e95a2022-10-09 08:49:29 +0800532 test/rs/bin/* \
533 test/go/bin/*
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800534
535 - name: Run cross test
536 env:
537 THRIFT_CROSSTEST_CONCURRENCY: 4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800538 run: |
539 python test/test.py \
540 --retry-count 5 \
541 --skip-known-failures \
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800542 --server ${{ matrix.server_lang }} \
543 --client ${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800544
545 - name: Upload log files from failed cross test runs
Yuxuan 'fishy' Wang3dcc0cd2024-01-08 14:11:25 -0800546 uses: actions/upload-artifact@v3
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800547 if: failure()
548 with:
549 name: cross-test-log
550 path: test/log/
551 retention-days: 3
Jiayu Liu6f339002023-04-20 07:39:35 +0800552