mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:23:33 +00:00
fix(ci): move sccache cache key configuration before action initialization
The SCCACHE_GHA_CACHE_TO and SCCACHE_GHA_CACHE_FROM environment variables must be set BEFORE the mozilla-actions/sccache-action runs, otherwise sccache won't see them during initialization. Changes: - Move cache key configuration before sccache-action setup - Bump cache version to v3 to force fresh cache - Add v2 to CACHE_FROM for transition period - This should finally enable cache hits across workflow runs
This commit is contained in:
@@ -120,6 +120,14 @@ jobs:
|
||||
~/.cargo/registry/cache
|
||||
~/.cargo/git
|
||||
|
||||
# Configure stable cache keys for sccache BEFORE initializing it
|
||||
- name: Configure sccache cache keys
|
||||
shell: bash
|
||||
run: |
|
||||
# Use stable cache keys that persist across runs
|
||||
echo "SCCACHE_GHA_CACHE_TO=sccache-${{ matrix.target }}-rust-1.89-v3" >> "$GITHUB_ENV"
|
||||
echo "SCCACHE_GHA_CACHE_FROM=sccache-${{ matrix.target }}-rust-1.89-v3,sccache-${{ matrix.target }}-rust-1.89-v2" >> "$GITHUB_ENV"
|
||||
|
||||
# ✅ Current sccache action (GHAC support). Do not hand-edit ACTIONS_* envs.
|
||||
- name: Setup sccache (GHA backend)
|
||||
uses: mozilla-actions/[email protected]
|
||||
@@ -127,14 +135,6 @@ jobs:
|
||||
version: v0.10.0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Configure stable cache keys for sccache
|
||||
- name: Configure sccache cache keys
|
||||
shell: bash
|
||||
run: |
|
||||
# Use stable cache keys that persist across runs
|
||||
echo "SCCACHE_GHA_CACHE_TO=sccache-${{ matrix.target }}-rust-1.89-v2" >> "$GITHUB_ENV"
|
||||
echo "SCCACHE_GHA_CACHE_FROM=sccache-${{ matrix.target }}-rust-1.89-v2" >> "$GITHUB_ENV"
|
||||
|
||||
# Ensure GHAC is enabled & rustc routed through sccache; also set a per-OS default local dir
|
||||
- name: Set sccache env + dir
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user