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 |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 13 | --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 Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 35 | |
Varun Sharma | bd1e5db | 2022-09-14 07:31:30 -0700 | [diff] [blame] | 36 | permissions: |
| 37 | contents: read |
| 38 | |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 39 | jobs: |
| 40 | # TODO windows and macos |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 41 | compiler: |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 42 | strategy: |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 43 | matrix: |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 44 | os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] |
Yuxuan 'fishy' Wang | e497030 | 2023-06-27 09:47:58 -0700 | [diff] [blame] | 45 | fail-fast: false |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 46 | runs-on: ${{ matrix.os }} |
| 47 | steps: |
dependabot[bot] | a14231c | 2023-10-04 18:33:29 -0400 | [diff] [blame] | 48 | - uses: actions/checkout@v4 |
Jiayu Liu | 6a61c4e | 2022-04-29 01:25:39 +0800 | [diff] [blame] | 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 | |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 70 | # only upload while building ubuntu-22.04 |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 71 | - name: Archive built thrift compiler |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 72 | if: matrix.os == 'ubuntu-22.04' |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 73 | uses: actions/upload-artifact@v4 |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 74 | with: |
| 75 | name: thrift-compiler |
| 76 | path: compiler/cpp/thrift |
| 77 | retention-days: 3 |
| 78 | |
Volodymyr Panivko | 8e828c0 | 2024-02-19 11:34:48 +0100 | [diff] [blame] | 79 | lib-php: |
| 80 | needs: compiler |
Sven Roederer | 3d02c0f | 2024-07-06 07:36:30 +0200 | [diff] [blame] | 81 | runs-on: ubuntu-22.04 |
Volodymyr Panivko | 8e828c0 | 2024-02-19 11:34:48 +0100 | [diff] [blame] | 82 | strategy: |
| 83 | matrix: |
vladimir.panivko | f692702 | 2024-02-24 17:12:10 +0100 | [diff] [blame] | 84 | php-version: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3] |
Volodymyr Panivko | 8e828c0 | 2024-02-19 11:34:48 +0100 | [diff] [blame] | 85 | fail-fast: false |
| 86 | steps: |
| 87 | - uses: actions/checkout@v4 |
| 88 | |
| 89 | - name: Set up PHP |
| 90 | uses: shivammathur/setup-php@v2 |
| 91 | with: |
| 92 | php-version: ${{ matrix.php-version }} |
Volodymyr Panivko | 9913004 | 2024-03-02 21:41:01 +0100 | [diff] [blame] | 93 | extensions: mbstring, intl, xml, curl |
Volodymyr Panivko | ac52d8d | 2024-02-22 22:09:00 +0100 | [diff] [blame] | 94 | ini-values: "error_reporting=E_ALL" |
Volodymyr Panivko | 8e828c0 | 2024-02-19 11:34:48 +0100 | [diff] [blame] | 95 | |
| 96 | - name: Install Dependencies |
| 97 | run: composer install |
| 98 | |
Volodymyr Panivko | 8e828c0 | 2024-02-19 11:34:48 +0100 | [diff] [blame] | 99 | - name: Run bootstrap |
| 100 | run: ./bootstrap.sh |
| 101 | |
| 102 | - name: Run configure |
| 103 | run: | |
| 104 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-php/with-php/' | sed 's/without-php_extension/with-php_extension/' ) |
| 105 | |
Sven Roederer | 3d02c0f | 2024-07-06 07:36:30 +0200 | [diff] [blame] | 106 | - uses: actions/download-artifact@v4 |
Volodymyr Panivko | 8e828c0 | 2024-02-19 11:34:48 +0100 | [diff] [blame] | 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: Build Thrift Classes |
| 117 | run: | |
| 118 | mkdir -p ./lib/php/test/Resources/packages/php |
| 119 | mkdir -p ./lib/php/test/Resources/packages/phpv |
| 120 | mkdir -p ./lib/php/test/Resources/packages/phpvo |
| 121 | mkdir -p ./lib/php/test/Resources/packages/phpjs |
Volodymyr Panivko | 14fc2be | 2024-02-22 18:17:40 +0100 | [diff] [blame] | 122 | mkdir -p ./lib/php/test/Resources/packages/phpcm |
Volodymyr Panivko | 68139d1 | 2024-03-19 23:14:07 +0100 | [diff] [blame] | 123 | compiler/cpp/thrift --gen php:nsglobal="Basic" -r --out ./lib/php/test/Resources/packages/php lib/php/test/Resources/ThriftTest.thrift |
| 124 | compiler/cpp/thrift --gen php:validate,nsglobal="Validate" -r --out ./lib/php/test/Resources/packages/phpv lib/php/test/Resources/ThriftTest.thrift |
| 125 | compiler/cpp/thrift --gen php:validate,oop,nsglobal="ValidateOop" -r --out ./lib/php/test/Resources/packages/phpvo lib/php/test/Resources/ThriftTest.thrift |
| 126 | compiler/cpp/thrift --gen php:json,nsglobal="Json" -r --out ./lib/php/test/Resources/packages/phpjs lib/php/test/Resources/ThriftTest.thrift |
| 127 | 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 Panivko | 8e828c0 | 2024-02-19 11:34:48 +0100 | [diff] [blame] | 128 | |
| 129 | - name: Run Tests |
| 130 | run: vendor/bin/phpunit -c lib/php/phpunit.xml |
| 131 | |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 132 | lib-go: |
| 133 | needs: compiler |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 134 | runs-on: ubuntu-22.04 |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 135 | strategy: |
| 136 | matrix: |
| 137 | go: |
Yuxuan 'fishy' Wang | 875178c | 2023-11-17 12:36:31 -0800 | [diff] [blame] | 138 | - '1.22' |
Yuxuan 'fishy' Wang | 91565d4 | 2024-08-14 09:01:15 -0700 | [diff] [blame] | 139 | - '1.23' |
Yuxuan 'fishy' Wang | e497030 | 2023-06-27 09:47:58 -0700 | [diff] [blame] | 140 | fail-fast: false |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 141 | steps: |
dependabot[bot] | a14231c | 2023-10-04 18:33:29 -0400 | [diff] [blame] | 142 | - uses: actions/checkout@v4 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 143 | |
dependabot[bot] | 1ebfcf8 | 2024-01-03 16:59:31 +0000 | [diff] [blame] | 144 | - uses: actions/setup-go@v5 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 145 | with: |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 146 | go-version: ${{ matrix.go }} |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 147 | |
| 148 | - name: Install dependencies |
| 149 | run: | |
| 150 | sudo apt-get update -yq |
| 151 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 152 | |
| 153 | - name: Run bootstrap |
| 154 | run: ./bootstrap.sh |
| 155 | |
| 156 | - name: Run configure |
| 157 | run: | |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 158 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-go/with-go/') |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 159 | |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 160 | - uses: actions/download-artifact@v4 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 161 | with: |
| 162 | name: thrift-compiler |
| 163 | path: compiler/cpp |
| 164 | |
| 165 | - name: Run thrift-compiler |
| 166 | run: | |
| 167 | chmod a+x compiler/cpp/thrift |
| 168 | compiler/cpp/thrift -version |
| 169 | |
| 170 | - name: Run make for go |
| 171 | run: make -C lib/go |
| 172 | |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 173 | - name: Run make check for lib/go |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 174 | run: make -C lib/go check |
| 175 | |
Yuxuan 'fishy' Wang | 19c13b4 | 2022-10-12 14:13:15 -0700 | [diff] [blame] | 176 | - name: Run make check for test/go |
| 177 | run: make -C test/go check |
| 178 | |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 179 | - name: Run make precross for go test |
| 180 | run: make -C test/go precross |
| 181 | |
| 182 | - name: Upload go precross artifacts |
Yuxuan 'fishy' Wang | 91565d4 | 2024-08-14 09:01:15 -0700 | [diff] [blame] | 183 | if: matrix.go == '1.23' |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 184 | uses: actions/upload-artifact@v4 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 185 | with: |
| 186 | name: go-precross |
| 187 | if-no-files-found: error |
| 188 | path: | |
| 189 | test/go/bin/* |
| 190 | retention-days: 3 |
| 191 | |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 192 | lib-java-kotlin: |
| 193 | needs: compiler |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 194 | runs-on: ubuntu-22.04 |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 195 | env: |
Jiayu Liu | d40dd72 | 2023-10-19 08:37:49 +0800 | [diff] [blame] | 196 | GRADLE_VERSION: "8.4" |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 197 | steps: |
dependabot[bot] | a14231c | 2023-10-04 18:33:29 -0400 | [diff] [blame] | 198 | - uses: actions/checkout@v4 |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 199 | |
dependabot[bot] | f4b6d96 | 2023-12-01 06:30:44 +0000 | [diff] [blame] | 200 | - uses: actions/setup-java@v4 |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 201 | with: |
| 202 | distribution: temurin |
Jiayu Liu | 92b007f | 2022-10-14 13:16:18 +0800 | [diff] [blame] | 203 | java-version: 17 |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 204 | cache: "gradle" |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 205 | |
| 206 | - name: Install dependencies |
| 207 | run: | |
| 208 | sudo apt-get update -yq |
| 209 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 210 | sudo apt-get install -y wget unzip ant maven |
| 211 | |
| 212 | - name: Setup gradle |
| 213 | run: | |
| 214 | wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip |
Jiayu Liu | d40dd72 | 2023-10-19 08:37:49 +0800 | [diff] [blame] | 215 | (echo "3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -) |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 216 | unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip |
| 217 | sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle |
| 218 | sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin |
| 219 | gradle --version |
| 220 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 221 | - name: Run spotlessCheck for Java |
Jiayu Liu | 53ec082 | 2022-05-06 12:56:42 +0800 | [diff] [blame] | 222 | run: | |
| 223 | cd lib/java |
| 224 | gradle spotlessCheck |
| 225 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 226 | - name: Run ktfmtCheck for Kotlin |
| 227 | run: | |
| 228 | cd lib/kotlin |
| 229 | gradle ktfmtCheck |
| 230 | |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 231 | - name: Run bootstrap |
| 232 | run: ./bootstrap.sh |
| 233 | |
| 234 | - name: Run configure |
| 235 | run: | |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 236 | ./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] | 237 | |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 238 | - uses: actions/download-artifact@v4 |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 239 | with: |
| 240 | name: thrift-compiler |
| 241 | path: compiler/cpp |
| 242 | |
| 243 | - name: Run thrift-compiler |
| 244 | run: | |
| 245 | chmod a+x compiler/cpp/thrift |
| 246 | compiler/cpp/thrift -version |
| 247 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 248 | - name: Run make for java |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 249 | run: make -C lib/java |
| 250 | |
Jiayu Liu | 5b15838 | 2022-05-12 00:20:37 +0800 | [diff] [blame] | 251 | # this will invoke publishToMavenLocal and install locally |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 252 | - name: Run make install for java |
| 253 | run: make -C lib/java install |
| 254 | |
| 255 | - name: Upload java libthrift artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 256 | uses: actions/upload-artifact@v4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 257 | with: |
| 258 | name: libthrift |
| 259 | if-no-files-found: error |
| 260 | path: ~/.m2/repository/org/apache/thrift |
| 261 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 262 | - name: Run make check for java |
| 263 | run: make -C lib/java check |
| 264 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 265 | - name: Run make precross for java |
| 266 | run: make -C lib/java precross |
| 267 | |
| 268 | - name: Upload java precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 269 | uses: actions/upload-artifact@v4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 270 | with: |
| 271 | name: java-precross |
| 272 | if-no-files-found: error |
| 273 | path: | |
| 274 | lib/java/build/functionalTestJar/ |
| 275 | lib/java/build/runclient |
| 276 | lib/java/build/runnonblockingserver |
| 277 | lib/java/build/runserver |
| 278 | lib/java/build/runservletserver |
| 279 | retention-days: 3 |
| 280 | |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 281 | - name: Run make for kotlin |
Jiayu Liu | c77d91a | 2022-05-03 20:55:50 +0800 | [diff] [blame] | 282 | run: make -C lib/kotlin |
Jiayu Liu | bcac978 | 2022-05-07 08:35:09 +0800 | [diff] [blame] | 283 | |
| 284 | - name: Run make check for kotlin |
| 285 | run: make -C lib/kotlin check |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 286 | |
| 287 | - name: Run make precross for kotlin |
| 288 | run: make -C lib/kotlin precross |
| 289 | |
| 290 | - name: Upload kotlin precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 291 | uses: actions/upload-artifact@v4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 292 | with: |
| 293 | name: kotlin-precross |
| 294 | if-no-files-found: error |
| 295 | path: | |
| 296 | lib/kotlin/cross-test-client/build/install/TestClient/ |
| 297 | lib/kotlin/cross-test-server/build/install/TestServer/ |
| 298 | retention-days: 3 |
| 299 | |
Sven Roederer | cb9cead | 2024-07-05 12:47:41 +0200 | [diff] [blame] | 300 | lib-netstd: |
| 301 | needs: compiler |
| 302 | runs-on: ubuntu-22.04 |
| 303 | strategy: |
| 304 | fail-fast: false |
| 305 | steps: |
| 306 | - uses: actions/checkout@v4 |
| 307 | |
| 308 | - name: Install dependencies |
| 309 | run: | |
| 310 | sudo apt-get update -yq |
| 311 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 312 | sudo apt-get install -y --no-install-recommends curl openssl ca-certificates |
| 313 | |
| 314 | # the sdk is installed by default, but keep this step for reference |
| 315 | # - name: Set up .NET SDK |
| 316 | # run: | |
| 317 | # sudo apt-get install -y --no-install-recommends dotnet-sdk-8.0 |
| 318 | |
| 319 | - name: Run bootstrap |
| 320 | run: ./bootstrap.sh |
| 321 | |
| 322 | - name: Run configure for netstd |
| 323 | run: | |
| 324 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-netstd/with-netstd/') |
| 325 | |
| 326 | - uses: actions/download-artifact@v4 |
| 327 | with: |
| 328 | name: thrift-compiler |
| 329 | path: compiler/cpp |
| 330 | |
| 331 | - name: Run thrift-compiler |
| 332 | run: | |
| 333 | chmod a+x compiler/cpp/thrift |
| 334 | compiler/cpp/thrift -version |
| 335 | |
| 336 | - name: Run make for netstd |
| 337 | run: make -C lib/netstd |
| 338 | |
| 339 | - name: Run make install for netstd |
| 340 | run: sudo make -C lib/netstd install |
| 341 | |
| 342 | - name: Run make check for netstd |
| 343 | run: make -C lib/netstd check |
| 344 | |
| 345 | - name: Run make check for test/netstd |
| 346 | run: make -C test/netstd check |
| 347 | |
| 348 | - name: Run make precross for test/netstd |
| 349 | run: make -C test/netstd precross |
| 350 | |
| 351 | - name: Upload netstd precross artifacts |
| 352 | uses: actions/upload-artifact@v4 |
| 353 | with: |
| 354 | name: netstd-precross |
| 355 | if-no-files-found: error |
| 356 | path: | |
| 357 | test/netstd/Client/bin/Release/ |
| 358 | test/netstd/Server/bin/Release/ |
| 359 | retention-days: 3 |
| 360 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 361 | lib-swift: |
| 362 | needs: compiler |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 363 | runs-on: ubuntu-22.04 |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 364 | steps: |
dependabot[bot] | a14231c | 2023-10-04 18:33:29 -0400 | [diff] [blame] | 365 | - uses: actions/checkout@v4 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 366 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 367 | - name: Run bootstrap |
| 368 | run: ./bootstrap.sh |
| 369 | |
| 370 | - name: Run configure |
| 371 | run: | |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 372 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-swift/with-swift/') |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 373 | |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 374 | - uses: actions/download-artifact@v4 |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 375 | with: |
| 376 | name: thrift-compiler |
| 377 | path: compiler/cpp |
| 378 | |
| 379 | - name: Run thrift-compiler |
| 380 | run: | |
| 381 | chmod a+x compiler/cpp/thrift |
| 382 | compiler/cpp/thrift -version |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 383 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 384 | - name: Run make precross for swift |
| 385 | run: make -C test/swift precross |
| 386 | |
| 387 | - name: Upload swift precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 388 | uses: actions/upload-artifact@v4 |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 389 | with: |
| 390 | name: swift-precross |
| 391 | if-no-files-found: error |
| 392 | path: | |
| 393 | test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestServer |
| 394 | test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/TestClient |
| 395 | retention-days: 3 |
| 396 | |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 397 | lib-rust: |
| 398 | needs: compiler |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 399 | runs-on: ubuntu-22.04 |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 400 | env: |
Jiayu Liu | fbfa52c | 2023-11-07 13:47:24 +0800 | [diff] [blame] | 401 | TOOLCHAIN_VERSION: 1.65.0 |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 402 | steps: |
dependabot[bot] | a14231c | 2023-10-04 18:33:29 -0400 | [diff] [blame] | 403 | - uses: actions/checkout@v4 |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 404 | |
| 405 | - name: Install dependencies |
| 406 | run: | |
| 407 | sudo apt-get update -yq |
| 408 | sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS |
| 409 | |
| 410 | - name: Setup cargo |
| 411 | run: | |
| 412 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 413 | rustup update |
| 414 | rustup install $TOOLCHAIN_VERSION |
| 415 | rustup default $TOOLCHAIN_VERSION |
| 416 | rustup --version |
| 417 | cargo --version |
| 418 | rustc --version |
| 419 | |
| 420 | - name: Run bootstrap |
| 421 | run: ./bootstrap.sh |
| 422 | |
| 423 | - name: Run configure |
| 424 | run: | |
Jiayu Liu | 1e3d90d | 2023-04-14 23:57:33 +0800 | [diff] [blame] | 425 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-rs/with-rs/') |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 426 | |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 427 | - uses: actions/download-artifact@v4 |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 428 | with: |
| 429 | name: thrift-compiler |
| 430 | path: compiler/cpp |
| 431 | |
| 432 | - name: Run thrift-compiler |
| 433 | run: | |
| 434 | chmod a+x compiler/cpp/thrift |
| 435 | compiler/cpp/thrift -version |
| 436 | |
| 437 | - name: Run make for rust |
| 438 | run: make -C lib/rs |
| 439 | |
| 440 | - name: Run make check for rust |
| 441 | run: make -C lib/rs check |
| 442 | |
| 443 | - name: Run make test for rust |
| 444 | run: make -C lib/rs/test check |
| 445 | |
| 446 | - name: Run make precross for test rust |
| 447 | run: make -C test/rs precross |
| 448 | |
| 449 | - name: Upload rust precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 450 | uses: actions/upload-artifact@v4 |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 451 | with: |
| 452 | name: rs-precross |
| 453 | if-no-files-found: error |
| 454 | path: | |
| 455 | test/rs/bin/test_server |
| 456 | test/rs/bin/test_client |
| 457 | retention-days: 3 |
| 458 | |
| 459 | - name: Run make test_recursive for rust |
| 460 | run: make -C lib/rs/test_recursive check |
| 461 | |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 462 | lib-python: |
| 463 | needs: compiler |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 464 | runs-on: ubuntu-22.04 |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 465 | strategy: |
| 466 | matrix: |
Yuxuan 'fishy' Wang | e497030 | 2023-06-27 09:47:58 -0700 | [diff] [blame] | 467 | python-version: |
| 468 | - "3.x" |
| 469 | fail-fast: false |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 470 | steps: |
dependabot[bot] | a14231c | 2023-10-04 18:33:29 -0400 | [diff] [blame] | 471 | - uses: actions/checkout@v4 |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 472 | |
| 473 | - name: Install dependencies |
| 474 | run: | |
| 475 | sudo apt-get update -yq |
| 476 | sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| 477 | sudo apt-get install -y --no-install-recommends curl openssl ca-certificates |
| 478 | |
| 479 | - name: Set up Python |
dependabot[bot] | 30c2845 | 2024-01-03 16:59:14 +0000 | [diff] [blame] | 480 | uses: actions/setup-python@v5 |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 481 | with: |
| 482 | python-version: ${{ matrix.python-version }} |
| 483 | |
| 484 | - name: Python setup |
| 485 | run: | |
Yuxuan 'fishy' Wang | cf0b803 | 2024-08-20 10:17:09 -0700 | [diff] [blame] | 486 | python -m pip install --upgrade pip setuptools wheel flake8 six tornado twisted zope.interface |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 487 | python --version |
| 488 | pip --version |
| 489 | |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 490 | - name: Run bootstrap |
| 491 | run: ./bootstrap.sh |
| 492 | |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 493 | - name: Run configure 3.x |
Yuxuan 'fishy' Wang | e497030 | 2023-06-27 09:47:58 -0700 | [diff] [blame] | 494 | if: matrix.python-version == '3.x' |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 495 | run: | |
| 496 | ./configure $(echo $CONFIG_ARGS_FOR_LIBS | sed 's/without-py3/with-py3/') |
| 497 | |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 498 | - uses: actions/download-artifact@v4 |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 499 | with: |
| 500 | name: thrift-compiler |
| 501 | path: compiler/cpp |
| 502 | |
| 503 | - name: Run thrift-compiler |
| 504 | run: | |
| 505 | chmod a+x compiler/cpp/thrift |
| 506 | compiler/cpp/thrift -version |
| 507 | |
| 508 | - name: Run make for python |
| 509 | run: make -C lib/py |
| 510 | |
| 511 | - name: Run make install for python |
| 512 | run: sudo make -C lib/py install |
| 513 | |
| 514 | # - name: Run make install-exec-hook for python |
| 515 | # run: sudo make -C lib/py install-exec-hook |
| 516 | |
| 517 | - name: Run make check for python |
| 518 | run: make -C lib/py check |
| 519 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 520 | cross-test: |
| 521 | needs: |
| 522 | - lib-java-kotlin |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 523 | - lib-swift |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 524 | - lib-rust |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 525 | - lib-go |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 526 | - lib-python |
Sven Roederer | 502a46a | 2024-07-06 05:56:05 +0200 | [diff] [blame] | 527 | runs-on: ubuntu-22.04 |
Jiayu Liu | 790d4cb | 2023-04-27 11:35:17 +0800 | [diff] [blame] | 528 | strategy: |
| 529 | matrix: |
| 530 | server_lang: ['java', 'kotlin', 'go', 'rs', 'swift'] |
| 531 | # we always use comma join as many client langs as possible, to reduce the number of jobs |
| 532 | client_lang: ['java,kotlin', 'go,rs', 'swift'] |
| 533 | fail-fast: false |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 534 | steps: |
dependabot[bot] | a14231c | 2023-10-04 18:33:29 -0400 | [diff] [blame] | 535 | - uses: actions/checkout@v4 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 536 | |
dependabot[bot] | 30c2845 | 2024-01-03 16:59:14 +0000 | [diff] [blame] | 537 | - uses: actions/setup-python@v5 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 538 | with: |
| 539 | python-version: "3.x" |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 540 | |
dependabot[bot] | f4b6d96 | 2023-12-01 06:30:44 +0000 | [diff] [blame] | 541 | - uses: actions/setup-java@v4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 542 | with: |
| 543 | distribution: temurin |
Jiayu Liu | be73a57 | 2023-04-14 11:02:43 +0800 | [diff] [blame] | 544 | # here we intentionally use an older version so that we also verify Java 17 compiles to it |
Fokko Driesprong | 0b14a1b | 2023-04-14 11:06:15 +0200 | [diff] [blame] | 545 | java-version: 8 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 546 | cache: "gradle" |
| 547 | |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 548 | - name: Install openssl and certificates (for SSL tests) |
| 549 | run: | |
| 550 | sudo apt-get update -yq |
| 551 | sudo apt-get install -y --no-install-recommends openssl ca-certificates |
| 552 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 553 | - name: Download java precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 554 | uses: actions/download-artifact@v4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 555 | with: |
| 556 | name: java-precross |
| 557 | path: lib/java/build |
| 558 | |
| 559 | - name: Download kotlin precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 560 | uses: actions/download-artifact@v4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 561 | with: |
| 562 | name: kotlin-precross |
| 563 | path: lib/kotlin |
| 564 | |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 565 | - name: Download swift precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 566 | uses: actions/download-artifact@v4 |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 567 | with: |
| 568 | name: swift-precross |
| 569 | path: test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug |
| 570 | |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 571 | - name: Download rust precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 572 | uses: actions/download-artifact@v4 |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 573 | with: |
| 574 | name: rs-precross |
| 575 | path: test/rs/bin |
| 576 | |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 577 | - name: Download go precross artifacts |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 578 | uses: actions/download-artifact@v4 |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 579 | with: |
| 580 | name: go-precross |
| 581 | path: test/go/bin |
| 582 | |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 583 | - name: Set back executable flags |
| 584 | run: | |
| 585 | chmod a+x \ |
| 586 | lib/java/build/run* \ |
| 587 | lib/kotlin/cross-test-client/build/install/TestClient/bin/* \ |
Jiayu Liu | 0aad2ae | 2022-10-08 13:22:24 +0800 | [diff] [blame] | 588 | lib/kotlin/cross-test-server/build/install/TestServer/bin/* \ |
Kino Roy | a9da9eb | 2022-10-07 23:13:01 -0700 | [diff] [blame] | 589 | test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/* \ |
Jiayu Liu | d21e95a | 2022-10-09 08:49:29 +0800 | [diff] [blame] | 590 | test/rs/bin/* \ |
| 591 | test/go/bin/* |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 592 | |
| 593 | - name: Run cross test |
| 594 | env: |
| 595 | THRIFT_CROSSTEST_CONCURRENCY: 4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 596 | run: | |
| 597 | python test/test.py \ |
| 598 | --retry-count 5 \ |
| 599 | --skip-known-failures \ |
Jiayu Liu | 790d4cb | 2023-04-27 11:35:17 +0800 | [diff] [blame] | 600 | --server ${{ matrix.server_lang }} \ |
| 601 | --client ${{ matrix.client_lang }} |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 602 | |
| 603 | - name: Upload log files from failed cross test runs |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 604 | uses: actions/upload-artifact@v4 |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 605 | if: failure() |
| 606 | with: |
Sven Roederer | 18b0de6 | 2024-07-06 03:59:37 +0200 | [diff] [blame] | 607 | name: cross-test-log_${{ matrix.server_lang }}-${{ matrix.client_lang }} |
Jiayu Liu | ab83ffc | 2022-05-10 01:56:30 +0800 | [diff] [blame] | 608 | path: test/log/ |
| 609 | retention-days: 3 |
Jiayu Liu | 6f33900 | 2023-04-20 07:39:35 +0800 | [diff] [blame] | 610 | |