Commit Graph
15 Commits
Author SHA1 Message Date
saru d4b6457b06 fix: restore step died with exit 141 (SIGPIPE) on every cache hit — act runs step scripts with 'bash -e -o pipefail', so the 'FIRST_ENTRY=$(tar -tf ... | head -1)' detection line killed the step: head -1 closes the pipe after the first line, tar gets SIGPIPE (141), and pipefail propagates it as the script exit status (observed: 'Cache hit' then 'Process completed with exit code 141', step duration 0s, on deploy-leptos after this detection line was added on 2026-08-14)
The previous restores predate the detection line, which is why this only started failing on 2026-08-17. Suppress the pipeline status with '|| true' — FIRST_ENTRY still captures the first archive entry, and a genuinely unreadable archive degrades to the legacy fallback / cache-hit=false path as before.
2026-08-17 11:18:46 +08:00
saru 8cdec4603c Restore into the path input, not the archive's embedded absolute path
Restore only used the path input for a redundant mkdir and then extracted
to / using the absolute path baked into the archive, which pointed at the
stale per-run workspace of whichever run saved it. Extract relative
archives (<basename>/...) into the parent of the requested path; keep a
legacy fallback (extract to /) for old archives, which report cache-hit
only when the requested path actually gains content.
2026-08-14 23:28:31 +08:00
saru 43f1755c0e Touch archives on hit and prune the cache store after restore
Record last use by touching the archive so the retention policy can
expire by access time, and run prune.sh after every restore (even on
miss) to keep the shared store trimmed: keep the 3 newest archives per
key-prefix family, expire anything older than 7 days, hard-cap the store
at 2 GB (oldest first, trumping the keep set), never touch files younger
than 1h, and drop stale run workspaces under ~/.cache/act older than 2
days.
2026-08-14 22:54:47 +08:00
saru 2d128b5303 Add more debug output: key-file, path input, and expanded path on restore 2026-05-22 02:16:56 +08:00
saru 2d57ace5e4 Change path default to github.workspace 2026-05-22 02:02:48 +08:00
saru e744d2a004 Create restore-only action 2026-05-17 02:03:11 +08:00
saru d31ec2f341 Update README with two-step usage pattern (restore before build, save after) 2026-05-16 14:35:31 +08:00
saru 5cd61839b5 Add debug output for cache key, archive path, and cache path 2026-05-16 14:34:47 +08:00
saru 8cffda161a Update README with accurate single-path usage examples 2026-05-16 14:27:42 +08:00
saru d327a5b85e Remove restore-keys fallback, exact key match only 2026-05-16 14:18:41 +08:00
saru 3a3c4d55e0 Simplify to local tar.xz filesystem cache, remove API dependency
- Store cache as tar.xz archives on runner filesystem at ~/.cache/.cache-store/
- No external API calls, no node.js, no curl needed
- Restore extracts archive if key matches, save creates one on miss
- Drastically simpler and more reliable for self-hosted runners
2026-05-16 14:10:29 +08:00
saru a7eff41c26 Replace actions/cache@v5 with local implementation, simplify key inputs
- Remove actions/cache@v5 dependency, implement cache API calls directly
  using curl, tar, and zstd against Gitea's /_apis/artifactcache/ API
- Drop 'key' input, add required 'key-prefix' and 'key-file' inputs
- Cache key is generated as key-prefix-<sha256-of-key-file>
- Update README with revised inputs and Rust-only examples
2026-05-16 14:09:30 +08:00
saru d5b194bf00 Update README with Rust-only examples 2026-05-16 14:02:38 +08:00
saru 48e43c2ed3 Replace Checkout action with Cache action for build file caching
Convert the composite action from Checkout to Cache that:
- Stores build files under ~/.cache/ by default
- Auto-generates cache keys from lockfile hashes
- Uses actions/cache@v5 for restore and save
- Supports custom path, key, key-file, and restore-keys inputs
- Exposes cache-hit output for conditional workflow steps
2026-05-16 14:01:37 +08:00
saru 4bd5fcfe71 Initial commit 2026-05-16 13:56:05 +08:00