| name: "Build" |
| |
| on: |
| push: |
| branches: ["*"] |
| pull_request: |
| branches: ["*"] |
| |
| env: |
| BUILD_DEPS: automake bison flex git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config |
| |
| jobs: |
| # TODO windows and macos |
| compiler: |
| strategy: |
| matrix: |
| os: [ubuntu-18.04, ubuntu-20.04] |
| runs-on: ${{ matrix.os }} |
| steps: |
| - uses: actions/checkout@v3 |
| |
| - name: Install dependencies |
| run: | |
| sudo apt-get update -yq |
| sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS |
| |
| - name: Run bootstrap |
| run: ./bootstrap.sh |
| |
| - name: Run configure |
| run: ./configure --disable-debug --disable-tests --disable-libs |
| |
| - name: Run make |
| run: make -j$(nproc) |
| |
| - name: Run install |
| run: make install |
| |
| - name: Run thrift version |
| run: /usr/local/bin/thrift -version |
| |
| # only upload while building ubuntu-20.04 |
| - name: Archive built thrift compiler |
| if: matrix.os == 'ubuntu-20.04' |
| uses: actions/upload-artifact@v3 |
| with: |
| name: thrift-compiler |
| path: compiler/cpp/thrift |
| retention-days: 3 |
| |
| lib-java-kotlin: |
| needs: compiler |
| runs-on: ubuntu-20.04 |
| env: |
| GRADLE_VERSION: 6.9.2 |
| steps: |
| - uses: actions/checkout@v3 |
| |
| - uses: actions/setup-java@v3 |
| with: |
| distribution: temurin |
| java-version: 11 |
| cache: "gradle" |
| |
| - name: Install dependencies |
| run: | |
| sudo apt-get update -yq |
| sudo apt-get install -y --no-install-recommends $BUILD_DEPS |
| sudo apt-get install -y wget unzip ant maven |
| |
| - name: Setup gradle |
| run: | |
| wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O /tmp/gradle-$GRADLE_VERSION-bin.zip |
| (echo "8b356fd8702d5ffa2e066ed0be45a023a779bba4dd1a68fd11bc2a6bdc981e8f /tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -) |
| unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip |
| sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle |
| sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin |
| gradle --version |
| |
| - name: Run spotlessCheck for Java |
| run: | |
| cd lib/java |
| gradle spotlessCheck |
| |
| - name: Run ktfmtCheck for Kotlin |
| run: | |
| cd lib/kotlin |
| gradle ktfmtCheck |
| |
| - name: Run bootstrap |
| run: ./bootstrap.sh |
| |
| - name: Run configure |
| run: | |
| ./configure \ |
| --disable-debug \ |
| --disable-tests \ |
| --disable-dependency-tracking \ |
| --without-cpp \ |
| --without-c_glib \ |
| --with-java \ |
| --with-kotlin \ |
| --without-python \ |
| --without-py3 \ |
| --without-ruby \ |
| --without-haxe \ |
| --without-netstd \ |
| --without-perl \ |
| --without-php \ |
| --without-php_extension \ |
| --without-dart \ |
| --without-erlang \ |
| --without-go \ |
| --without-d \ |
| --without-nodejs \ |
| --without-nodets \ |
| --without-lua \ |
| --without-rs \ |
| --without-swift |
| |
| - uses: actions/download-artifact@v3 |
| with: |
| name: thrift-compiler |
| path: compiler/cpp |
| |
| - name: Run thrift-compiler |
| run: | |
| chmod a+x compiler/cpp/thrift |
| compiler/cpp/thrift -version |
| |
| - name: Run make for java |
| run: make -C lib/java |
| |
| - name: Run make install for java |
| run: make -C lib/java install |
| |
| - name: Upload java libthrift artifacts |
| uses: actions/upload-artifact@v3 |
| with: |
| name: libthrift |
| if-no-files-found: error |
| path: ~/.m2/repository/org/apache/thrift |
| |
| - name: Run make check for java |
| run: make -C lib/java check |
| |
| - name: Run make precross for java |
| run: make -C lib/java precross |
| |
| - name: Upload java precross artifacts |
| uses: actions/upload-artifact@v3 |
| with: |
| name: java-precross |
| if-no-files-found: error |
| path: | |
| lib/java/build/functionalTestJar/ |
| lib/java/build/runclient |
| lib/java/build/runnonblockingserver |
| lib/java/build/runserver |
| lib/java/build/runservletserver |
| retention-days: 3 |
| |
| - name: Run make for kotlin |
| run: make -C lib/kotlin |
| |
| - name: Run make check for kotlin |
| run: make -C lib/kotlin check |
| |
| - name: Run make precross for kotlin |
| run: make -C lib/kotlin precross |
| |
| - name: Upload kotlin precross artifacts |
| uses: actions/upload-artifact@v3 |
| with: |
| name: kotlin-precross |
| if-no-files-found: error |
| path: | |
| lib/kotlin/cross-test-client/build/install/TestClient/ |
| lib/kotlin/cross-test-server/build/install/TestServer/ |
| retention-days: 3 |
| |
| cross-test: |
| needs: |
| - lib-java-kotlin |
| runs-on: ubuntu-20.04 |
| steps: |
| - uses: actions/checkout@v3 |
| - uses: actions/setup-python@v3 |
| with: |
| python-version: "3.x" |
| - uses: actions/setup-java@v3 |
| with: |
| distribution: temurin |
| # here we intentionally use java 8 so that we also verify java 11 compiles to version 8 |
| java-version: 8 |
| cache: "gradle" |
| |
| - name: Download java precross artifacts |
| uses: actions/download-artifact@v3 |
| with: |
| name: java-precross |
| path: lib/java/build |
| |
| - name: Download kotlin precross artifacts |
| uses: actions/download-artifact@v3 |
| with: |
| name: kotlin-precross |
| path: lib/kotlin |
| |
| - name: Set back executable flags |
| run: | |
| chmod a+x \ |
| lib/java/build/run* \ |
| lib/kotlin/cross-test-client/build/install/TestClient/bin/* \ |
| lib/kotlin/cross-test-server/build/install/TestServer/bin/* |
| |
| - name: Run cross test |
| env: |
| THRIFT_CROSSTEST_CONCURRENCY: 4 |
| PRECROSS_LANGS: java,kotlin |
| run: | |
| python test/test.py \ |
| --retry-count 5 \ |
| --skip-known-failures \ |
| --server $PRECROSS_LANGS \ |
| --client $PRECROSS_LANGS |
| |
| - name: Upload log files from failed cross test runs |
| uses: actions/upload-artifact@v3 |
| if: failure() |
| with: |
| name: cross-test-log |
| path: test/log/ |
| retention-days: 3 |