From d21e95a88f38d155dbb5da858b2f0391d72a7e2e Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Sun, 9 Oct 2022 08:49:29 +0800 Subject: THRIFT-5649: add github action for go (#2697) --- .github/workflows/build.yml | 99 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 94 insertions(+), 5 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2187776d3..84b0042dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,6 +51,80 @@ jobs: path: compiler/cpp/thrift retention-days: 3 + lib-go: + needs: compiler + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version: '>=1.17.0' + + - name: Install dependencies + run: | + sudo apt-get update -yq + sudo apt-get install -y --no-install-recommends $BUILD_DEPS + + - 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 \ + --with-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 go + run: make -C lib/go + + - name: Run make check for go + run: make -C lib/go check + + - name: Run make precross for go test + run: make -C test/go precross + + - name: Upload go precross artifacts + uses: actions/upload-artifact@v3 + with: + name: go-precross + if-no-files-found: error + path: | + test/go/bin/* + retention-days: 3 + lib-java-kotlin: needs: compiler runs-on: ubuntu-20.04 @@ -188,7 +262,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - + - name: Run bootstrap run: ./bootstrap.sh @@ -219,7 +293,7 @@ jobs: --without-lua \ --without-rs \ --with-swift - + - uses: actions/download-artifact@v3 with: name: thrift-compiler @@ -229,7 +303,7 @@ jobs: run: | chmod a+x compiler/cpp/thrift compiler/cpp/thrift -version - + - name: Run make precross for swift run: make -C test/swift precross @@ -337,12 +411,15 @@ jobs: - lib-java-kotlin - lib-swift - lib-rust + - lib-go 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 @@ -350,6 +427,11 @@ jobs: java-version: 8 cache: "gradle" + - name: Install openssl and certificates (for SSL tests) + run: | + sudo apt-get update -yq + sudo apt-get install -y --no-install-recommends openssl ca-certificates + - name: Download java precross artifacts uses: actions/download-artifact@v3 with: @@ -374,6 +456,12 @@ jobs: name: rs-precross path: test/rs/bin + - name: Download go precross artifacts + uses: actions/download-artifact@v3 + with: + name: go-precross + path: test/go/bin + - name: Set back executable flags run: | chmod a+x \ @@ -381,12 +469,13 @@ jobs: lib/kotlin/cross-test-client/build/install/TestClient/bin/* \ lib/kotlin/cross-test-server/build/install/TestServer/bin/* \ test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/* \ - test/rs/bin/* + test/rs/bin/* \ + test/go/bin/* - name: Run cross test env: THRIFT_CROSSTEST_CONCURRENCY: 4 - PRECROSS_LANGS: java,kotlin,rs,swift + PRECROSS_LANGS: java,kotlin,go,rs,swift run: | python test/test.py \ --retry-count 5 \ -- cgit v1.2.1