blob: 2facf315ef9c5e8556436f2616fdbb938d7d4e0e [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)
dependabot[bot]e01b1b02026-02-04 16:10:05 +0000111 uses: actions/upload-artifact@v6
Gregg Donovan62ec9292026-01-29 16:51:37 -0500112 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 Donovanc99d09a2026-02-01 08:36:17 -0500591 - name: Run make precross for python
592 if: matrix.python-version == '3.12'
593 run: make -C test/py precross
594
595 - name: Upload python precross artifacts
596 if: matrix.python-version == '3.12'
597 uses: actions/upload-artifact@v6
598 with:
599 name: py-precross
600 if-no-files-found: error
601 path: |
602 lib/py/build/lib.*
603 test/py/gen-py
604 test/py/TestClient.py
605 test/py/TestServer.py
606 test/py/util.py
607 retention-days: 3
608
Gregg Donovan62ec9292026-01-29 16:51:37 -0500609 lib-python-macos:
610 needs: compiler-macos
611 strategy:
612 matrix:
613 os: *macos_versions
614 python-version: *python_versions
615 fail-fast: false
616 runs-on: ${{ matrix.os }}
617 steps:
618 - uses: actions/checkout@v6
619
620 - name: Install dependencies
621 run: |
622 brew install automake bison flex boost libevent openssl libtool pkg-config
623 echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
624
625 - name: Set up Python
626 uses: actions/setup-python@v6
627 with:
628 python-version: ${{ matrix.python-version }}
629
630 - name: Python setup
631 run: |
632 python -m pip install --upgrade pip setuptools wheel flake8 "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1"
633 python --version
634 pip --version
635
636 - name: Run bootstrap
637 run: ./bootstrap.sh
638
639 - name: Run configure
640 run: ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/')
641
642 - uses: actions/download-artifact@v6
643 with:
644 name: thrift-compiler-${{ matrix.os }}
645 path: compiler/cpp
646
647 - name: Run thrift-compiler
648 run: |
649 chmod a+x compiler/cpp/thrift
650 compiler/cpp/thrift -version
651
652 - name: Run make for python
653 run: make -C lib/py
654
655 - name: Run make install for python
656 run: |
657 sudo make -C lib/py install PY_PREFIX="$(python -c 'import sys; print(sys.prefix)')"
658
659 - name: Run make for python libs
660 run: make -C lib/py
661
662 - name: Run make check for python libs
663 run: make -C lib/py check
664
665 - name: Run make check for python code
666 run: make -C test/py check
667
Cameron Martinab706522025-01-12 08:54:49 +0000668 lib-nodejs:
669 needs: compiler
670 runs-on: ubuntu-24.04
671 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000672 - uses: actions/checkout@v6
Cameron Martinab706522025-01-12 08:54:49 +0000673
674 - name: Run bootstrap
675 run: ./bootstrap.sh
676
677 - name: Run configure
678 run: |
Cameron Martina675c4f2025-01-15 16:38:07 +0000679 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-node([tj])s/with-node\1s/g')
Cameron Martinab706522025-01-12 08:54:49 +0000680
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000681 - uses: actions/download-artifact@v7
Cameron Martinab706522025-01-12 08:54:49 +0000682 with:
683 name: thrift-compiler
684 path: compiler/cpp
685
686 - name: Run thrift-compiler
687 run: |
688 chmod a+x compiler/cpp/thrift
689 compiler/cpp/thrift -version
690
Cameron Martina675c4f2025-01-15 16:38:07 +0000691 - name: Run js tests
Cameron Martinab706522025-01-12 08:54:49 +0000692 run: make -C lib/nodejs check
693
Cameron Martina675c4f2025-01-15 16:38:07 +0000694 - name: Run ts tests
695 run: make -C lib/nodets check
696
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200697 lib-cpp:
698 needs: compiler
699 runs-on: ubuntu-24.04
700 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000701 - uses: actions/checkout@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200702
703 - name: Install dependencies
704 run: |
705 sudo apt-get update -yq
706 sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS locales
707 sudo locale-gen en_US.UTF-8
708 sudo locale-gen de_DE.UTF-8
709 sudo update-locale
710
711 - name: Run bootstrap
712 run: ./bootstrap.sh
713
714 - name: Run configure
715 run: |
716 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed -E 's/without-cpp/with-cpp/g')
717
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000718 - uses: actions/download-artifact@v7
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200719 with:
720 name: thrift-compiler
721 path: compiler/cpp
722
723 - name: Run thrift-compiler
724 run: |
725 chmod a+x compiler/cpp/thrift
726 compiler/cpp/thrift -version
727
728 - name: Run make for cpp
729 run: make -j$(nproc) -C lib/cpp
730
731 - name: Run make check for lib/cpp
732 run: make -j$(nproc) -C lib/cpp check
733
734 - name: Run make check for test/cpp
735 run: make -j$(nproc) -C test/cpp check
736
737 - name: Run make precross for cpp test
738 run: make -j$(nproc) -C test/cpp precross
739
740 - name: Upload cpp precross artifacts
dependabot[bot]b8f24072026-01-01 06:01:45 +0000741 uses: actions/upload-artifact@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200742 with:
743 name: cpp-precross
744 if-no-files-found: error
745 include-hidden-files: true
746 path: |
747 test/cpp/TestClient
748 test/cpp/TestServer
749 test/cpp/.libs/TestClient
750 test/cpp/.libs/TestServer
751 lib/cpp/.libs/*.so
752 retention-days: 3
753
754 - name: Upload log files from failed test runs
dependabot[bot]b8f24072026-01-01 06:01:45 +0000755 uses: actions/upload-artifact@v6
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200756 if: failure()
757 with:
758 name: lib-cpp-test-log
759 path: lib/cpp/test/*.xml
760 retention-days: 3
761
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500762 lib-ruby:
763 needs: compiler
764 runs-on: ubuntu-24.04
Dmytro Shteflyuk75a28772025-12-17 17:07:27 -0500765 name: lib-ruby (${{ matrix.ruby-version }}) ${{ matrix.skip-build-ext && 'noext' || '' }}
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500766 strategy:
767 matrix:
768 ruby-version: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "4.0", "head"]
Dmytro Shteflyuk75a28772025-12-17 17:07:27 -0500769 skip-build-ext: [false]
770 include:
771 - ruby-version: "2.7"
772 skip-build-ext: true
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500773 fail-fast: false
Dmytro Shteflyuk75a28772025-12-17 17:07:27 -0500774 env:
775 SKIP_BUILD_EXT: ${{ matrix.skip-build-ext && '1' || '' }}
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500776 steps:
dependabot[bot]d4cbd782026-02-04 16:10:02 +0000777 - uses: actions/checkout@v6
Dmytro Shteflyuk6e5e1812025-11-19 18:20:45 -0500778
779 - name: Set up Ruby
780 uses: ruby/setup-ruby@v1
781 with:
782 ruby-version: ${{ matrix.ruby-version }}
783 bundler-cache: true
784 working-directory: lib/rb
785
786 - name: Run bootstrap
787 run: ./bootstrap.sh
788
789 - name: Run configure
790 run: |
791 ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-ruby/with-ruby/')
792
793 - uses: actions/download-artifact@v6
794 with:
795 name: thrift-compiler
796 path: compiler/cpp
797
798 - name: Run thrift-compiler
799 run: |
800 chmod a+x compiler/cpp/thrift
801 compiler/cpp/thrift -version
802
803 - name: Run make for ruby
804 run: make -C lib/rb
805
806 - name: Run make check for lib/rb
807 run: make -C lib/rb check
808
809 - name: Run make check for test/rb
810 run: make -C test/rb check
811
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800812 cross-test:
813 needs:
814 - lib-java-kotlin
Jens Geyer63b7a262025-05-25 14:48:57 +0200815 #- lib-swift # swift is currently broken and no maintainers around -> see THRIFT-5864
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800816 - lib-rust
Jiayu Liud21e95a2022-10-09 08:49:29 +0800817 - lib-go
Jiayu Liu6f339002023-04-20 07:39:35 +0800818 - lib-python
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200819 - lib-cpp
Jiayu Liue7f1a262024-11-06 11:37:25 +0800820 runs-on: ubuntu-24.04
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800821 strategy:
822 matrix:
Jens Geyer63b7a262025-05-25 14:48:57 +0200823 # swift is currently broken and no maintainers around -> see THRIFT-5864
Careled55a182025-11-14 10:54:52 +0200824 # kotlin cross test are failing -> see THRIFT-5879
Gregg Donovanc99d09a2026-02-01 08:36:17 -0500825 server_lang: ['java', 'go', 'rs', 'cpp', 'py']
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800826 # we always use comma join as many client langs as possible, to reduce the number of jobs
Gregg Donovanc99d09a2026-02-01 08:36:17 -0500827 client_lang: ['java,kotlin', 'go,rs,cpp', 'py']
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800828 fail-fast: false
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800829 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +0000830 - uses: actions/checkout@v6
Jiayu Liud21e95a2022-10-09 08:49:29 +0800831
dependabot[bot]1a5b7fc2025-10-01 06:01:59 +0000832 - uses: actions/setup-python@v6
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800833 with:
Gregg Donovanc99d09a2026-02-01 08:36:17 -0500834 python-version: "3.12"
835
836 - name: Install Python test dependencies
837 run: |
838 python -m pip install --upgrade pip setuptools
839 python -m pip install "tornado>=6.3.0" "twisted>=24.3.0" "zope.interface>=6.1"
Jiayu Liud21e95a2022-10-09 08:49:29 +0800840
dependabot[bot]eaec8982025-09-05 15:53:08 -0400841 - uses: actions/setup-java@v5
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800842 with:
843 distribution: temurin
Jiayu Liube73a572023-04-14 11:02:43 +0800844 # here we intentionally use an older version so that we also verify Java 17 compiles to it
Fokko Driesprong0b14a1b2023-04-14 11:06:15 +0200845 java-version: 8
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800846 cache: "gradle"
847
Jiayu Liud21e95a2022-10-09 08:49:29 +0800848 - name: Install openssl and certificates (for SSL tests)
849 run: |
850 sudo apt-get update -yq
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200851 sudo apt-get install -y --no-install-recommends \
852 openssl \
853 ca-certificates \
854 libboost-all-dev \
855 libevent-dev
Jiayu Liud21e95a2022-10-09 08:49:29 +0800856
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800857 - name: Download java precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000858 uses: actions/download-artifact@v7
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800859 with:
860 name: java-precross
861 path: lib/java/build
862
863 - name: Download kotlin precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000864 uses: actions/download-artifact@v7
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800865 with:
866 name: kotlin-precross
867 path: lib/kotlin
868
Jens Geyer63b7a262025-05-25 14:48:57 +0200869 # swift is currently broken and no maintainers around -> see THRIFT-5864
870 #- name: Download swift precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000871 # uses: actions/download-artifact@v7
Jens Geyer63b7a262025-05-25 14:48:57 +0200872 # with:
873 # name: swift-precross
874 # path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug
Kino Roya9da9eb2022-10-07 23:13:01 -0700875
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800876 - name: Download rust precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000877 uses: actions/download-artifact@v7
Jiayu Liu0aad2ae2022-10-08 13:22:24 +0800878 with:
879 name: rs-precross
880 path: test/rs/bin
881
Jiayu Liud21e95a2022-10-09 08:49:29 +0800882 - name: Download go precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000883 uses: actions/download-artifact@v7
Jiayu Liud21e95a2022-10-09 08:49:29 +0800884 with:
885 name: go-precross
886 path: test/go/bin
887
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200888 - name: Download cpp precross artifacts
dependabot[bot]22ffdc72026-01-01 06:01:58 +0000889 uses: actions/download-artifact@v7
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200890 with:
891 name: cpp-precross
892 path: .
893
Gregg Donovanc99d09a2026-02-01 08:36:17 -0500894 - name: Download python precross artifacts
895 uses: actions/download-artifact@v7
896 with:
897 name: py-precross
898 path: .
899
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800900 - name: Set back executable flags
901 run: |
Yuxuan 'fishy' Wang716835f2025-05-28 15:44:53 -0700902 chmod a+x lib/java/build/run*
903 chmod a+x lib/kotlin/cross-test-client/build/install/TestClient/bin/*
904 chmod a+x lib/kotlin/cross-test-server/build/install/TestServer/bin/*
905 # THRIFT-5864 chmod a+x test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/*
906 chmod a+x test/rs/bin/*
907 chmod a+x test/go/bin/*
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200908 chmod a+x test/cpp/*
909 chmod a+x test/cpp/.libs/*
910 chmod a+x lib/cpp/.libs/*.so
Gregg Donovanc99d09a2026-02-01 08:36:17 -0500911 chmod a+x test/py/*.py
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800912
Kino Roy29d87732023-02-20 22:32:43 -0800913 - name: Create tmp domain socket folder
914 run: mkdir /tmp/v0.16
915
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800916 - name: Run cross test
917 env:
918 THRIFT_CROSSTEST_CONCURRENCY: 4
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800919 run: |
920 python test/test.py \
921 --retry-count 5 \
922 --skip-known-failures \
Jiayu Liu790d4cb2023-04-27 11:35:17 +0800923 --server ${{ matrix.server_lang }} \
924 --client ${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800925
926 - name: Upload log files from failed cross test runs
dependabot[bot]b8f24072026-01-01 06:01:45 +0000927 uses: actions/upload-artifact@v6
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800928 if: failure()
929 with:
Sven Roederer18b0de62024-07-06 03:59:37 +0200930 name: cross-test-log_${{ matrix.server_lang }}-${{ matrix.client_lang }}
Jiayu Liuab83ffc2022-05-10 01:56:30 +0800931 path: test/log/
932 retention-days: 3