From 0aad2aeb55d43a7236edd0f14ba5867f73629a88 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Sat, 8 Oct 2022 13:22:24 +0800 Subject: add lib rust building in github action (#2632) fix path for rust --- .github/workflows/build.yml | 101 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3dc5d031..99c92aad0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -183,9 +183,99 @@ jobs: lib/kotlin/cross-test-server/build/install/TestServer/ retention-days: 3 + lib-rust: + needs: compiler + runs-on: ubuntu-20.04 + env: + TOOLCHAIN_VERSION: 1.61.0 + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: | + sudo apt-get update -yq + sudo apt-get install -y --no-install-recommends curl $BUILD_DEPS + + - name: Setup cargo + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + rustup update + rustup install $TOOLCHAIN_VERSION + rustup default $TOOLCHAIN_VERSION + rustup --version + cargo --version + rustc --version + + - name: Run bootstrap + run: ./bootstrap.sh + + - name: Run configure + run: | + ./configure \ + --disable-debug \ + --disable-tests \ + --disable-dependency-tracking \ + --without-cpp \ + --without-c_glib \ + --without-java \ + --without-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 \ + --with-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 rust + run: make -C lib/rs + + - name: Run make check for rust + run: make -C lib/rs check + + - name: Run make test for rust + run: make -C lib/rs/test check + + - name: Run make precross for test rust + run: make -C test/rs precross + + - name: Upload rust precross artifacts + uses: actions/upload-artifact@v3 + with: + name: rs-precross + if-no-files-found: error + path: | + test/rs/bin/test_server + test/rs/bin/test_client + retention-days: 3 + + - name: Run make test_recursive for rust + run: make -C lib/rs/test_recursive check + cross-test: needs: - lib-java-kotlin + - lib-rust runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -211,17 +301,24 @@ jobs: name: kotlin-precross path: lib/kotlin + - name: Download rust precross artifacts + uses: actions/download-artifact@v3 + with: + name: rs-precross + path: test/rs/bin + - 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/* + lib/kotlin/cross-test-server/build/install/TestServer/bin/* \ + test/rs/bin/* - name: Run cross test env: THRIFT_CROSSTEST_CONCURRENCY: 4 - PRECROSS_LANGS: java,kotlin + PRECROSS_LANGS: java,kotlin,rs run: | python test/test.py \ --retry-count 5 \ -- cgit v1.2.1