Commit fbb345b
committed
feat(sfw): cache the sfw binary via @actions/cache
Saves ~130 MB and ~5-15s per run, and gives us a fallback when the
GitHub releases CDN flakes (we've hit that class of incident before
for the vp install scripts in #67).
Implementation:
- restoreCache at the start of installSfw with key
sfw-${SFW_VERSION}-${platform}-${arch}-${libc}
No restoreKeys: we never accept a different version's binary as a
fallback. The version is in the key so a Renovate bump to
SFW_VERSION naturally evicts stale entries (GHA also auto-evicts
after 7 days).
- On cache hit: chmod+addPath and return — skip the download entirely.
- On cache miss: existing download/retry path runs, then saveCache
publishes to GHA cache for future runs.
- All cache calls wrapped in try/catch so any cache-service failure
(network blip, 5xx, ReserveCacheError on duplicate key) falls
through cleanly to the download path; cache is never load-bearing.
- The composition path (socketdev/action@<sha>) is untouched —
findSfwOnPath() still wins and we don't double-cache what
@actions/tool-cache (which socketdev/action uses) already manages.
CI: existing test-sfw matrix exercises both the cache-miss (first
push on a branch) and cache-hit (subsequent pushes) paths; no new
job needed.1 parent 18c1cc4 commit fbb345b
2 files changed
Lines changed: 73 additions & 35 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
89 | 114 | | |
90 | 115 | | |
91 | 116 | | |
| |||
99 | 124 | | |
100 | 125 | | |
101 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
102 | 140 | | |
103 | 141 | | |
104 | 142 | | |
| |||
0 commit comments