blob: 2b605219f7f027d15dd3e571a205d20aa57204ed [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]d90f2bb2025-12-01 06:29:38 +000050 - uses: actions/checkout@v6
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'
dependabot[bot]b8f24072026-01-01 06:01:45 +000075 uses: actions/upload-artifact@v6
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:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +000089 - uses: actions/checkout@v6
Volodymyr Panivko8e828c02024-02-19 11:34:48 +010090
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
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000108 - uses: actions/download-artifact@v7
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' Wang624118f2025-02-11 12:52:42 -0800140 - '1.24'
Yuxuan 'fishy' Wang3b862522025-08-13 09:02:51 -0700141 - '1.25'
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700142 fail-fast: false
Jiayu Liud21e95a2022-10-09 08:49:29 +0800143 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000144 - uses: actions/checkout@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800145
dependabot[bot]755f7d92025-10-01 06:01:55 +0000146 - uses: actions/setup-go@v6
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
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000162 - uses: actions/download-artifact@v7
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' Wang3b862522025-08-13 09:02:51 -0700185 if: matrix.go == '1.25'
dependabot[bot]b8f24072026-01-01 06:01:45 +0000186 uses: actions/upload-artifact@v6
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]d90f2bb2025-12-01 06:29:38 +0000200 - uses: actions/checkout@v6
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800201
dependabot[bot]eaec8982025-09-05 15:53:08 -0400202 - uses: actions/setup-java@v5
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
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000240 - uses: actions/download-artifact@v7
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
dependabot[bot]b8f24072026-01-01 06:01:45 +0000258 uses: actions/upload-artifact@v6
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
dependabot[bot]b8f24072026-01-01 06:01:45 +0000271 uses: actions/upload-artifact@v6
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/
HTHoub5919dd2026-01-05 12:17:56 +0800277 lib/java/build/runnonblockingclient
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800278 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
dependabot[bot]b8f24072026-01-01 06:01:45 +0000294 uses: actions/upload-artifact@v6
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
Sven Roederercb9cead2024-07-05 12:47:41 +0200303 lib-netstd:
304 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800305 runs-on: ubuntu-24.04
Sven Roederercb9cead2024-07-05 12:47:41 +0200306 strategy:
307 fail-fast: false
Jens Geyer2f214c22025-11-13 23:24:45 +0100308 defaults:
309 run:
310 shell: bash # required by net install script
Sven Roederercb9cead2024-07-05 12:47:41 +0200311 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000312 - uses: actions/checkout@v6
Sven Roederercb9cead2024-07-05 12:47:41 +0200313
314 - name: Install dependencies
315 run: |
316 sudo apt-get update -yq
317 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
318 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
319
Jens Geyer2f214c22025-11-13 23:24:45 +0100320# This whole setup is getting worse: https://github.com/dotnet/core/discussions/9258
321 - name: Set up .NET SDK (via install script)
Jens Geyer3a37d152024-11-14 23:03:25 +0100322 run: |
Jens Geyer2f214c22025-11-13 23:24:45 +0100323 # remove any existing install
HTHoub5919dd2026-01-05 12:17:56 +0800324 sudo apt remove dotnet*
Jens Geyer2f214c22025-11-13 23:24:45 +0100325 # install key
326 sudo apt install gpg
327 wget https://dot.net/v1/dotnet-install.asc
HTHoub5919dd2026-01-05 12:17:56 +0800328 gpg --import dotnet-install.asc
Jens Geyer2f214c22025-11-13 23:24:45 +0100329 # download and verify
330 wget https://dot.net/v1/dotnet-install.sh
331 wget https://dot.net/v1/dotnet-install.sig
HTHoub5919dd2026-01-05 12:17:56 +0800332 gpg --verify dotnet-install.sig dotnet-install.sh
Jens Geyer2f214c22025-11-13 23:24:45 +0100333 # run install script
334 chmod +x dotnet-install.sh
HTHoub5919dd2026-01-05 12:17:56 +0800335 ./dotnet-install.sh --channel 10.0
Jens Geyer2f214c22025-11-13 23:24:45 +0100336 # export env vars
337 export DOTNET_ROOT=$HOME/.dotnet
HTHoub5919dd2026-01-05 12:17:56 +0800338 export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
Jens Geyer2f214c22025-11-13 23:24:45 +0100339 dotnet --list-sdks
340
341# the sdk is installed by default, but keep this step for reference
342# especially newer versions are NOT always pre-installed, so manually again
343# - name: Set up .NET SDK
344# run: |
345# sudo add-apt-repository -y ppa:dotnet/backports
346# sudo apt-get install -y --no-install-recommends dotnet-sdk-10.0
Jens Geyer3a37d152024-11-14 23:03:25 +0100347# end
Sven Roederercb9cead2024-07-05 12:47:41 +0200348
349 - name: Run bootstrap
350 run: ./bootstrap.sh
351
352 - name: Run configure for netstd
353 run: |
354 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-netstd/with-netstd/')
355
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000356 - uses: actions/download-artifact@v7
Sven Roederercb9cead2024-07-05 12:47:41 +0200357 with:
358 name: thrift-compiler
359 path: compiler/cpp
360
361 - name: Run thrift-compiler
362 run: |
363 chmod a+x compiler/cpp/thrift
364 compiler/cpp/thrift -version
365
366 - name: Run make for netstd
367 run: make -C lib/netstd
368
369 - name: Run make install for netstd
370 run: sudo make -C lib/netstd install
371
372 - name: Run make check for netstd
373 run: make -C lib/netstd check
374
375 - name: Run make check for test/netstd
376 run: make -C test/netstd check
377
378 - name: Run make precross for test/netstd
379 run: make -C test/netstd precross
380
381 - name: Upload netstd precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000382 uses: actions/upload-artifact@v6
Sven Roederercb9cead2024-07-05 12:47:41 +0200383 with:
384 name: netstd-precross
385 if-no-files-found: error
386 path: |
387 test/netstd/Client/bin/Release/
388 test/netstd/Server/bin/Release/
389 retention-days: 3
390
Kino Roya9da9eb2022-10-07 23:13:01 -0700391 lib-swift:
392 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800393 runs-on: ubuntu-24.04
Jens Geyer63b7a262025-05-25 14:48:57 +0200394 if: false # swift is currently broken and no maintainers around -> see THRIFT-5864
Kino Roya9da9eb2022-10-07 23:13:01 -0700395 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000396 - uses: actions/checkout@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800397
Kino Roya9da9eb2022-10-07 23:13:01 -0700398 - name: Run bootstrap
399 run: ./bootstrap.sh
400
401 - name: Run configure
402 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800403 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-swift/with-swift/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800404
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000405 - uses: actions/download-artifact@v7
Kino Roya9da9eb2022-10-07 23:13:01 -0700406 with:
407 name: thrift-compiler
408 path: compiler/cpp
409
410 - name: Run thrift-compiler
411 run: |
412 chmod a+x compiler/cpp/thrift
413 compiler/cpp/thrift -version
Jiayu Liud21e95a2022-10-09 08:49:29 +0800414
Kino Roya9da9eb2022-10-07 23:13:01 -0700415 - name: Run make precross for swift
416 run: make -C test/swift precross
417
418 - name: Upload swift precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000419 uses: actions/upload-artifact@v6
Kino Roya9da9eb2022-10-07 23:13:01 -0700420 with:
421 name: swift-precross
422 if-no-files-found: error
423 path: |
424 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestServer
425 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient
426 retention-days: 3
427
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800428 lib-rust:
429 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800430 runs-on: ubuntu-24.04
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800431 env:
Cameron Martinda54fc82025-01-12 08:55:45 +0000432 TOOLCHAIN_VERSION: 1.83.0
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800433 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000434 - uses: actions/checkout@v6
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800435
436 - name: Install dependencies
437 run: |
438 sudo apt-get update -yq
439 sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS
440
441 - name: Setup cargo
442 run: |
443 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
444 rustup update
445 rustup install $TOOLCHAIN_VERSION
446 rustup default $TOOLCHAIN_VERSION
447 rustup --version
448 cargo --version
449 rustc --version
450
451 - name: Run bootstrap
452 run: ./bootstrap.sh
453
454 - name: Run configure
455 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800456 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-rs/with-rs/')
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800457
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000458 - uses: actions/download-artifact@v7
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800459 with:
460 name: thrift-compiler
461 path: compiler/cpp
462
463 - name: Run thrift-compiler
464 run: |
465 chmod a+x compiler/cpp/thrift
466 compiler/cpp/thrift -version
467
468 - name: Run make for rust
469 run: make -C lib/rs
470
471 - name: Run make check for rust
472 run: make -C lib/rs check
473
474 - name: Run make test for rust
475 run: make -C lib/rs/test check
476
477 - name: Run make precross for test rust
478 run: make -C test/rs precross
479
480 - name: Upload rust precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000481 uses: actions/upload-artifact@v6
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800482 with:
483 name: rs-precross
484 if-no-files-found: error
485 path: |
486 test/rs/bin/test_server
487 test/rs/bin/test_client
488 retention-days: 3
489
490 - name: Run make test_recursive for rust
491 run: make -C lib/rs/test_recursive check
492
Jiayu Liu6f339002023-04-20 07:39:35 +0800493 lib-python:
494 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800495 runs-on: ubuntu-24.04
Jiayu Liu6f339002023-04-20 07:39:35 +0800496 strategy:
497 matrix:
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700498 python-version:
Carel Combrinkf2534ad2025-11-11 12:51:21 +0000499 - "3.13" # Pin to 3.13 for now -> see THRIFT-5900
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700500 fail-fast: false
Jiayu Liu6f339002023-04-20 07:39:35 +0800501 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000502 - uses: actions/checkout@v6
Jiayu Liu6f339002023-04-20 07:39:35 +0800503
504 - name: Install dependencies
505 run: |
506 sudo apt-get update -yq
507 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
508 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
509
510 - name: Set up Python
dependabot[bot]1a5b7fc2025-10-01 06:01:59 +0000511 uses: actions/setup-python@v6
Jiayu Liu6f339002023-04-20 07:39:35 +0800512 with:
513 python-version: ${{ matrix.python-version }}
514
515 - name: Python setup
516 run: |
Alexandre Detiste8f9fba82024-08-28 14:28:39 +0200517 python -m pip install --upgrade pip setuptools wheel flake8 tornado twisted zope.interface
Jiayu Liu6f339002023-04-20 07:39:35 +0800518 python --version
519 pip --version
520
Jiayu Liu6f339002023-04-20 07:39:35 +0800521 - name: Run bootstrap
522 run: ./bootstrap.sh
523
Carel Combrinkf2534ad2025-11-11 12:51:21 +0000524 - name: Run configure
Jiayu Liu6f339002023-04-20 07:39:35 +0800525 run: |
526 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/')
527
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000528 - uses: actions/download-artifact@v7
Jiayu Liu6f339002023-04-20 07:39:35 +0800529 with:
530 name: thrift-compiler
531 path: compiler/cpp
532
533 - name: Run thrift-compiler
534 run: |
535 chmod a+x compiler/cpp/thrift
536 compiler/cpp/thrift -version
537
538 - name: Run make for python
539 run: make -C lib/py
540
541 - name: Run make install for python
542 run: sudo make -C lib/py install
543
544 # - name: Run make install-exec-hook for python
545 # run: sudo make -C lib/py install-exec-hook
546
Carel Combrink7770d272025-11-11 14:07:19 +0200547 - name: Run make for python libs
548 run: make -C lib/py
549
550 - name: Run make check for python libs
Jiayu Liu6f339002023-04-20 07:39:35 +0800551 run: make -C lib/py check
552
Carel Combrink7770d272025-11-11 14:07:19 +0200553 - name: Run make check for python code
554 run: make -C test/py check
555
Cameron Martinab706522025-01-12 08:54:49 +0000556 lib-nodejs:
557 needs: compiler
558 runs-on: ubuntu-24.04
559 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000560 - uses: actions/checkout@v6
Cameron Martinab706522025-01-12 08:54:49 +0000561
562 - name: Run bootstrap
563 run: ./bootstrap.sh
564
565 - name: Run configure
566 run: |
Cameron Martina675c4f2025-01-15 16:38:07 +0000567 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-node([tj])s/with-node\1s/g')
Cameron Martinab706522025-01-12 08:54:49 +0000568
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000569 - uses: actions/download-artifact@v7
Cameron Martinab706522025-01-12 08:54:49 +0000570 with:
571 name: thrift-compiler
572 path: compiler/cpp
573
574 - name: Run thrift-compiler
575 run: |
576 chmod a+x compiler/cpp/thrift
577 compiler/cpp/thrift -version
578
Cameron Martina675c4f2025-01-15 16:38:07 +0000579 - name: Run js tests
Cameron Martinab706522025-01-12 08:54:49 +0000580 run: make -C lib/nodejs check
581
Cameron Martina675c4f2025-01-15 16:38:07 +0000582 - name: Run ts tests
583 run: make -C lib/nodets check
584
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200585 lib-cpp:
586 needs: compiler
587 runs-on: ubuntu-24.04
588 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000589 - uses: actions/checkout@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200590
591 - name: Install dependencies
592 run: |
593 sudo apt-get update -yq
594 sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS locales
595 sudo locale-gen en_US.UTF-8
596 sudo locale-gen de_DE.UTF-8
597 sudo update-locale
598
599 - name: Run bootstrap
600 run: ./bootstrap.sh
601
602 - name: Run configure
603 run: |
604 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-cpp/with-cpp/g')
605
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000606 - uses: actions/download-artifact@v7
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200607 with:
608 name: thrift-compiler
609 path: compiler/cpp
610
611 - name: Run thrift-compiler
612 run: |
613 chmod a+x compiler/cpp/thrift
614 compiler/cpp/thrift -version
615
616 - name: Run make for cpp
617 run: make -j$(nproc) -C lib/cpp
618
619 - name: Run make check for lib/cpp
620 run: make -j$(nproc) -C lib/cpp check
621
622 - name: Run make check for test/cpp
623 run: make -j$(nproc) -C test/cpp check
624
625 - name: Run make precross for cpp test
626 run: make -j$(nproc) -C test/cpp precross
627
628 - name: Upload cpp precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000629 uses: actions/upload-artifact@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200630 with:
631 name: cpp-precross
632 if-no-files-found: error
633 include-hidden-files: true
634 path: |
635 test/cpp/TestClient
636 test/cpp/TestServer
637 test/cpp/.libs/TestClient
638 test/cpp/.libs/TestServer
639 lib/cpp/.libs/*.so
640 retention-days: 3
641
642 - name: Upload log files from failed test runs
dependabot[bot]b8f24072026-01-01 06:01:45 +0000643 uses: actions/upload-artifact@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200644 if: failure()
645 with:
646 name: lib-cpp-test-log
647 path: lib/cpp/test/*.xml
648 retention-days: 3
649
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800650 cross-test:
651 needs:
652 - lib-java-kotlin
Jens Geyer63b7a262025-05-25 14:48:57 +0200653 #- lib-swift # swift is currently broken and no maintainers around -> see THRIFT-5864
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800654 - lib-rust
Jiayu Liud21e95a2022-10-09 08:49:29 +0800655 - lib-go
Jiayu Liu6f339002023-04-20 07:39:35 +0800656 - lib-python
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200657 - lib-cpp
Jiayu Liue7f1a262024-11-06 11:37:25 +0800658 runs-on: ubuntu-24.04
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800659 strategy:
660 matrix:
Jens Geyer63b7a262025-05-25 14:48:57 +0200661 # swift is currently broken and no maintainers around -> see THRIFT-5864
Careled55a182025-11-14 10:54:52 +0200662 # kotlin cross test are failing -> see THRIFT-5879
663 server_lang: ['java', 'go', 'rs', 'cpp']
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800664 # we always use comma join as many client langs as possible, to reduce the number of jobs
HTHoud9b4d952026-01-05 14:37:48 +0800665 client_lang: ['java,kotlin', 'go,rs,cpp']
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800666 fail-fast: false
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800667 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000668 - uses: actions/checkout@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800669
dependabot[bot]1a5b7fc2025-10-01 06:01:59 +0000670 - uses: actions/setup-python@v6
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800671 with:
Carel Combrink5abe53f2025-11-13 06:16:41 +0100672 python-version: "3.x"
Jiayu Liud21e95a2022-10-09 08:49:29 +0800673
dependabot[bot]eaec8982025-09-05 15:53:08 -0400674 - uses: actions/setup-java@v5
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800675 with:
676 distribution: temurin
Jiayu Liube73a572023-04-14 11:02:43 +0800677 # here we intentionally use an older version so that we also verify Java 17 compiles to it
Fokko Driesprong0b14a1b2023-04-14 11:06:15 +0200678 java-version: 8
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800679 cache: "gradle"
680
Jiayu Liud21e95a2022-10-09 08:49:29 +0800681 - name: Install openssl and certificates (for SSL tests)
682 run: |
683 sudo apt-get update -yq
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200684 sudo apt-get install -y --no-install-recommends \
685 openssl \
686 ca-certificates \
687 libboost-all-dev \
688 libevent-dev
Jiayu Liud21e95a2022-10-09 08:49:29 +0800689
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800690 - name: Download java precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000691 uses: actions/download-artifact@v7
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800692 with:
693 name: java-precross
694 path: lib/java/build
695
696 - name: Download kotlin precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000697 uses: actions/download-artifact@v7
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800698 with:
699 name: kotlin-precross
700 path: lib/kotlin
701
Jens Geyer63b7a262025-05-25 14:48:57 +0200702 # swift is currently broken and no maintainers around -> see THRIFT-5864
703 #- name: Download swift precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000704 # uses: actions/download-artifact@v7
Jens Geyer63b7a262025-05-25 14:48:57 +0200705 # with:
706 # name: swift-precross
707 # path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug
Kino Roya9da9eb2022-10-07 23:13:01 -0700708
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800709 - name: Download rust precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000710 uses: actions/download-artifact@v7
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800711 with:
712 name: rs-precross
713 path: test/rs/bin
714
Jiayu Liud21e95a2022-10-09 08:49:29 +0800715 - name: Download go precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000716 uses: actions/download-artifact@v7
Jiayu Liud21e95a2022-10-09 08:49:29 +0800717 with:
718 name: go-precross
719 path: test/go/bin
720
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200721 - name: Download cpp precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000722 uses: actions/download-artifact@v7
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200723 with:
724 name: cpp-precross
725 path: .
726
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800727 - name: Set back executable flags
728 run: |
Yuxuan 'fishy' Wang716835f2025-05-28 15:44:53 -0700729 chmod a+x lib/java/build/run*
730 chmod a+x lib/kotlin/cross-test-client/build/install/TestClient/bin/*
731 chmod a+x lib/kotlin/cross-test-server/build/install/TestServer/bin/*
732 # THRIFT-5864 chmod a+x test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/*
733 chmod a+x test/rs/bin/*
734 chmod a+x test/go/bin/*
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200735 chmod a+x test/cpp/*
736 chmod a+x test/cpp/.libs/*
737 chmod a+x lib/cpp/.libs/*.so
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800738
Kino Roy29d87732023-02-20 22:32:43 -0800739 - name: Create tmp domain socket folder
740 run: mkdir /tmp/v0.16
741
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800742 - name: Run cross test
743 env:
744 THRIFT_CROSSTEST_CONCURRENCY: 4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800745 run: |
746 python test/test.py \
747 --retry-count 5 \
748 --skip-known-failures \
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800749 --server ${{ matrix.server_lang }} \
750 --client ${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800751
752 - name: Upload log files from failed cross test runs
dependabot[bot]b8f24072026-01-01 06:01:45 +0000753 uses: actions/upload-artifact@v6
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800754 if: failure()
755 with:
Sven Roederer18b0de62024-07-06 03:59:37 +0200756 name: cross-test-log_${{ matrix.server_lang }}-${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800757 path: test/log/
758 retention-days: 3
Jiayu Liu6f339002023-04-20 07:39:35 +0800759