Skip to content

Commit 4b0316c

Browse files
authored
ci: prebuilt librocksdb in docker image (#2318)
1 parent 14bf85d commit 4b0316c

7 files changed

Lines changed: 167 additions & 76 deletions

File tree

.github/actions/docker/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ runs:
110110
SCCACHE_S3_KEY_PREFIX=${{ runner.os }}/sccache
111111
AWS_ACCESS_KEY_ID=${{ inputs.aws_access_key_id }}
112112
AWS_SECRET_ACCESS_KEY=${{ inputs.aws_secret_access_key }}
113+
AWS_REGION=${{ inputs.region }}
113114
cache-from: ${{ steps.layer_cache_settings.outputs.cache_from }}
114115
cache-to: ${{ steps.layer_cache_settings.outputs.cache_to }}
115116
outputs: type=image,name=${{ inputs.image_org }}/${{ inputs.image_name }},push-by-digest=${{ inputs.push_tags != 'true' }},name-canonical=true,push=true

.github/actions/rust/action.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ runs:
8585
export PATH="${PATH}:${HOME}/.local/bin"
8686
8787
- name: Run sccache-cache
88-
uses: mozilla-actions/sccache-action@v0.0.3
88+
uses: mozilla-actions/sccache-action@v0.0.6
8989
with:
90-
version: "v0.7.1" # Must be the same as in Dockerfile
90+
version: "v0.8.2" # Must be the same as in Dockerfile
9191
if: inputs.cache == 'true'
9292

9393
- name: Hash ref_name
@@ -121,5 +121,6 @@ runs:
121121
if: runner.os == 'Linux'
122122
run: |
123123
sudo apt update -qq
124-
sudo apt install -qq --yes clang llvm
124+
# snappy is required by rust rocksdb
125+
sudo apt install -qq --yes clang llvm libsnappy-dev
125126
sudo update-alternatives --set cc /usr/bin/clang

.github/workflows/tests-rs-package.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ jobs:
5555
SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu
5656
ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a"
5757
ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib"
58-
58+
SNAPPY_STATIC: "/usr/lib/x86_64-linux-gnu/libsnappy.a"
59+
SNAPPY_LIB_DIR: "/usr/lib/x86_64-linux-gnu"
5960
formatting:
6061
name: Formatting
6162
runs-on: ubuntu-24.04
@@ -119,6 +120,8 @@ jobs:
119120
SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu
120121
ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a"
121122
ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib"
123+
SNAPPY_STATIC: "/usr/lib/x86_64-linux-gnu/libsnappy.a"
124+
SNAPPY_LIB_DIR: "/usr/lib/x86_64-linux-gnu"
122125
with:
123126
args: ${{ steps.crate_info.outputs.cargo_manifest_dir }}
124127

@@ -213,7 +216,8 @@ jobs:
213216
SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu
214217
ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a"
215218
ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib"
216-
219+
SNAPPY_STATIC: "/usr/lib/x86_64-linux-gnu/libsnappy.a"
220+
SNAPPY_LIB_DIR: "/usr/lib/x86_64-linux-gnu"
217221
check_each_feature:
218222
name: Check each feature
219223
runs-on: ${{ fromJSON(inputs.test-runner) }}
@@ -250,6 +254,8 @@ jobs:
250254
SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu
251255
ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a"
252256
ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib"
257+
SNAPPY_STATIC: "/usr/lib/x86_64-linux-gnu/libsnappy.a"
258+
SNAPPY_LIB_DIR: "/usr/lib/x86_64-linux-gnu"
253259
run: |
254260
echo Verify all features disabled
255261
set -ex

.github/workflows/tests.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: Tests
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
rebuild-deps:
7-
description: "Rebuild cached Rust dependencies"
8-
required: false
9-
default: "false"
105
pull_request:
116
types: [opened, synchronize, reopened, ready_for_review]
127
branches:
@@ -44,11 +39,14 @@ jobs:
4439
build-rust-deps:
4540
name: Prebuild and cache some Rust dependencies
4641
runs-on: ubuntu-24.04
42+
needs:
43+
- changes
44+
# run only if any changes were detected, eg. changes job returned non-empty list
45+
if: ${{ needs.changes.outputs.rs-packages != '[]' }}
4746
env:
4847
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
4948
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
5049
AWS_REGION: ${{ secrets.AWS_REGION }}
51-
5250
steps:
5351
- name: Checkout
5452
uses: actions/checkout@v4

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)