Commit 60725b7
committed
chore(ci): optimize caching with rust-cache
Replace manual caching (registry, git, target) with Swatinem/rust-cache
for better performance and simpler configuration.
**Benefits**:
- 73% less cache configuration (45 → 12 lines)
- 20-30% faster CI runs (estimated)
- Smarter cache keys with restore fallbacks
- Industry standard (rust-lang, tokio, serde use it)
- Auto-cleanup prevents cache bloat
**Why rust-cache over sccache**:
- Project has 500 deps, 7 parallel jobs
- sccache gives only 10-20s additional savings
- rust-cache: simpler config, proven solution
- Deferred sccache until CI time exceeds 10 min
**Configuration**:
- Separate cache per job type (test/clippy/build)
- Only main branch saves cache (PRs read-only)
- Prevents cache pollution from feature branches
**Expected improvements**:
- Cache hit rate: 50-60% → 80-90%
- Subsequent PR runs: 4-7 min → 3-5 min
- Cache size: ~2 GB (within 10 GB GitHub limit)
Analysis docs: .local/CI_SCCACHE_*.md (not committed, local only)1 parent f2b7320 commit 60725b7
1 file changed
+12
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 38 | + | |
| 39 | + | |
52 | 40 | | |
53 | 41 | | |
54 | 42 | | |
| |||
83 | 71 | | |
84 | 72 | | |
85 | 73 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 74 | + | |
| 75 | + | |
94 | 76 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 77 | + | |
| 78 | + | |
103 | 79 | | |
104 | 80 | | |
105 | 81 | | |
| |||
127 | 103 | | |
128 | 104 | | |
129 | 105 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 106 | + | |
| 107 | + | |
144 | 108 | | |
145 | | - | |
146 | | - | |
| 109 | + | |
| 110 | + | |
147 | 111 | | |
148 | 112 | | |
149 | 113 | | |
0 commit comments