Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 1 | name: "Build" |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 2 | |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 3 | on: |
| 4 | push: |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 5 | branches: ["*"] |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 6 | pull_request: |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 7 | branches: ["*"] |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 8 | |
| 9 | env: |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 10 | BUILD_DEPS: automake bison flex git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 11 | CONFIG_ARGS_FOR_LIBS: > |
| 12 | --disable-debug |
| 13 | --disable-tests |
| 14 | --disable-dependency-tracking |
| 15 | --without-cpp |
| 16 | --without-c_glib |
| 17 | --without-java |
| 18 | --without-kotlin |
| 19 | --without-python |
| 20 | --without-py3 |
| 21 | --without-ruby |
| 22 | --without-haxe |
| 23 | --without-netstd |
| 24 | --without-perl |
| 25 | --without-php |
| 26 | --without-php_extension |
| 27 | --without-dart |
| 28 | --without-erlang |
| 29 | --without-go |
| 30 | --without-d |
| 31 | --without-nodejs |
| 32 | --without-nodets |
| 33 | --without-lua |
| 34 | --without-rs |
| 35 | --without-swift |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 36 | |
Varun Sharma | bd1e5db | 2022-09-14 07:31:30 -0700 | [diff] [blame] | 37 | permissions: |
| 38 | contents: read |
| 39 | |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 40 | jobs: |
| 41 | # TODO windows and macos |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 42 | compiler: |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 43 | strategy: |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 44 | matrix: |
Jiayu Liu | 564b287 | 2022-10-12 11:42:38 +0800 | [diff] [blame] | 45 | os: [ubuntu-20.04, ubuntu-22.04] |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 46 | runs-on: ${{ matrix.os }} |
| 47 | steps: |
| 48 | - uses: actions/checkout@v3 |
| 49 | |
| 50 | - name: Install dependencies |
| 51 | run: | |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 52 | sudo apt-get update -yq |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 53 | sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 54 | |
| 55 | - name: Run bootstrap |
| 56 | run: ./bootstrap.sh |
| 57 | |
| 58 | - name: Run configure |
| 59 | run: ./configure --disable-debug --disable-tests --disable-libs |
| 60 | |
| 61 | - name: Run make |
| 62 | run: make -j$(nproc) |
| 63 | |
| 64 | - name: Run install |
| 65 | run: make install |
| 66 | |
| 67 | - name: Run thrift version |
| 68 | run: /usr/local/bin/thrift -version |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 69 | |
| 70 | # only upload while building ubuntu-20.04 |
| 71 | - name: Archive built thrift compiler |
| 72 | if: matrix.os == 'ubuntu-20.04' |
| 73 | uses: actions/upload-artifact@v3 |
| 74 | with: |
| 75 | name: thrift-compiler |
| 76 | path: compiler/cpp/thrift |
| 77 | retention-days: 3 |
| 78 | |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 79 | lib-go: |
| 80 | needs: compiler |
| 81 | runs-on: ubuntu-20.04 |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 82 | strategy: |
| 83 | matrix: |
| 84 | go: |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 85 | - '1.19' |
Yuxuan 'fishy' Wang | b94eac7 | 2023-02-02 09:41:31 -0800 | [diff] [blame] | 86 | - '1.20' |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 87 | steps: |
| 88 | - uses: actions/checkout@v3 |
| 89 | |
dependabot[bot] | ccfb91e | 2023-04-27 08:46:40 +0800 | [diff] [blame] | 90 | - uses: actions/setup-go@v4 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 91 | with: |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 92 | go-version: ${{ matrix.go }} |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 93 | |
| 94 | - name: Install dependencies |
| 95 | run: | |
| 96 | sudo apt-get update -yq |
| 97 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 98 | |
| 99 | - name: Run bootstrap |
| 100 | run: ./bootstrap.sh |
| 101 | |
| 102 | - name: Run configure |
| 103 | run: | |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 104 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-go/with-go/') |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 105 | |
| 106 | - uses: actions/download-artifact@v3 |
| 107 | with: |
| 108 | name: thrift-compiler |
| 109 | path: compiler/cpp |
| 110 | |
| 111 | - name: Run thrift-compiler |
| 112 | run: | |
| 113 | chmod a+x compiler/cpp/thrift |
| 114 | compiler/cpp/thrift -version |
| 115 | |
| 116 | - name: Run make for go |
| 117 | run: make -C lib/go |
| 118 | |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 119 | - name: Run make check for lib/go |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 120 | run: make -C lib/go check |
| 121 | |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 122 | - name: Run make check for test/go |
| 123 | run: make -C test/go check |
| 124 | |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 125 | - name: Run make precross for go test |
| 126 | run: make -C test/go precross |
| 127 | |
| 128 | - name: Upload go precross artifacts |
Yuxuan 'fishy' Wang | b94eac7 | 2023-02-02 09:41:31 -0800 | [diff] [blame] | 129 | if: matrix.go == '1.20' |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 130 | uses: actions/upload-artifact@v3 |
| 131 | with: |
| 132 | name: go-precross |
| 133 | if-no-files-found: error |
| 134 | path: | |
| 135 | test/go/bin/* |
| 136 | retention-days: 3 |
| 137 | |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 138 | lib-java-kotlin: |
| 139 | needs: compiler |
| 140 | runs-on: ubuntu-20.04 |
| 141 | env: |
Jiayu Liu | be73a57 | 2023-04-14 11:02:43 +0800 | [diff] [blame] | 142 | GRADLE_VERSION: "8.0.2" |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 143 | steps: |
| 144 | - uses: actions/checkout@v3 |
| 145 | |
| 146 | - uses: actions/setup-java@v3 |
| 147 | with: |
| 148 | distribution: temurin |
Jiayu Liu | 92b007f | 2022-10-14 13:16:18 +0800 | [diff] [blame] | 149 | java-version: 17 |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 150 | cache: "gradle" |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 151 | |
| 152 | - name: Install dependencies |
| 153 | run: | |
| 154 | sudo apt-get update -yq |
| 155 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 156 | sudo apt-get install -y wget unzip ant maven |
| 157 | |
| 158 | - name: Setup gradle |
| 159 | run: | |
| 160 | wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip |
Jiayu Liu | be73a57 | 2023-04-14 11:02:43 +0800 | [diff] [blame] | 161 | (echo "ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7 /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -) |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 162 | unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip |
| 163 | sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle |
| 164 | sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin |
| 165 | gradle --version |
| 166 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 167 | - name: Run spotlessCheck for Java |
Jiayu Liu | 53ec082 | 2022-05-06 12:56:42 +0800 | [diff] [blame] | 168 | run: | |
| 169 | cd lib/java |
| 170 | gradle spotlessCheck |
| 171 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 172 | - name: Run ktfmtCheck for Kotlin |
| 173 | run: | |
| 174 | cd lib/kotlin |
| 175 | gradle ktfmtCheck |
| 176 | |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 177 | - name: Run bootstrap |
| 178 | run: ./bootstrap.sh |
| 179 | |
| 180 | - name: Run configure |
| 181 | run: | |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 182 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-java/with-java/' | sed 's/without-kotlin/with-kotlin/') |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 183 | |
| 184 | - uses: actions/download-artifact@v3 |
| 185 | with: |
| 186 | name: thrift-compiler |
| 187 | path: compiler/cpp |
| 188 | |
| 189 | - name: Run thrift-compiler |
| 190 | run: | |
| 191 | chmod a+x compiler/cpp/thrift |
| 192 | compiler/cpp/thrift -version |
| 193 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 194 | - name: Run make for java |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 195 | run: make -C lib/java |
| 196 | |
Jiayu Liu | 5b15838 | 2022-05-12 00:20:37 +0800 | [diff] [blame] | 197 | # this will invoke publishToMavenLocal and install locally |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 198 | - name: Run make install for java |
| 199 | run: make -C lib/java install |
| 200 | |
| 201 | - name: Upload java libthrift artifacts |
| 202 | uses: actions/upload-artifact@v3 |
| 203 | with: |
| 204 | name: libthrift |
| 205 | if-no-files-found: error |
| 206 | path: ~/.m2/repository/org/apache/thrift |
| 207 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 208 | - name: Run make check for java |
| 209 | run: make -C lib/java check |
| 210 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 211 | - name: Run make precross for java |
| 212 | run: make -C lib/java precross |
| 213 | |
| 214 | - name: Upload java precross artifacts |
| 215 | uses: actions/upload-artifact@v3 |
| 216 | with: |
| 217 | name: java-precross |
| 218 | if-no-files-found: error |
| 219 | path: | |
| 220 | lib/java/build/functionalTestJar/ |
| 221 | lib/java/build/runclient |
| 222 | lib/java/build/runnonblockingserver |
| 223 | lib/java/build/runserver |
| 224 | lib/java/build/runservletserver |
| 225 | retention-days: 3 |
| 226 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 227 | - name: Run make for kotlin |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 228 | run: make -C lib/kotlin |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 229 | |
| 230 | - name: Run make check for kotlin |
| 231 | run: make -C lib/kotlin check |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 232 | |
| 233 | - name: Run make precross for kotlin |
| 234 | run: make -C lib/kotlin precross |
| 235 | |
| 236 | - name: Upload kotlin precross artifacts |
| 237 | uses: actions/upload-artifact@v3 |
| 238 | with: |
| 239 | name: kotlin-precross |
| 240 | if-no-files-found: error |
| 241 | path: | |
| 242 | lib/kotlin/cross-test-client/build/install/TestClient/ |
| 243 | lib/kotlin/cross-test-server/build/install/TestServer/ |
| 244 | retention-days: 3 |
| 245 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 246 | lib-swift: |
| 247 | needs: compiler |
| 248 | runs-on: ubuntu-20.04 |
| 249 | steps: |
| 250 | - uses: actions/checkout@v3 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 251 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 252 | - name: Run bootstrap |
| 253 | run: ./bootstrap.sh |
| 254 | |
| 255 | - name: Run configure |
| 256 | run: | |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 257 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-swift/with-swift/') |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 258 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 259 | - uses: actions/download-artifact@v3 |
| 260 | with: |
| 261 | name: thrift-compiler |
| 262 | path: compiler/cpp |
| 263 | |
| 264 | - name: Run thrift-compiler |
| 265 | run: | |
| 266 | chmod a+x compiler/cpp/thrift |
| 267 | compiler/cpp/thrift -version |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 268 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 269 | - name: Run make precross for swift |
| 270 | run: make -C test/swift precross |
| 271 | |
| 272 | - name: Upload swift precross artifacts |
| 273 | uses: actions/upload-artifact@v3 |
| 274 | with: |
| 275 | name: swift-precross |
| 276 | if-no-files-found: error |
| 277 | path: | |
| 278 | test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestServer |
| 279 | test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient |
| 280 | retention-days: 3 |
| 281 | |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 282 | lib-rust: |
| 283 | needs: compiler |
| 284 | runs-on: ubuntu-20.04 |
| 285 | env: |
| 286 | TOOLCHAIN_VERSION: 1.61.0 |
| 287 | steps: |
| 288 | - uses: actions/checkout@v3 |
| 289 | |
| 290 | - name: Install dependencies |
| 291 | run: | |
| 292 | sudo apt-get update -yq |
| 293 | sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS |
| 294 | |
| 295 | - name: Setup cargo |
| 296 | run: | |
| 297 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 298 | rustup update |
| 299 | rustup install $TOOLCHAIN_VERSION |
| 300 | rustup default $TOOLCHAIN_VERSION |
| 301 | rustup --version |
| 302 | cargo --version |
| 303 | rustc --version |
| 304 | |
| 305 | - name: Run bootstrap |
| 306 | run: ./bootstrap.sh |
| 307 | |
| 308 | - name: Run configure |
| 309 | run: | |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 310 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-rs/with-rs/') |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 311 | |
| 312 | - uses: actions/download-artifact@v3 |
| 313 | with: |
| 314 | name: thrift-compiler |
| 315 | path: compiler/cpp |
| 316 | |
| 317 | - name: Run thrift-compiler |
| 318 | run: | |
| 319 | chmod a+x compiler/cpp/thrift |
| 320 | compiler/cpp/thrift -version |
| 321 | |
| 322 | - name: Run make for rust |
| 323 | run: make -C lib/rs |
| 324 | |
| 325 | - name: Run make check for rust |
| 326 | run: make -C lib/rs check |
| 327 | |
| 328 | - name: Run make test for rust |
| 329 | run: make -C lib/rs/test check |
| 330 | |
| 331 | - name: Run make precross for test rust |
| 332 | run: make -C test/rs precross |
| 333 | |
| 334 | - name: Upload rust precross artifacts |
| 335 | uses: actions/upload-artifact@v3 |
| 336 | with: |
| 337 | name: rs-precross |
| 338 | if-no-files-found: error |
| 339 | path: | |
| 340 | test/rs/bin/test_server |
| 341 | test/rs/bin/test_client |
| 342 | retention-days: 3 |
| 343 | |
| 344 | - name: Run make test_recursive for rust |
| 345 | run: make -C lib/rs/test_recursive check |
| 346 | |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 347 | lib-python: |
| 348 | needs: compiler |
| 349 | runs-on: ubuntu-20.04 |
| 350 | strategy: |
| 351 | matrix: |
| 352 | python-version: ["2.x", "3.x"] |
| 353 | steps: |
| 354 | - uses: actions/checkout@v3 |
| 355 | |
| 356 | - name: Install dependencies |
| 357 | run: | |
| 358 | sudo apt-get update -yq |
| 359 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 360 | sudo apt-get install -y --no-install-recommends curl openssl ca-certificates |
| 361 | |
| 362 | - name: Set up Python |
dependabot[bot] | 9141c0c | 2023-04-27 08:45:46 +0800 | [diff] [blame] | 363 | uses: actions/setup-python@v4 |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 364 | with: |
| 365 | python-version: ${{ matrix.python-version }} |
| 366 | |
| 367 | - name: Python setup |
| 368 | run: | |
| 369 | python -m pip install --upgrade pip setuptools wheel flake8 tornado twisted zope.interface |
| 370 | python --version |
| 371 | pip --version |
| 372 | |
| 373 | - name: Python 2.x backport setup |
| 374 | if: matrix.python-version == '2.x' |
| 375 | run: | |
| 376 | python -m pip install --upgrade ipaddress backports.ssl_match_hostname |
| 377 | |
| 378 | - name: Run bootstrap |
| 379 | run: ./bootstrap.sh |
| 380 | |
| 381 | - name: Run configure 2.x |
| 382 | if: matrix.python-version == '2.x' |
| 383 | run: | |
| 384 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-python/with-python/') |
| 385 | |
| 386 | - name: Run configure 3.x |
| 387 | if: matrix.python-version != '2.x' |
| 388 | run: | |
| 389 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/') |
| 390 | |
| 391 | - uses: actions/download-artifact@v3 |
| 392 | with: |
| 393 | name: thrift-compiler |
| 394 | path: compiler/cpp |
| 395 | |
| 396 | - name: Run thrift-compiler |
| 397 | run: | |
| 398 | chmod a+x compiler/cpp/thrift |
| 399 | compiler/cpp/thrift -version |
| 400 | |
| 401 | - name: Run make for python |
| 402 | run: make -C lib/py |
| 403 | |
| 404 | - name: Run make install for python |
| 405 | run: sudo make -C lib/py install |
| 406 | |
| 407 | # - name: Run make install-exec-hook for python |
| 408 | # run: sudo make -C lib/py install-exec-hook |
| 409 | |
| 410 | - name: Run make check for python |
| 411 | run: make -C lib/py check |
| 412 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 413 | cross-test: |
| 414 | needs: |
| 415 | - lib-java-kotlin |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 416 | - lib-swift |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 417 | - lib-rust |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 418 | - lib-go |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 419 | - lib-python |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 420 | runs-on: ubuntu-20.04 |
Jiayu Liu | 790d4cb | 2023-04-27 11:35:17 +0800 | [diff] [blame^] | 421 | strategy: |
| 422 | matrix: |
| 423 | server_lang: ['java', 'kotlin', 'go', 'rs', 'swift'] |
| 424 | # we always use comma join as many client langs as possible, to reduce the number of jobs |
| 425 | client_lang: ['java,kotlin', 'go,rs', 'swift'] |
| 426 | fail-fast: false |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 427 | steps: |
| 428 | - uses: actions/checkout@v3 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 429 | |
dependabot[bot] | 9141c0c | 2023-04-27 08:45:46 +0800 | [diff] [blame] | 430 | - uses: actions/setup-python@v4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 431 | with: |
| 432 | python-version: "3.x" |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 433 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 434 | - uses: actions/setup-java@v3 |
| 435 | with: |
| 436 | distribution: temurin |
Jiayu Liu | be73a57 | 2023-04-14 11:02:43 +0800 | [diff] [blame] | 437 | # here we intentionally use an older version so that we also verify Java 17 compiles to it |
Jiayu Liu | 92b007f | 2022-10-14 13:16:18 +0800 | [diff] [blame] | 438 | java-version: 11 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 439 | cache: "gradle" |
| 440 | |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 441 | - name: Install openssl and certificates (for SSL tests) |
| 442 | run: | |
| 443 | sudo apt-get update -yq |
| 444 | sudo apt-get install -y --no-install-recommends openssl ca-certificates |
| 445 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 446 | - name: Download java precross artifacts |
| 447 | uses: actions/download-artifact@v3 |
| 448 | with: |
| 449 | name: java-precross |
| 450 | path: lib/java/build |
| 451 | |
| 452 | - name: Download kotlin precross artifacts |
| 453 | uses: actions/download-artifact@v3 |
| 454 | with: |
| 455 | name: kotlin-precross |
| 456 | path: lib/kotlin |
| 457 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 458 | - name: Download swift precross artifacts |
| 459 | uses: actions/download-artifact@v3 |
| 460 | with: |
| 461 | name: swift-precross |
| 462 | path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug |
| 463 | |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 464 | - name: Download rust precross artifacts |
| 465 | uses: actions/download-artifact@v3 |
| 466 | with: |
| 467 | name: rs-precross |
| 468 | path: test/rs/bin |
| 469 | |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 470 | - name: Download go precross artifacts |
| 471 | uses: actions/download-artifact@v3 |
| 472 | with: |
| 473 | name: go-precross |
| 474 | path: test/go/bin |
| 475 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 476 | - name: Set back executable flags |
| 477 | run: | |
| 478 | chmod a+x \ |
| 479 | lib/java/build/run* \ |
| 480 | lib/kotlin/cross-test-client/build/install/TestClient/bin/* \ |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 481 | lib/kotlin/cross-test-server/build/install/TestServer/bin/* \ |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 482 | test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/* \ |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 483 | test/rs/bin/* \ |
| 484 | test/go/bin/* |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 485 | |
| 486 | - name: Run cross test |
| 487 | env: |
| 488 | THRIFT_CROSSTEST_CONCURRENCY: 4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 489 | run: | |
| 490 | python test/test.py \ |
| 491 | --retry-count 5 \ |
| 492 | --skip-known-failures \ |
Jiayu Liu | 790d4cb | 2023-04-27 11:35:17 +0800 | [diff] [blame^] | 493 | --server ${{ matrix.server_lang }} \ |
| 494 | --client ${{ matrix.client_lang }} |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 495 | |
| 496 | - name: Upload log files from failed cross test runs |
| 497 | uses: actions/upload-artifact@v3 |
| 498 | if: failure() |
| 499 | with: |
| 500 | name: cross-test-log |
| 501 | path: test/log/ |
| 502 | retention-days: 3 |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 503 | |