blob: cca213e2f14d192003004bc85f4c62be8f09ceae [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
Gregg Donovan62ec9292026-01-29 16:51:37 -050081 compiler-macos:
82 strategy:
83 matrix:
84 os: &macos_versions [macos-15-intel, macos-14, macos-15, macos-26]
85 fail-fast: false
86 runs-on: ${{ matrix.os }}
87 steps:
88 - uses: actions/checkout@v6
89
90 - name: Install dependencies
91 run: |
92 brew install automake bison flex boost libevent openssl libtool pkg-config
93 echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
94
95 - name: Run bootstrap
96 run: ./bootstrap.sh
97
98 - name: Run configure
99 run: ./configure --disable-debug --disable-tests --disable-libs
100
101 - name: Run make
102 run: make -j$(sysctl -n hw.ncpu)
103
104 - name: Run install
105 run: sudo make install
106
107 - name: Run thrift version
108 run: /usr/local/bin/thrift -version
109
110 - name: Archive built thrift compiler (macOS)
111 uses: actions/upload-artifact@v5
112 with:
113 name: thrift-compiler-${{ matrix.os }}
114 path: compiler/cpp/thrift
115 retention-days: 3
116
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100117 lib-php:
118 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800119 runs-on: ubuntu-24.04
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100120 strategy:
121 matrix:
vladimir.panivkof6927022024-02-24 17:12:10 +0100122 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 +0100123 fail-fast: false
124 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000125 - uses: actions/checkout@v6
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100126
127 - name: Set up PHP
128 uses: shivammathur/setup-php@v2
129 with:
130 php-version: ${{ matrix.php-version }}
Volodymyr Panivko99130042024-03-02 21:41:01 +0100131 extensions: mbstring, intl, xml, curl
Volodymyr Panivkoac52d8d2024-02-22 22:09:00 +0100132 ini-values: "error_reporting=E_ALL"
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100133
134 - name: Install Dependencies
135 run: composer install
136
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100137 - name: Run bootstrap
138 run: ./bootstrap.sh
139
140 - name: Run configure
141 run: |
142 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-php/with-php/' | sed 's/without-php_extension/with-php_extension/' )
143
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000144 - uses: actions/download-artifact@v7
Volodymyr Panivko8e828c02024-02-19 11:34:48 +0100145 with:
146 name: thrift-compiler
147 path: compiler/cpp
148
149 - name: Run thrift-compiler
150 run: |
151 chmod a+x compiler/cpp/thrift
152 compiler/cpp/thrift -version
153
154 - name: Build Thrift Classes
155 run: |
156 mkdir -p ./lib/php/test/Resources/packages/php
157 mkdir -p ./lib/php/test/Resources/packages/phpv
158 mkdir -p ./lib/php/test/Resources/packages/phpvo
159 mkdir -p ./lib/php/test/Resources/packages/phpjs
Volodymyr Panivko14fc2be2024-02-22 18:17:40 +0100160 mkdir -p ./lib/php/test/Resources/packages/phpcm
Volodymyr Panivko68139d12024-03-19 23:14:07 +0100161 compiler/cpp/thrift --gen php:nsglobal="Basic" -r --out ./lib/php/test/Resources/packages/php lib/php/test/Resources/ThriftTest.thrift
162 compiler/cpp/thrift --gen php:validate,nsglobal="Validate" -r --out ./lib/php/test/Resources/packages/phpv lib/php/test/Resources/ThriftTest.thrift
163 compiler/cpp/thrift --gen php:validate,oop,nsglobal="ValidateOop" -r --out ./lib/php/test/Resources/packages/phpvo lib/php/test/Resources/ThriftTest.thrift
164 compiler/cpp/thrift --gen php:json,nsglobal="Json" -r --out ./lib/php/test/Resources/packages/phpjs lib/php/test/Resources/ThriftTest.thrift
165 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 +0100166
167 - name: Run Tests
168 run: vendor/bin/phpunit -c lib/php/phpunit.xml
169
Jiayu Liud21e95a2022-10-09 08:49:29 +0800170 lib-go:
171 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800172 runs-on: ubuntu-24.04
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700173 strategy:
174 matrix:
175 go:
Yuxuan 'fishy' Wang624118f2025-02-11 12:52:42 -0800176 - '1.24'
Yuxuan 'fishy' Wang3b862522025-08-13 09:02:51 -0700177 - '1.25'
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700178 fail-fast: false
Jiayu Liud21e95a2022-10-09 08:49:29 +0800179 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000180 - uses: actions/checkout@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800181
dependabot[bot]755f7d92025-10-01 06:01:55 +0000182 - uses: actions/setup-go@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800183 with:
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700184 go-version: ${{ matrix.go }}
Jiayu Liud21e95a2022-10-09 08:49:29 +0800185
186 - name: Install dependencies
187 run: |
188 sudo apt-get update -yq
189 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
190
191 - name: Run bootstrap
192 run: ./bootstrap.sh
193
194 - name: Run configure
195 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800196 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-go/with-go/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800197
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000198 - uses: actions/download-artifact@v7
Jiayu Liud21e95a2022-10-09 08:49:29 +0800199 with:
200 name: thrift-compiler
201 path: compiler/cpp
202
203 - name: Run thrift-compiler
204 run: |
205 chmod a+x compiler/cpp/thrift
206 compiler/cpp/thrift -version
207
208 - name: Run make for go
209 run: make -C lib/go
210
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700211 - name: Run make check for lib/go
Jiayu Liud21e95a2022-10-09 08:49:29 +0800212 run: make -C lib/go check
213
Yuxuan 'fishy' Wang19c13b42022-10-12 14:13:15 -0700214 - name: Run make check for test/go
215 run: make -C test/go check
216
Jiayu Liud21e95a2022-10-09 08:49:29 +0800217 - name: Run make precross for go test
218 run: make -C test/go precross
219
220 - name: Upload go precross artifacts
Yuxuan 'fishy' Wang3b862522025-08-13 09:02:51 -0700221 if: matrix.go == '1.25'
dependabot[bot]b8f24072026-01-01 06:01:45 +0000222 uses: actions/upload-artifact@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800223 with:
224 name: go-precross
225 if-no-files-found: error
226 path: |
227 test/go/bin/*
228 retention-days: 3
229
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800230 lib-java-kotlin:
231 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800232 runs-on: ubuntu-24.04
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800233 env:
Jiayu Liud40dd722023-10-19 08:37:49 +0800234 GRADLE_VERSION: "8.4"
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800235 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000236 - uses: actions/checkout@v6
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800237
dependabot[bot]eaec8982025-09-05 15:53:08 -0400238 - uses: actions/setup-java@v5
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800239 with:
240 distribution: temurin
Jiayu Liu92b007f2022-10-14 13:16:18 +0800241 java-version: 17
Jiayu Liubcac9782022-05-07 08:35:09 +0800242 cache: "gradle"
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800243
244 - name: Install dependencies
245 run: |
246 sudo apt-get update -yq
247 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
248 sudo apt-get install -y wget unzip ant maven
249
250 - name: Setup gradle
251 run: |
252 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 +0800253 (echo "3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -)
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800254 unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip
255 sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle
256 sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin
257 gradle --version
258
Jiayu Liubcac9782022-05-07 08:35:09 +0800259 - name: Run spotlessCheck for Java
Jiayu Liu53ec0822022-05-06 12:56:42 +0800260 run: |
261 cd lib/java
262 gradle spotlessCheck
263
Jiayu Liubcac9782022-05-07 08:35:09 +0800264 - name: Run ktfmtCheck for Kotlin
265 run: |
266 cd lib/kotlin
267 gradle ktfmtCheck
268
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800269 - name: Run bootstrap
270 run: ./bootstrap.sh
271
272 - name: Run configure
273 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800274 ./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 +0800275
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000276 - uses: actions/download-artifact@v7
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800277 with:
278 name: thrift-compiler
279 path: compiler/cpp
280
281 - name: Run thrift-compiler
282 run: |
283 chmod a+x compiler/cpp/thrift
284 compiler/cpp/thrift -version
285
Jiayu Liubcac9782022-05-07 08:35:09 +0800286 - name: Run make for java
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800287 run: make -C lib/java
288
Jiayu Liu5b158382022-05-12 00:20:37 +0800289 # this will invoke publishToMavenLocal and install locally
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800290 - name: Run make install for java
291 run: make -C lib/java install
292
293 - name: Upload java libthrift 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: libthrift
297 if-no-files-found: error
298 path: ~/.m2/repository/org/apache/thrift
299
Jiayu Liubcac9782022-05-07 08:35:09 +0800300 - name: Run make check for java
301 run: make -C lib/java check
302
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800303 - name: Run make precross for java
304 run: make -C lib/java precross
305
306 - name: Upload java precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000307 uses: actions/upload-artifact@v6
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800308 with:
309 name: java-precross
310 if-no-files-found: error
311 path: |
312 lib/java/build/functionalTestJar/
HTHoub5919dd2026-01-05 12:17:56 +0800313 lib/java/build/runnonblockingclient
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800314 lib/java/build/runclient
315 lib/java/build/runnonblockingserver
316 lib/java/build/runserver
317 lib/java/build/runservletserver
318 retention-days: 3
319
Jiayu Liubcac9782022-05-07 08:35:09 +0800320 - name: Run make for kotlin
Jiayu Liuc77d91a2022-05-03 20:55:50 +0800321 run: make -C lib/kotlin
Jiayu Liubcac9782022-05-07 08:35:09 +0800322
323 - name: Run make check for kotlin
324 run: make -C lib/kotlin check
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800325
326 - name: Run make precross for kotlin
327 run: make -C lib/kotlin precross
328
329 - name: Upload kotlin precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000330 uses: actions/upload-artifact@v6
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800331 with:
332 name: kotlin-precross
333 if-no-files-found: error
334 path: |
335 lib/kotlin/cross-test-client/build/install/TestClient/
336 lib/kotlin/cross-test-server/build/install/TestServer/
337 retention-days: 3
338
Sven Roederercb9cead2024-07-05 12:47:41 +0200339 lib-netstd:
340 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800341 runs-on: ubuntu-24.04
Sven Roederercb9cead2024-07-05 12:47:41 +0200342 strategy:
343 fail-fast: false
Jens Geyer2f214c22025-11-13 23:24:45 +0100344 defaults:
345 run:
346 shell: bash # required by net install script
Sven Roederercb9cead2024-07-05 12:47:41 +0200347 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000348 - uses: actions/checkout@v6
Sven Roederercb9cead2024-07-05 12:47:41 +0200349
350 - name: Install dependencies
351 run: |
352 sudo apt-get update -yq
353 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
354 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
355
Jens Geyer2f214c22025-11-13 23:24:45 +0100356# This whole setup is getting worse: https://github.com/dotnet/core/discussions/9258
357 - name: Set up .NET SDK (via install script)
Jens Geyer3a37d152024-11-14 23:03:25 +0100358 run: |
Jens Geyer2f214c22025-11-13 23:24:45 +0100359 # remove any existing install
HTHoub5919dd2026-01-05 12:17:56 +0800360 sudo apt remove dotnet*
Jens Geyer2f214c22025-11-13 23:24:45 +0100361 # install key
362 sudo apt install gpg
363 wget https://dot.net/v1/dotnet-install.asc
HTHoub5919dd2026-01-05 12:17:56 +0800364 gpg --import dotnet-install.asc
Jens Geyer2f214c22025-11-13 23:24:45 +0100365 # download and verify
366 wget https://dot.net/v1/dotnet-install.sh
367 wget https://dot.net/v1/dotnet-install.sig
HTHoub5919dd2026-01-05 12:17:56 +0800368 gpg --verify dotnet-install.sig dotnet-install.sh
Jens Geyer2f214c22025-11-13 23:24:45 +0100369 # run install script
370 chmod +x dotnet-install.sh
HTHoub5919dd2026-01-05 12:17:56 +0800371 ./dotnet-install.sh --channel 10.0
Jens Geyer2f214c22025-11-13 23:24:45 +0100372 # export env vars
373 export DOTNET_ROOT=$HOME/.dotnet
HTHoub5919dd2026-01-05 12:17:56 +0800374 export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
Jens Geyer2f214c22025-11-13 23:24:45 +0100375 dotnet --list-sdks
376
377# the sdk is installed by default, but keep this step for reference
378# especially newer versions are NOT always pre-installed, so manually again
379# - name: Set up .NET SDK
380# run: |
381# sudo add-apt-repository -y ppa:dotnet/backports
382# sudo apt-get install -y --no-install-recommends dotnet-sdk-10.0
Jens Geyer3a37d152024-11-14 23:03:25 +0100383# end
Sven Roederercb9cead2024-07-05 12:47:41 +0200384
385 - name: Run bootstrap
386 run: ./bootstrap.sh
387
388 - name: Run configure for netstd
389 run: |
390 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-netstd/with-netstd/')
391
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000392 - uses: actions/download-artifact@v7
Sven Roederercb9cead2024-07-05 12:47:41 +0200393 with:
394 name: thrift-compiler
395 path: compiler/cpp
396
397 - name: Run thrift-compiler
398 run: |
399 chmod a+x compiler/cpp/thrift
400 compiler/cpp/thrift -version
401
402 - name: Run make for netstd
403 run: make -C lib/netstd
404
405 - name: Run make install for netstd
406 run: sudo make -C lib/netstd install
407
408 - name: Run make check for netstd
409 run: make -C lib/netstd check
410
411 - name: Run make check for test/netstd
412 run: make -C test/netstd check
413
414 - name: Run make precross for test/netstd
415 run: make -C test/netstd precross
416
417 - name: Upload netstd precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000418 uses: actions/upload-artifact@v6
Sven Roederercb9cead2024-07-05 12:47:41 +0200419 with:
420 name: netstd-precross
421 if-no-files-found: error
422 path: |
423 test/netstd/Client/bin/Release/
424 test/netstd/Server/bin/Release/
425 retention-days: 3
426
Kino Roya9da9eb2022-10-07 23:13:01 -0700427 lib-swift:
428 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800429 runs-on: ubuntu-24.04
Jens Geyer63b7a262025-05-25 14:48:57 +0200430 if: false # swift is currently broken and no maintainers around -> see THRIFT-5864
Kino Roya9da9eb2022-10-07 23:13:01 -0700431 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000432 - uses: actions/checkout@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800433
Kino Roya9da9eb2022-10-07 23:13:01 -0700434 - name: Run bootstrap
435 run: ./bootstrap.sh
436
437 - name: Run configure
438 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800439 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-swift/with-swift/')
Jiayu Liud21e95a2022-10-09 08:49:29 +0800440
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000441 - uses: actions/download-artifact@v7
Kino Roya9da9eb2022-10-07 23:13:01 -0700442 with:
443 name: thrift-compiler
444 path: compiler/cpp
445
446 - name: Run thrift-compiler
447 run: |
448 chmod a+x compiler/cpp/thrift
449 compiler/cpp/thrift -version
Jiayu Liud21e95a2022-10-09 08:49:29 +0800450
Kino Roya9da9eb2022-10-07 23:13:01 -0700451 - name: Run make precross for swift
452 run: make -C test/swift precross
453
454 - name: Upload swift precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000455 uses: actions/upload-artifact@v6
Kino Roya9da9eb2022-10-07 23:13:01 -0700456 with:
457 name: swift-precross
458 if-no-files-found: error
459 path: |
460 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestServer
461 test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient
462 retention-days: 3
463
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800464 lib-rust:
465 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800466 runs-on: ubuntu-24.04
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800467 env:
Cameron Martinda54fc82025-01-12 08:55:45 +0000468 TOOLCHAIN_VERSION: 1.83.0
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800469 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000470 - uses: actions/checkout@v6
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800471
472 - name: Install dependencies
473 run: |
474 sudo apt-get update -yq
475 sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS
476
477 - name: Setup cargo
478 run: |
479 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
480 rustup update
481 rustup install $TOOLCHAIN_VERSION
482 rustup default $TOOLCHAIN_VERSION
483 rustup --version
484 cargo --version
485 rustc --version
486
487 - name: Run bootstrap
488 run: ./bootstrap.sh
489
490 - name: Run configure
491 run: |
Jiayu Liu1e3d90d2023-04-14 23:57:33 +0800492 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-rs/with-rs/')
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800493
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000494 - uses: actions/download-artifact@v7
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800495 with:
496 name: thrift-compiler
497 path: compiler/cpp
498
499 - name: Run thrift-compiler
500 run: |
501 chmod a+x compiler/cpp/thrift
502 compiler/cpp/thrift -version
503
504 - name: Run make for rust
505 run: make -C lib/rs
506
507 - name: Run make check for rust
508 run: make -C lib/rs check
509
510 - name: Run make test for rust
511 run: make -C lib/rs/test check
512
513 - name: Run make precross for test rust
514 run: make -C test/rs precross
515
516 - name: Upload rust precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000517 uses: actions/upload-artifact@v6
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800518 with:
519 name: rs-precross
520 if-no-files-found: error
521 path: |
522 test/rs/bin/test_server
523 test/rs/bin/test_client
524 retention-days: 3
525
526 - name: Run make test_recursive for rust
527 run: make -C lib/rs/test_recursive check
528
Jiayu Liu6f339002023-04-20 07:39:35 +0800529 lib-python:
530 needs: compiler
Jiayu Liue7f1a262024-11-06 11:37:25 +0800531 runs-on: ubuntu-24.04
Jiayu Liu6f339002023-04-20 07:39:35 +0800532 strategy:
533 matrix:
Gregg Donovan62ec9292026-01-29 16:51:37 -0500534 python-version: &python_versions ["3.10", "3.11", "3.12", "3.13", "3.14"]
Yuxuan 'fishy' Wange4970302023-06-27 09:47:58 -0700535 fail-fast: false
Jiayu Liu6f339002023-04-20 07:39:35 +0800536 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000537 - uses: actions/checkout@v6
Jiayu Liu6f339002023-04-20 07:39:35 +0800538
539 - name: Install dependencies
540 run: |
541 sudo apt-get update -yq
542 sudo apt-get install -y --no-install-recommends $BUILD_DEPS
543 sudo apt-get install -y --no-install-recommends curl openssl ca-certificates
544
545 - name: Set up Python
dependabot[bot]1a5b7fc2025-10-01 06:01:59 +0000546 uses: actions/setup-python@v6
Jiayu Liu6f339002023-04-20 07:39:35 +0800547 with:
548 python-version: ${{ matrix.python-version }}
549
550 - name: Python setup
551 run: |
Gregg Donovan62ec9292026-01-29 16:51:37 -0500552 python -m pip install --upgrade pip setuptools wheel flake8 "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1"
Jiayu Liu6f339002023-04-20 07:39:35 +0800553 python --version
554 pip --version
555
Jiayu Liu6f339002023-04-20 07:39:35 +0800556 - name: Run bootstrap
557 run: ./bootstrap.sh
558
Carel Combrinkf2534ad2025-11-11 12:51:21 +0000559 - name: Run configure
Jiayu Liu6f339002023-04-20 07:39:35 +0800560 run: |
561 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/')
562
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000563 - uses: actions/download-artifact@v7
Jiayu Liu6f339002023-04-20 07:39:35 +0800564 with:
565 name: thrift-compiler
566 path: compiler/cpp
567
568 - name: Run thrift-compiler
569 run: |
570 chmod a+x compiler/cpp/thrift
571 compiler/cpp/thrift -version
572
573 - name: Run make for python
574 run: make -C lib/py
575
576 - name: Run make install for python
577 run: sudo make -C lib/py install
578
579 # - name: Run make install-exec-hook for python
580 # run: sudo make -C lib/py install-exec-hook
581
Carel Combrink7770d272025-11-11 14:07:19 +0200582 - name: Run make for python libs
583 run: make -C lib/py
584
585 - name: Run make check for python libs
Jiayu Liu6f339002023-04-20 07:39:35 +0800586 run: make -C lib/py check
587
Carel Combrink7770d272025-11-11 14:07:19 +0200588 - name: Run make check for python code
589 run: make -C test/py check
590
Gregg Donovan62ec9292026-01-29 16:51:37 -0500591 lib-python-macos:
592 needs: compiler-macos
593 strategy:
594 matrix:
595 os: *macos_versions
596 python-version: *python_versions
597 fail-fast: false
598 runs-on: ${{ matrix.os }}
599 steps:
600 - uses: actions/checkout@v6
601
602 - name: Install dependencies
603 run: |
604 brew install automake bison flex boost libevent openssl libtool pkg-config
605 echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
606
607 - name: Set up Python
608 uses: actions/setup-python@v6
609 with:
610 python-version: ${{ matrix.python-version }}
611
612 - name: Python setup
613 run: |
614 python -m pip install --upgrade pip setuptools wheel flake8 "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1"
615 python --version
616 pip --version
617
618 - name: Run bootstrap
619 run: ./bootstrap.sh
620
621 - name: Run configure
622 run: ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/')
623
624 - uses: actions/download-artifact@v6
625 with:
626 name: thrift-compiler-${{ matrix.os }}
627 path: compiler/cpp
628
629 - name: Run thrift-compiler
630 run: |
631 chmod a+x compiler/cpp/thrift
632 compiler/cpp/thrift -version
633
634 - name: Run make for python
635 run: make -C lib/py
636
637 - name: Run make install for python
638 run: |
639 sudo make -C lib/py install PY_PREFIX="$(python -c 'import sys; print(sys.prefix)')"
640
641 - name: Run make for python libs
642 run: make -C lib/py
643
644 - name: Run make check for python libs
645 run: make -C lib/py check
646
647 - name: Run make check for python code
648 run: make -C test/py check
649
Cameron Martinab706522025-01-12 08:54:49 +0000650 lib-nodejs:
651 needs: compiler
652 runs-on: ubuntu-24.04
653 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000654 - uses: actions/checkout@v6
Cameron Martinab706522025-01-12 08:54:49 +0000655
656 - name: Run bootstrap
657 run: ./bootstrap.sh
658
659 - name: Run configure
660 run: |
Cameron Martina675c4f2025-01-15 16:38:07 +0000661 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-node([tj])s/with-node\1s/g')
Cameron Martinab706522025-01-12 08:54:49 +0000662
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000663 - uses: actions/download-artifact@v7
Cameron Martinab706522025-01-12 08:54:49 +0000664 with:
665 name: thrift-compiler
666 path: compiler/cpp
667
668 - name: Run thrift-compiler
669 run: |
670 chmod a+x compiler/cpp/thrift
671 compiler/cpp/thrift -version
672
Cameron Martina675c4f2025-01-15 16:38:07 +0000673 - name: Run js tests
Cameron Martinab706522025-01-12 08:54:49 +0000674 run: make -C lib/nodejs check
675
Cameron Martina675c4f2025-01-15 16:38:07 +0000676 - name: Run ts tests
677 run: make -C lib/nodets check
678
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200679 lib-cpp:
680 needs: compiler
681 runs-on: ubuntu-24.04
682 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000683 - uses: actions/checkout@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200684
685 - name: Install dependencies
686 run: |
687 sudo apt-get update -yq
688 sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS locales
689 sudo locale-gen en_US.UTF-8
690 sudo locale-gen de_DE.UTF-8
691 sudo update-locale
692
693 - name: Run bootstrap
694 run: ./bootstrap.sh
695
696 - name: Run configure
697 run: |
698 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-cpp/with-cpp/g')
699
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000700 - uses: actions/download-artifact@v7
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200701 with:
702 name: thrift-compiler
703 path: compiler/cpp
704
705 - name: Run thrift-compiler
706 run: |
707 chmod a+x compiler/cpp/thrift
708 compiler/cpp/thrift -version
709
710 - name: Run make for cpp
711 run: make -j$(nproc) -C lib/cpp
712
713 - name: Run make check for lib/cpp
714 run: make -j$(nproc) -C lib/cpp check
715
716 - name: Run make check for test/cpp
717 run: make -j$(nproc) -C test/cpp check
718
719 - name: Run make precross for cpp test
720 run: make -j$(nproc) -C test/cpp precross
721
722 - name: Upload cpp precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000723 uses: actions/upload-artifact@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200724 with:
725 name: cpp-precross
726 if-no-files-found: error
727 include-hidden-files: true
728 path: |
729 test/cpp/TestClient
730 test/cpp/TestServer
731 test/cpp/.libs/TestClient
732 test/cpp/.libs/TestServer
733 lib/cpp/.libs/*.so
734 retention-days: 3
735
736 - name: Upload log files from failed test runs
dependabot[bot]b8f24072026-01-01 06:01:45 +0000737 uses: actions/upload-artifact@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200738 if: failure()
739 with:
740 name: lib-cpp-test-log
741 path: lib/cpp/test/*.xml
742 retention-days: 3
743
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500744 lib-ruby:
745 needs: compiler
746 runs-on: ubuntu-24.04
Dmytro Shteflyuk75a28772025-12-17 17:07:27 -0500747 name: lib-ruby (${{ matrix.ruby-version }}) ${{ matrix.skip-build-ext && 'noext' || '' }}
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500748 strategy:
749 matrix:
750 ruby-version: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "4.0", "head"]
Dmytro Shteflyuk75a28772025-12-17 17:07:27 -0500751 skip-build-ext: [false]
752 include:
753 - ruby-version: "2.7"
754 skip-build-ext: true
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500755 fail-fast: false
Dmytro Shteflyuk75a28772025-12-17 17:07:27 -0500756 env:
757 SKIP_BUILD_EXT: ${{ matrix.skip-build-ext && '1' || '' }}
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500758 steps:
759 - uses: actions/checkout@v5
760
761 - name: Set up Ruby
762 uses: ruby/setup-ruby@v1
763 with:
764 ruby-version: ${{ matrix.ruby-version }}
765 bundler-cache: true
766 working-directory: lib/rb
767
768 - name: Run bootstrap
769 run: ./bootstrap.sh
770
771 - name: Run configure
772 run: |
773 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-ruby/with-ruby/')
774
775 - uses: actions/download-artifact@v6
776 with:
777 name: thrift-compiler
778 path: compiler/cpp
779
780 - name: Run thrift-compiler
781 run: |
782 chmod a+x compiler/cpp/thrift
783 compiler/cpp/thrift -version
784
785 - name: Run make for ruby
786 run: make -C lib/rb
787
788 - name: Run make check for lib/rb
789 run: make -C lib/rb check
790
791 - name: Run make check for test/rb
792 run: make -C test/rb check
793
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800794 cross-test:
795 needs:
796 - lib-java-kotlin
Jens Geyer63b7a262025-05-25 14:48:57 +0200797 #- lib-swift # swift is currently broken and no maintainers around -> see THRIFT-5864
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800798 - lib-rust
Jiayu Liud21e95a2022-10-09 08:49:29 +0800799 - lib-go
Jiayu Liu6f339002023-04-20 07:39:35 +0800800 - lib-python
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200801 - lib-cpp
Jiayu Liue7f1a262024-11-06 11:37:25 +0800802 runs-on: ubuntu-24.04
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800803 strategy:
804 matrix:
Jens Geyer63b7a262025-05-25 14:48:57 +0200805 # swift is currently broken and no maintainers around -> see THRIFT-5864
Careled55a182025-11-14 10:54:52 +0200806 # kotlin cross test are failing -> see THRIFT-5879
807 server_lang: ['java', 'go', 'rs', 'cpp']
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800808 # we always use comma join as many client langs as possible, to reduce the number of jobs
HTHoud9b4d952026-01-05 14:37:48 +0800809 client_lang: ['java,kotlin', 'go,rs,cpp']
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800810 fail-fast: false
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800811 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000812 - uses: actions/checkout@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800813
dependabot[bot]1a5b7fc2025-10-01 06:01:59 +0000814 - uses: actions/setup-python@v6
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800815 with:
Carel Combrink5abe53f2025-11-13 06:16:41 +0100816 python-version: "3.x"
Jiayu Liud21e95a2022-10-09 08:49:29 +0800817
dependabot[bot]eaec8982025-09-05 15:53:08 -0400818 - uses: actions/setup-java@v5
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800819 with:
820 distribution: temurin
Jiayu Liube73a572023-04-14 11:02:43 +0800821 # here we intentionally use an older version so that we also verify Java 17 compiles to it
Fokko Driesprong0b14a1b2023-04-14 11:06:15 +0200822 java-version: 8
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800823 cache: "gradle"
824
Jiayu Liud21e95a2022-10-09 08:49:29 +0800825 - name: Install openssl and certificates (for SSL tests)
826 run: |
827 sudo apt-get update -yq
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200828 sudo apt-get install -y --no-install-recommends \
829 openssl \
830 ca-certificates \
831 libboost-all-dev \
832 libevent-dev
Jiayu Liud21e95a2022-10-09 08:49:29 +0800833
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800834 - name: Download java precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000835 uses: actions/download-artifact@v7
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800836 with:
837 name: java-precross
838 path: lib/java/build
839
840 - name: Download kotlin precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000841 uses: actions/download-artifact@v7
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800842 with:
843 name: kotlin-precross
844 path: lib/kotlin
845
Jens Geyer63b7a262025-05-25 14:48:57 +0200846 # swift is currently broken and no maintainers around -> see THRIFT-5864
847 #- name: Download swift precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000848 # uses: actions/download-artifact@v7
Jens Geyer63b7a262025-05-25 14:48:57 +0200849 # with:
850 # name: swift-precross
851 # path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug
Kino Roya9da9eb2022-10-07 23:13:01 -0700852
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800853 - name: Download rust precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000854 uses: actions/download-artifact@v7
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800855 with:
856 name: rs-precross
857 path: test/rs/bin
858
Jiayu Liud21e95a2022-10-09 08:49:29 +0800859 - name: Download go precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000860 uses: actions/download-artifact@v7
Jiayu Liud21e95a2022-10-09 08:49:29 +0800861 with:
862 name: go-precross
863 path: test/go/bin
864
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200865 - name: Download cpp precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000866 uses: actions/download-artifact@v7
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200867 with:
868 name: cpp-precross
869 path: .
870
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800871 - name: Set back executable flags
872 run: |
Yuxuan 'fishy' Wang716835f2025-05-28 15:44:53 -0700873 chmod a+x lib/java/build/run*
874 chmod a+x lib/kotlin/cross-test-client/build/install/TestClient/bin/*
875 chmod a+x lib/kotlin/cross-test-server/build/install/TestServer/bin/*
876 # THRIFT-5864 chmod a+x test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/*
877 chmod a+x test/rs/bin/*
878 chmod a+x test/go/bin/*
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200879 chmod a+x test/cpp/*
880 chmod a+x test/cpp/.libs/*
881 chmod a+x lib/cpp/.libs/*.so
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800882
Kino Roy29d87732023-02-20 22:32:43 -0800883 - name: Create tmp domain socket folder
884 run: mkdir /tmp/v0.16
885
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800886 - name: Run cross test
887 env:
888 THRIFT_CROSSTEST_CONCURRENCY: 4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800889 run: |
890 python test/test.py \
891 --retry-count 5 \
892 --skip-known-failures \
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800893 --server ${{ matrix.server_lang }} \
894 --client ${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800895
896 - name: Upload log files from failed cross test runs
dependabot[bot]b8f24072026-01-01 06:01:45 +0000897 uses: actions/upload-artifact@v6
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800898 if: failure()
899 with:
Sven Roederer18b0de62024-07-06 03:59:37 +0200900 name: cross-test-log_${{ matrix.server_lang }}-${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800901 path: test/log/
902 retention-days: 3