From 0254e5d45e0b79dd5b39f6f4a46b85f55b14b9ff Mon Sep 17 00:00:00 2001 From: Linh Tran Tuan Date: Sat, 27 Aug 2022 09:52:41 +0900 Subject: [PATCH] Update github action flow (#81) --- .github/workflows/go.yml | 12 +++++++++--- build.sh | 5 ++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0f3cd12..b67a353 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ^1.17 id: go @@ -20,12 +20,18 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v3 + - name: GOARCH + run: echo "GOARCH=$(go env GOARCH)" >> $GITHUB_ENV + + - name: GOHOSTOS + run: echo "GOHOSTOS=$(go env GOHOSTOS)" >> $GITHUB_ENV + - name: Cache PreBuilt Static Libs id: cache-prebuilt-static-libs uses: actions/cache@v3 with: path: dist - key: prebuilt-${{ hashFiles('**/build.sh') }} + key: ${{ env.GOHOSTOS }}-${{ env.GOARCH }}-${{ hashFiles('**/build.sh') }} - name: Build static libs if: steps.cache-prebuilt-static-libs.outputs.cache-hit != 'true' @@ -39,7 +45,7 @@ jobs: run: go test -v -tags testing -count=1 -coverprofile=coverage.out - name: Convert coverage to lcov - uses: jandelgado/gcov2lcov-action@v1.0.8 + uses: jandelgado/gcov2lcov-action@v1.0.9 with: infile: coverage.out outfile: coverage.lcov diff --git a/build.sh b/build.sh index 6bda211..3062154 100644 --- a/build.sh +++ b/build.sh @@ -33,11 +33,14 @@ cd $BUILD_PATH && wget https://github.com/facebook/zstd/archive/v${zstd_version} -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DZSTD_ZLIB_SUPPORT=ON -DZSTD_LZMA_SUPPORT=OFF -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) install && \ cd $BUILD_PATH && rm -rf * && ldconfig +# Note: if you don't have a good reason, please do not set -DPORTABLE=ON +# +# This one is set here on purpose of compatibility with github action runtime processor rocksdb_version="7.5.3" cd $BUILD_PATH && wget https://github.com/facebook/rocksdb/archive/v${rocksdb_version}.tar.gz && tar xzf v${rocksdb_version}.tar.gz && cd rocksdb-${rocksdb_version}/ && \ mkdir -p build_place && cd build_place && cmake -DCMAKE_BUILD_TYPE=Release $CMAKE_REQUIRED_PARAMS -DCMAKE_PREFIX_PATH=$INSTALL_PREFIX -DWITH_TESTS=OFF -DWITH_GFLAGS=OFF \ -DWITH_BENCHMARK_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_MD_LIBRARY=OFF -DWITH_RUNTIME_DEBUG=OFF -DROCKSDB_BUILD_SHARED=OFF -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_LIBURING=OFF \ - -DWITH_ZSTD=ON -DWITH_BZ2=OFF -WITH_GFLAGS=OFF -DFORCE_AVX2=ON .. && make -j16 install/strip && \ + -DWITH_ZSTD=ON -DWITH_BZ2=OFF -WITH_GFLAGS=OFF -DPORTABLE=ON .. && make -j16 install/strip && \ cd $BUILD_PATH && rm -rf * rm -rf $INSTALL_PREFIX/bin $INSTALL_PREFIX/share $INSTALL_PREFIX/lib/cmake $INSTALL_PREFIX/lib64/cmake $INSTALL_PREFIX/lib/pkgconfig $INSTALL_PREFIX/lib64/pkgconfig