Skip to content

Commit

Permalink
chore: precompile librocksdb for speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksuss committed Jun 27, 2023
1 parent 418a28f commit 6248a69
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ jobs:
uses: actions/checkout@v3
- name: Restore cache
run: |
cache-util restore cargo_git cargo_registry yarn_cache
cache-util restore cargo_git cargo_registry yarn_cache rocksdb:/root/rocksdb
cache-util restore aurora-engine-target@generic@${{ hashFiles('**/Cargo.lock') }}:target
- name: Preparing rocksdb library
run: scripts/ci/build_rocksdb.sh
- name: Build contracts
run: cargo make build-contracts
- name: Test contracts
Expand Down Expand Up @@ -53,8 +55,10 @@ jobs:
uses: actions/checkout@v3
- name: Restore cache
run: |
cache-util restore cargo_git cargo_registry yarn_cache
cache-util restore cargo_git cargo_registry yarn_cache rocksdb:/root/rocksdb
cache-util restore aurora-engine-target@generic@${{ hashFiles('**/Cargo.lock') }}:target
- name: Preparing rocksdb library
run: scripts/ci/build_rocksdb.sh
- name: Test mainnet bench-modexp
run: cargo make --profile mainnet bench-modexp
- name: Test testnet bench-modexp
Expand All @@ -67,3 +71,5 @@ jobs:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
ROCKSDB_INCLUDE_DIR: /root/rocksdb/include
ROCKSDB_LIB_DIR: /root/rocksdb/lib
17 changes: 17 additions & 0 deletions scripts/ci/build_rocksdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

ROCKSDB_VER=v7.4.4
INSTALL_PATH=/root/rocksdb
LIB_PATH=$INSTALL_PATH/lib/librocksdb.a

apt -y install libsnappy-dev libbz2-dev liblz4-dev libzstd-dev

if [[ ! -f $LIB_PATH ]]; then
apt -y install cmake libgflags-dev
git clone --branch $ROCKSDB_VER https://github.com/facebook/rocksdb
cd rocksdb && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_ZLIB=1 -DWITH_SNAPPY=1 -DWITH_LZ4=1 -DWITH_ZSTD=1 -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH ..
make -j32 install
cache-util save rocksdb:$INSTALL_PATH
cd $HOME
fi

0 comments on commit 6248a69

Please sign in to comment.