-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into hieu/bankv2/send
- Loading branch information
Showing
256 changed files
with
10,646 additions
and
14,162 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
# Search for rocksdb_version in makefile | ||
rocksdb_version=$(grep "rocksdb_version" ./scripts/build/build.mk | cut -d'=' -f2) | ||
|
||
if [[ -z "${rocksdb_version}" ]]; then | ||
echo "Error: rocksdb_version not found in ./scripts/build/build.mk" >&2 | ||
exit 1 | ||
else | ||
echo "ROCKSDB_VERSION=${rocksdb_version}" >> "${GITHUB_ENV}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
sudo apt update && sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev build-essential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
if [ -z "$ROCKSDB_VERSION" ]; then | ||
echo "ROCKSDB_VERSION is not set." | ||
exit 1 | ||
fi | ||
|
||
# Clone RocksDB repository | ||
git clone https://github.com/facebook/rocksdb.git /home/runner/rocksdb | ||
cd /home/runner/rocksdb || exit 1 | ||
git checkout "${ROCKSDB_VERSION}" | ||
|
||
# Build shared library | ||
sudo make -j "$(nproc --all)" shared_lib | ||
sudo cp --preserve=links ./librocksdb.* /usr/local/lib/ | ||
sudo cp -r ./include/rocksdb/ /usr/local/include/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Cache rocksdb libraries | ||
on: | ||
push: | ||
paths: | ||
- build.mk | ||
schedule: | ||
- cron: "*/15 * * * *" # Every 15 minutes | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
check-cache-rocksdb: | ||
name: Check existing cache | ||
runs-on: ubuntu-latest | ||
outputs: | ||
cache-hit: ${{ steps.cache-rocksdb.outputs.cache-hit }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get rocksdb version | ||
run: ./.github/scripts/get-rocksdb-version.sh | ||
|
||
- name: Fix permissions for cache | ||
run: sudo chown $(whoami) /usr/local/lib /usr/local/include | ||
|
||
- name: Restore rocksdb libraries cache | ||
id: cache-rocksdb | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
/usr/local/lib/librocksdb.* | ||
/usr/local/include/rocksdb | ||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64 | ||
|
||
|
||
save-cache-rocksdb: | ||
name: Build rocksdb libraries and save cache | ||
runs-on: ubuntu-latest | ||
needs: check-cache-rocksdb | ||
if: needs.check-cache-rocksdb.outputs.cache-hit != 'true' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get rocksdb version | ||
run: ./.github/scripts/get-rocksdb-version.sh | ||
|
||
- name: Install rocksdb deps | ||
run: ./.github/scripts/install-rocksdb-deps.sh | ||
- name: Install rocksdb | ||
run: ./.github/scripts/install-rocksdb.sh | ||
|
||
- name: Saves rocksdb libraries cache | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
/usr/local/lib/librocksdb.* | ||
/usr/local/include/rocksdb | ||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,13 @@ on: | |
merge_group: | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.23" | ||
|
@@ -28,13 +27,30 @@ jobs: | |
Makefile | ||
**/Makefile | ||
.golangci.yml | ||
- name: Get rocksdb version | ||
run: ./.github/scripts/get-rocksdb-version.sh | ||
- name: Fix permissions for cache | ||
run: sudo chown $(whoami) /usr/local/lib /usr/local/include | ||
- name: Restore rocksdb libraries cache | ||
id: cache-rocksdb | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
/usr/local/lib/librocksdb.* | ||
/usr/local/include/rocksdb | ||
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64 | ||
- name: Install rocksdb deps | ||
run: ./.github/scripts/install-rocksdb-deps.sh | ||
- name: Install rocksdb | ||
if: steps.cache-rocksdb.outputs.cache-hit != 'true' | ||
run: ./.github/scripts/install-rocksdb.sh | ||
- name: run linting (long) | ||
if: env.GIT_DIFF | ||
id: lint_long | ||
run: | | ||
nix develop -c make lint | ||
make lint | ||
env: | ||
NIX: 1 | ||
ROCKSDB: 1 | ||
- uses: technote-space/[email protected] | ||
if: steps.lint_long.outcome == 'skipped' | ||
with: | ||
|
@@ -57,8 +73,8 @@ jobs: | |
- name: run linting (short) | ||
if: steps.lint_long.outcome == 'skipped' && env.GIT_DIFF | ||
run: | | ||
nix develop -c make lint | ||
make lint | ||
env: | ||
GIT_DIFF: ${{ env.GIT_DIFF }} | ||
LINT_DIFF: 1 | ||
NIX: 1 | ||
ROCKSDB: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.