Compare commits

...

6 Commits

Author SHA1 Message Date
9ce89c57c5 Add docs for cross os cache compatibility 2022-12-26 10:54:30 +00:00
d1507cccba Merge pull request #1042 from me-and/correct-readme-re-windows
README.md: remove outdated Windows cache tip link
2022-12-26 15:19:43 +05:30
3337563725 Merge branch 'main' into correct-readme-re-windows 2022-12-26 11:44:54 +05:30
60c7666709 save/README.md: Fix typo in example (#1040)
Co-authored-by: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com>
2022-12-26 10:19:10 +05:30
b053f2b699 Fix formatting error in restore/README.md (#1044) 2022-12-26 10:10:47 +05:30
501277cfd7 README.md: remove outdated Windows cache tip link
As of 9b0be58 (Release compression related changes for windows (#1039),
2022-12-23), the section of tips-and-workarounds.md referring to
improving cache restore performance on Windows no longer exists, so
don't link to it from README.md.
2022-12-24 13:15:08 +00:00
4 changed files with 10 additions and 4 deletions

View File

@ -245,8 +245,8 @@ Following are some of the known practices/workarounds which community has used t
- [Cache segment restore timeout](./tips-and-workarounds.md#cache-segment-restore-timeout)
- [Update a cache](./tips-and-workarounds.md#update-a-cache)
- [Use cache across feature branches](./tips-and-workarounds.md#use-cache-across-feature-branches)
- [Improving cache restore performance on Windows/Using cross-os caching](./tips-and-workarounds.md#improving-cache-restore-performance-on-windows-using-cross-os-caching)
- [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
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.

View File

@ -120,7 +120,7 @@ steps:
#### Reusing primary key and restored key in the save action
Usually you may want to use same `key` in both actions/cache/restore` and `actions/cache/save` action. To achieve this, use `outputs` from the restore action to reuse the same primary key (or the key of the cache that was restored).
Usually you may want to use same `key` in both `actions/cache/restore` and `actions/cache/save` action. To achieve this, use `outputs` from the restore action to reuse the same primary key (or the key of the cache that was restored).
#### Using restore action outputs to make save action behave just like the cache action

View File

@ -54,7 +54,7 @@ Case 1: Where an user would want to reuse the key as it is
```yaml
uses: actions/cache/save@v3
with:
key: steps.restore-cache.output.key
key: ${{ steps.restore-cache.outputs.key }}
```
Case 2: Where the user would want to re-evaluate the key

View File

@ -62,4 +62,10 @@ jobs:
env:
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.