mirror of
https://gitea.com/actions/cache.git
synced 2024-11-25 13:52:28 +08:00
Add docs for cross os cache compatibility
This commit is contained in:
parent
d1507cccba
commit
9ce89c57c5
|
@ -246,6 +246,7 @@ Following are some of the known practices/workarounds which community has used t
|
||||||
- [Update a cache](./tips-and-workarounds.md#update-a-cache)
|
- [Update a cache](./tips-and-workarounds.md#update-a-cache)
|
||||||
- [Use cache across feature branches](./tips-and-workarounds.md#use-cache-across-feature-branches)
|
- [Use cache across feature branches](./tips-and-workarounds.md#use-cache-across-feature-branches)
|
||||||
- [Force deletion of caches overriding default cache eviction policy](./tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy)
|
- [Force deletion of caches overriding default cache eviction policy](./tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy)
|
||||||
|
- [Cross OS cache](./tips-and-workarounds.md#cross-os-cache)
|
||||||
|
|
||||||
#### Windows environment variables
|
#### Windows environment variables
|
||||||
Please note that Windows environment variables (like `%LocalAppData%`) will NOT be expanded by this action. Instead, prefer using `~` in your paths which will expand to HOME directory. For example, instead of `%LocalAppData%`, use `~\AppData\Local`. For a list of supported default environment variables, see [this](https://docs.github.com/en/actions/learn-github-actions/environment-variables) page.
|
Please note that Windows environment variables (like `%LocalAppData%`) will NOT be expanded by this action. Instead, prefer using `~` in your paths which will expand to HOME directory. For example, instead of `%LocalAppData%`, use `~\AppData\Local`. For a list of supported default environment variables, see [this](https://docs.github.com/en/actions/learn-github-actions/environment-variables) page.
|
||||||
|
|
|
@ -63,3 +63,9 @@ jobs:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
## Cross OS cache
|
||||||
|
From `v3.2.1` cache is cross os compatible. This means that a cache created on `ubuntu-latest` can be used by `windows-latest` and vice versa. This is useful when you want to cache dependencies which is available on different the OSs. This will help reduce the consumption of the cache quota. Things to keep in mind:
|
||||||
|
- Only cache those files which are compatible across OSs.
|
||||||
|
- Don't cache symlinks as they work differently on different OSs so would cause issues during cache restore.
|
||||||
|
- Put runner OS in the cache key if that cache is not ment to be used across OSs.
|
Loading…
Reference in New Issue
Block a user