Skip to content

Commit 9e78489

Browse files
mergify[bot]auricomjulienrbrt
authored
ci: rocksdb version in makefile (backport #21654) (#21656)
Co-authored-by: auricom <27022259+auricom@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent b2feec1 commit 9e78489

File tree

6 files changed

+23
-10
lines changed

6 files changed

+23
-10
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: 9.6.1
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: 9.6.1
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ concurrency:
1313
group: ci-${{ github.ref }}-tests
1414
cancel-in-progress: true
1515

16-
env:
17-
ROCKSDB_VERSION: 9.6.1
18-
1916
jobs:
2017
split-test-files:
2118
runs-on: ubuntu-latest
@@ -790,6 +787,8 @@ jobs:
790787
store/**/*.go
791788
store/go.mod
792789
store/go.sum
790+
- name: Get rocksdb version
791+
run: ./.github/scripts/get-rocksdb-version.sh
793792
- name: Fix permissions for cache
794793
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
795794
- name: Restore rocksdb libraries cache
@@ -845,6 +844,8 @@ jobs:
845844
store/v2/**/*.go
846845
store/v2/go.mod
847846
store/v2/go.sum
847+
- name: Get rocksdb version
848+
run: ./.github/scripts/get-rocksdb-version.sh
848849
- name: Fix permissions for cache
849850
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
850851
- 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=v9.6.1
16+
1517
ifeq ($(findstring .,$(VERSION)),)
1618
VERSION := 0.0.0
1719
endif

0 commit comments

Comments
 (0)