Skip to content

Commit

Permalink
ci: rocksdb version in makefile (#21654)
Browse files Browse the repository at this point in the history
(cherry picked from commit aa8bf41)

# Conflicts:
#	.github/workflows/build.yml
#	.github/workflows/lint.yml
#	.github/workflows/test.yml
  • Loading branch information
auricom authored and mergify[bot] committed Sep 11, 2024
1 parent b2feec1 commit 8979602
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/scripts/get-rocksdb-version.sh
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
2 changes: 1 addition & 1 deletion .github/scripts/install-rocksdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sudo apt update && sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev l
# Clone RocksDB repository
git clone https://github.com/facebook/rocksdb.git /home/runner/rocksdb
cd /home/runner/rocksdb || exit 1
git checkout "v${ROCKSDB_VERSION}"
git checkout "${ROCKSDB_VERSION}"

# Build shared library
sudo make -j "$(nproc --all)" shared_lib
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ concurrency:
group: ci-${{ github.ref }}-build
cancel-in-progress: true

<<<<<<< HEAD
env:
ROCKSDB_VERSION: 9.6.1

=======
>>>>>>> aa8bf41eb (ci: rocksdb version in makefile (#21654))
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -28,6 +31,8 @@ jobs:
with:
go-version: "1.23"
check-latest: true
- 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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ on:
permissions:
contents: read

<<<<<<< HEAD
env:
ROCKSDB_VERSION: 9.6.1

=======
>>>>>>> aa8bf41eb (ci: rocksdb version in makefile (#21654))
jobs:
golangci:
name: golangci-lint
Expand All @@ -30,6 +33,8 @@ 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
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ concurrency:
group: ci-${{ github.ref }}-tests
cancel-in-progress: true

<<<<<<< HEAD
env:
ROCKSDB_VERSION: 9.6.1
=======
>>>>>>> aa8bf41eb (ci: rocksdb version in makefile (#21654))

jobs:
split-test-files:
Expand Down Expand Up @@ -790,6 +793,8 @@ jobs:
store/**/*.go
store/go.mod
store/go.sum
- 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
Expand Down Expand Up @@ -845,6 +850,8 @@ jobs:
store/v2/**/*.go
store/v2/go.mod
store/v2/go.sum
- 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
Expand Down
2 changes: 2 additions & 0 deletions scripts/build/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git
DOCKER := $(shell which docker)
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)

rocksdb_version=v8.11.3

ifeq ($(findstring .,$(VERSION)),)
VERSION := 0.0.0
endif
Expand Down

0 comments on commit 8979602

Please sign in to comment.