Archive the cached dir relative, not by its absolute path

Each run gets a fresh per-run workspace (~/.cache/act/<hash>/hostexecutor),
so embedding the absolute path meant the next run restored into a stale
workspace and the cache never actually sped up a build. Save with
-C <parent> <basename> so entries are <basename>/... and restores can
extract into the run's own path input location.
This commit is contained in:
2026-08-14 23:28:25 +08:00
parent c9286e3624
commit 3e8d61a92b
2 changed files with 9 additions and 2 deletions
+3
View File
@@ -23,6 +23,9 @@ A Gitea Action that caches build files as `tar.xz` archives on the runner filesy
2. Stores archives at `~/.cache/.cache-store/<key>.tar.xz`
3. Restores by extracting the archive to `/`, saves by creating one
4. Saves atomically (write to `<key>.tar.xz.tmp`, then rename)
5. Archives store the cached directory **relative** (`<basename>/...`), not its
absolute path — a later run restores into its own `path` location, so the
cache works across runs even though each run gets a fresh workspace
## Cache Retention