reproducible-containers / buildkit-cache-dance

Save `RUN --mount=type=cache` caches on GitHub Actions ( Forked from https://github.com/overmindtech/buildkit-cache-dance )
Apache License 2.0
98 stars 25 forks source link

Allow skipping extraction step #11

Closed alex-statsig closed 5 months ago

alex-statsig commented 8 months ago

The extraction step takes several minutes for large caches such as caching ~500MB of npm modules. If the actions/cache step had a cache hit, the extraction step is pointless (as the cache will not even be rewritten in that case anyway). This is actually fairly common since lockfiles dont change much. If this action could accept an input for "should-extract", this could be tied to the output of "cache-hit" from actions/cache, and save a few minutes on a lot of runs.

kskalski commented 6 months ago

Another use-case: only populate cache on certain workflow runs, e.g. skip it on PR / experimental branches.

henryjw commented 5 months ago

I've implemented a simple version of this feature. Feel free to clone my repo, reference the commit, or wait for the PR to be merged

Usage example: https://github.com/henryjw/pip-docker-cache-dance/commit/46661c021c2a8274d6cbd35455e9843d69db1287

Example run: https://github.com/henryjw/pip-docker-cache-dance/actions/runs/7588164357/job/20670091003

AkihiroSuda commented 5 months ago

Thanks, merged #19 and released v2.1.4