Skip to content

Commit 4290a40

Browse files
Cleanup
1 parent 61e6df3 commit 4290a40

2 files changed

Lines changed: 6 additions & 71 deletions

File tree

.github/workflows/builds.yml

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ env:
1818
# incremental dirs add nothing but bloat the cached target/ directory and
1919
# slow the cache upload/download.
2020
CARGO_INCREMENTAL: "0"
21-
# sccache uses this when the server starts. Set it at workflow scope so the
22-
# probe step can actually start the server with the GitHub Actions backend.
23-
SCCACHE_GHA_ENABLED: "true"
2421
# vcpkg binary caching for Windows. The x-gha backend was removed from vcpkg,
2522
# so use vcpkg's files provider and persist that directory with actions/cache.
2623
VCPKG_GIT_COMMIT: fb87e2bb3fe69e16c224989acb5a61349166c782
@@ -137,25 +134,6 @@ jobs:
137134
if: matrix.name == 'macos-x64'
138135
run: rustup target add x86_64-apple-darwin
139136

140-
# ---------- sccache experiment for Windows Rust builds ----------
141-
- name: Setup sccache (Windows only)
142-
if: runner.os == 'Windows'
143-
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
144-
145-
- name: Enable sccache wrapping (Windows only)
146-
id: sccache
147-
if: runner.os == 'Windows'
148-
shell: bash
149-
run: |
150-
if sccache --start-server >/dev/null 2>&1; then
151-
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
152-
echo "enabled=true" >> "$GITHUB_OUTPUT"
153-
echo "::notice::sccache enabled (RUSTC_WRAPPER=sccache)"
154-
else
155-
echo "enabled=false" >> "$GITHUB_OUTPUT"
156-
echo "::warning::sccache backend unreachable; building without compile cache this run"
157-
fi
158-
159137
# ---------- Cache Cargo ----------
160138
# The Rust FFI is built from the pinned client-sdk-rust submodule. Its
161139
# compiled output only changes when the submodule commit changes, so we
@@ -201,11 +179,6 @@ jobs:
201179
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
202180
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
203181
204-
- name: Reset sccache stats (Windows only)
205-
if: runner.os == 'Windows' && steps.sccache.outputs.enabled == 'true'
206-
shell: bash
207-
run: sccache --zero-stats
208-
209182
# ---------- Build ----------
210183
- name: Build (Unix)
211184
if: runner.os != 'Windows'
@@ -219,18 +192,12 @@ jobs:
219192
shell: pwsh
220193
run: ${{ matrix.build_cmd }}
221194

222-
- name: Show sccache stats (Windows only)
223-
if: always() && runner.os == 'Windows'
224-
shell: bash
225-
run: sccache --show-stats
226-
227195
# Save the populated target/ now, while the build output still exists and
228-
# before the "Clean after build" step runs clean-all. Only on a miss --
229-
# an exact-key hit means the cache already holds this submodule's output.
230-
# A restore-keys prefix hit still counts as a miss (cache-hit != 'true'),
231-
# so a submodule bump always refreshes the cache under the new SHA.
196+
# before the "Clean after build" step runs clean-all. Save only from main
197+
# pushes so PRs restore from the shared main cache instead of creating
198+
# large PR-scoped target caches that quickly evict useful entries.
232199
- name: Save cargo target
233-
if: steps.cache-cargo-target.outputs.cache-hit != 'true'
200+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.cache-cargo-target.outputs.cache-hit != 'true'
234201
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
235202
with:
236203
path: client-sdk-rust/target/

.github/workflows/tests.yml

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ env:
1818
# incremental dirs add nothing but bloat the cached target/ directory and
1919
# slow the cache upload/download.
2020
CARGO_INCREMENTAL: "0"
21-
# sccache uses this when the server starts. Set it at workflow scope so the
22-
# probe step can actually start the server with the GitHub Actions backend.
23-
SCCACHE_GHA_ENABLED: "true"
2421
# vcpkg binary caching for Windows (mirrors builds.yml). The x-gha backend
2522
# was removed from vcpkg, so use vcpkg's files provider and persist that
2623
# directory with actions/cache.
@@ -138,30 +135,11 @@ jobs:
138135
if: matrix.name == 'macos-x64'
139136
run: rustup target add x86_64-apple-darwin
140137

141-
# ---------- sccache experiment for Windows Rust builds ----------
142-
- name: Setup sccache (Windows only)
143-
if: runner.os == 'Windows'
144-
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
145-
146-
- name: Enable sccache wrapping (Windows only)
147-
id: sccache
148-
if: runner.os == 'Windows'
149-
shell: bash
150-
run: |
151-
if sccache --start-server >/dev/null 2>&1; then
152-
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
153-
echo "enabled=true" >> "$GITHUB_OUTPUT"
154-
echo "::notice::sccache enabled (RUSTC_WRAPPER=sccache)"
155-
else
156-
echo "enabled=false" >> "$GITHUB_OUTPUT"
157-
echo "::warning::sccache backend unreachable; building without compile cache this run"
158-
fi
159-
160138
# ---------- Cache Cargo ----------
161139
# See builds.yml for the rationale: the Rust FFI output only changes with
162140
# the client-sdk-rust submodule commit, so key the target cache on the
163-
# submodule SHA. The build workflow owns saving this cache; tests are
164-
# restore-only to avoid same-key save races across parallel jobs.
141+
# submodule SHA. Only main pushes save this cache; tests are restore-only
142+
# to avoid same-key save races and PR-scoped cache churn.
165143
- name: Resolve Rust submodule SHA
166144
id: rust_sha
167145
shell: bash
@@ -196,11 +174,6 @@ jobs:
196174
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
197175
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
198176
199-
- name: Reset sccache stats (Windows only)
200-
if: runner.os == 'Windows' && steps.sccache.outputs.enabled == 'true'
201-
shell: bash
202-
run: sccache --zero-stats
203-
204177
# ---------- Build (release-tests: tests on, examples off) ----------
205178
- name: Build tests (Unix)
206179
if: runner.os != 'Windows'
@@ -214,11 +187,6 @@ jobs:
214187
shell: pwsh
215188
run: ${{ matrix.build_cmd }}
216189

217-
- name: Show sccache stats (Windows only)
218-
if: always() && runner.os == 'Windows'
219-
shell: bash
220-
run: sccache --show-stats
221-
222190
# ---------- Run unit tests ----------
223191
- name: Run unit tests (Unix)
224192
if: runner.os != 'Windows'

0 commit comments

Comments
 (0)