Skip to content

Commit aa8bf41

Browse files
authored
ci: rocksdb version in makefile (#21654)
1 parent e9eaefa commit aa8bf41

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -Eeuo pipefail
3+
4+
# Search for rocksdb_version in makefile
5+
rocksdb_version=$(grep "rocksdb_version" ./scripts/build/build.mk | cut -d'=' -f2)
6+
7+
if [[ -z "${rocksdb_version}" ]]; then
8+
echo "Error: rocksdb_version not found in ./scripts/build/build.mk" >&2
9+
exit 1
10+
else
11+
echo "ROCKSDB_VERSION=${rocksdb_version}" >> "${GITHUB_ENV}"
12+
fi

.github/scripts/install-rocksdb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sudo apt update && sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev l
1212
# Clone RocksDB repository
1313
git clone https://github.com/facebook/rocksdb.git /home/runner/rocksdb
1414
cd /home/runner/rocksdb || exit 1
15-
git checkout "v${ROCKSDB_VERSION}"
15+
git checkout "${ROCKSDB_VERSION}"
1616

1717
# Build shared library
1818
sudo make -j "$(nproc --all)" shared_lib

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ concurrency:
1313
group: ci-${{ github.ref }}-build
1414
cancel-in-progress: true
1515

16-
env:
17-
ROCKSDB_VERSION: 8.11.3
18-
1916
jobs:
2017
build:
2118
runs-on: ubuntu-latest
@@ -28,6 +25,8 @@ jobs:
2825
with:
2926
go-version: "1.23"
3027
check-latest: true
28+
- name: Get rocksdb version
29+
run: ./.github/scripts/get-rocksdb-version.sh
3130
- name: Fix permissions for cache
3231
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
3332
- name: Restore rocksdb libraries cache

.github/workflows/lint.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
permissions:
1010
contents: read
1111

12-
env:
13-
ROCKSDB_VERSION: 8.11.3
14-
1512
jobs:
1613
golangci:
1714
name: golangci-lint
@@ -30,6 +27,8 @@ jobs:
3027
Makefile
3128
**/Makefile
3229
.golangci.yml
30+
- name: Get rocksdb version
31+
run: ./.github/scripts/get-rocksdb-version.sh
3332
- name: Fix permissions for cache
3433
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
3534
- name: Restore rocksdb libraries cache

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ concurrency:
1313
group: ci-${{ github.ref }}-tests
1414
cancel-in-progress: true
1515

16-
env:
17-
ROCKSDB_VERSION: 8.11.3
1816

1917
jobs:
2018
split-test-files:
@@ -790,6 +788,8 @@ jobs:
790788
store/**/*.go
791789
store/go.mod
792790
store/go.sum
791+
- name: Get rocksdb version
792+
run: ./.github/scripts/get-rocksdb-version.sh
793793
- name: Fix permissions for cache
794794
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
795795
- name: Restore rocksdb libraries cache
@@ -848,6 +848,8 @@ jobs:
848848
store/v2/**/*.go
849849
store/v2/go.mod
850850
store/v2/go.sum
851+
- name: Get rocksdb version
852+
run: ./.github/scripts/get-rocksdb-version.sh
851853
- name: Fix permissions for cache
852854
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
853855
- name: Restore rocksdb libraries cache

scripts/build/build.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git
1212
DOCKER := $(shell which docker)
1313
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)
1414

15+
rocksdb_version=v8.11.3
16+
1517
ifeq ($(findstring .,$(VERSION)),)
1618
VERSION := 0.0.0
1719
endif

0 commit comments

Comments
 (0)