Skip to content

Commit bbdfe5f

Browse files
Try sccache again??
1 parent 9f96422 commit bbdfe5f

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/builds.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ jobs:
134134
if: matrix.name == 'macos-x64'
135135
run: rustup target add x86_64-apple-darwin
136136

137+
# ---------- sccache experiment for Windows Rust builds ----------
138+
- name: Setup sccache (Windows only)
139+
if: runner.os == 'Windows'
140+
uses: mozilla-actions/sccache-action@1583d6b38d7be47f593cb472781bbb21cab4321e # v0.0.10
141+
142+
- name: Enable sccache for Rust (Windows only)
143+
if: runner.os == 'Windows'
144+
shell: bash
145+
run: |
146+
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
147+
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
148+
137149
# ---------- Cache Cargo ----------
138150
# The Rust FFI is built from the pinned client-sdk-rust submodule. Its
139151
# compiled output only changes when the submodule commit changes, so we
@@ -179,6 +191,11 @@ jobs:
179191
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
180192
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
181193
194+
- name: Reset sccache stats (Windows only)
195+
if: runner.os == 'Windows'
196+
shell: bash
197+
run: sccache --zero-stats
198+
182199
# ---------- Build ----------
183200
- name: Build (Unix)
184201
if: runner.os != 'Windows'
@@ -192,6 +209,11 @@ jobs:
192209
shell: pwsh
193210
run: ${{ matrix.build_cmd }}
194211

212+
- name: Show sccache stats (Windows only)
213+
if: always() && runner.os == 'Windows'
214+
shell: bash
215+
run: sccache --show-stats
216+
195217
# Save the populated target/ now, while the build output still exists and
196218
# before the "Clean after build" step runs clean-all. Only on a miss --
197219
# an exact-key hit means the cache already holds this submodule's output.

.github/workflows/tests.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ jobs:
135135
if: matrix.name == 'macos-x64'
136136
run: rustup target add x86_64-apple-darwin
137137

138+
# ---------- sccache experiment for Windows Rust builds ----------
139+
- name: Setup sccache (Windows only)
140+
if: runner.os == 'Windows'
141+
uses: mozilla-actions/sccache-action@1583d6b38d7be47f593cb472781bbb21cab4321e # v0.0.10
142+
143+
- name: Enable sccache for Rust (Windows only)
144+
if: runner.os == 'Windows'
145+
shell: bash
146+
run: |
147+
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
148+
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
149+
138150
# ---------- Cache Cargo ----------
139151
# See builds.yml for the rationale: the Rust FFI output only changes with
140152
# the client-sdk-rust submodule commit, so key the target cache on the
@@ -174,6 +186,11 @@ jobs:
174186
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
175187
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
176188
189+
- name: Reset sccache stats (Windows only)
190+
if: runner.os == 'Windows'
191+
shell: bash
192+
run: sccache --zero-stats
193+
177194
# ---------- Build (release-tests: tests on, examples off) ----------
178195
- name: Build tests (Unix)
179196
if: runner.os != 'Windows'
@@ -187,6 +204,11 @@ jobs:
187204
shell: pwsh
188205
run: ${{ matrix.build_cmd }}
189206

207+
- name: Show sccache stats (Windows only)
208+
if: always() && runner.os == 'Windows'
209+
shell: bash
210+
run: sccache --show-stats
211+
190212
# ---------- Run unit tests ----------
191213
- name: Run unit tests (Unix)
192214
if: runner.os != 'Windows'

0 commit comments

Comments
 (0)