File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ jobs:
141141 echo "endpoint=$SCCACHE_WEBDAV_ENDPOINT" >> "$GITHUB_OUTPUT"
142142 echo "::add-mask::$SCCACHE_WEBDAV_TOKEN"
143143 echo "token=$SCCACHE_WEBDAV_TOKEN" >> "$GITHUB_OUTPUT"
144+ echo "cache-key-prefix=cargo-${{ hashFiles('rust/Cargo.lock') }}" >> "$GITHUB_OUTPUT"
144145
145146 - name : Build and push image
146147 id : docker_build
@@ -159,6 +160,7 @@ jobs:
159160 SCCACHE_NO_DAEMON=1
160161 BIN=${{ matrix.bin || matrix.image }}
161162 BUILD_FEATURES=${{ matrix.features || '' }}
163+ SCCACHE_WEBDAV_KEY_PREFIX=${{ steps.sccache.outputs.cache-key-prefix }}
162164 secrets : |
163165 SCCACHE_WEBDAV_ENDPOINT=${{ steps.sccache.outputs.endpoint }}
164166 SCCACHE_WEBDAV_TOKEN=${{ steps.sccache.outputs.token }}
Original file line number Diff line number Diff line change @@ -252,6 +252,9 @@ jobs:
252252 with :
253253 toolchain : 1.91.1
254254
255+ - name : Set sccache WebDAV key prefix (Cargo.lock hash)
256+ run : echo "SCCACHE_WEBDAV_KEY_PREFIX=cargo-${{ hashFiles('rust/Cargo.lock') }}" >> "$GITHUB_ENV"
257+
255258 - name : Install sccache
256259 uses : ./.github/actions/setup-sccache
257260
@@ -338,6 +341,9 @@ jobs:
338341 - name : Install protoc
339342 uses : ./.github/actions/setup-protoc
340343
344+ - name : Set sccache WebDAV key prefix (Cargo.lock hash)
345+ run : echo "SCCACHE_WEBDAV_KEY_PREFIX=cargo-${{ hashFiles('rust/Cargo.lock') }}" >> "$GITHUB_ENV"
346+
341347 - name : Install sccache
342348 uses : ./.github/actions/setup-sccache
343349
@@ -449,6 +455,9 @@ jobs:
449455 toolchain : 1.91.1
450456 components : clippy,rustfmt
451457
458+ - name : Set sccache WebDAV key prefix (Cargo.lock hash)
459+ run : echo "SCCACHE_WEBDAV_KEY_PREFIX=cargo-${{ hashFiles('rust/Cargo.lock') }}" >> "$GITHUB_ENV"
460+
452461 - name : Install sccache
453462 uses : ./.github/actions/setup-sccache
454463
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ FROM base AS builder
1717WORKDIR /app
1818ARG BIN
1919ARG BUILD_FEATURES=""
20- ENV PROTO_ROOT=../proto
20+ ARG SCCACHE_WEBDAV_KEY_PREFIX
21+ ENV PROTO_ROOT=../proto SCCACHE_WEBDAV_KEY_PREFIX=${SCCACHE_WEBDAV_KEY_PREFIX}
2122
2223# Ensure working C compile setup (not installed by default in arm64 images)
2324# libclang-dev is required for bindgen (used by librocksdb-sys)
You can’t perform that action at this time.
0 commit comments