Skip to content

Commit

Permalink
Update github action flow (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxGnu authored Aug 27, 2022
1 parent c88c046 commit 0254e5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@ 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

- 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'
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0254e5d

Please sign in to comment.