1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-02 04:57:46 +02:00

Improve wording

This commit is contained in:
Mario Graf 2023-02-07 08:56:14 +01:00
parent ef428b1bdc
commit 321d8b2f39

View file

@ -241,7 +241,7 @@ steps:
Cache version is a hash [generated](https://github.com/actions/toolkit/blob/500d0b42fee2552ae9eeb5933091fe2fbf14e72d/packages/cache/src/internal/cacheHttpClient.ts#L73-L90) for a combination of compression tool used (Gzip, Zstd, etc. based on the runner OS) and the `path` of directories being cached. If two caches have different versions, they are identified as unique caches while matching. This, for example, means that a cache created on a `windows-latest` runner can't be restored on `ubuntu-latest` as cache `Version`s are different.
Be aware that the same difference in the cache's `Version` can also happen for runners using the same OS and OS version. For instance, on a freshly set-up MacOS machine, there might be no `zstd` compression available, but it might be available on another MacOS machine as it was installed there e.g. as a dependency of a Homebrew package. In this case, caches created on either of those machines cannot be consumed on the other machine as they would use different compression algorithms. For troubleshooting it is useful to have a look at the raw logs to see which compression program and algorithm is actually used when the action is run.
Be aware that the same difference in the cache's `Version` can also happen for runners using the same OS and OS version. For instance, on a freshly set-up MacOS machine, there might be no `zstd` compression available, but it might be available on another MacOS machine as it was installed there e.g. as a dependency of a Homebrew package. In this case, caches created on either of those machines cannot be consumed on the other machine as they would use different compression algorithms and hence have a different `Version`. For troubleshooting, it is useful to have a look at the raw logs to see which compression program and algorithm is actually used when the action is run on a specific runner.
> Pro tip: The [list caches](https://docs.github.com/en/rest/actions/cache#list-github-actions-caches-for-a-repository) API can be used to get the version of a cache. This can be helpful to troubleshoot cache miss due to version.