Changes for README.md: 61 added lines, 6 removed lines.
Original line number
Diff line number
Diff line
@@ -8,6 +8,58 @@ This action allows caching dependencies and build outputs to improve workflow ex
See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows).
* Increased perfomance and improved cache sizes using `zstd` compression
> Note this feature is off for Windows runner that are using `bsdtar` (e.g., windows-latest hosted runner) due to a bug in ziping large random files with `bsdtar`
* Allowed caching for all events with a ref
> See [events that trigger workflow](https://help.github.com/en/actions/reference/events-that-trigger-workflows) for info on which events do not have a `GITHUB_REF`
* Released the [`@actions/cache`](https://github.com/actions/toolkit/tree/master/packages/cache) npm package to allow other actions to utilize caching
* Added a best-effort cleanup step to delete the archive after extraction to reduce storage space
## Usage
### Pre-requisites
@@ -15,7 +67,8 @@ Create a workflow `.yml` file in your repositories `.github/workflows` directory
### Inputs
*`path` - A directory to store and save the cache
*`path` - Directories to store and save the cache. Supports pattern matching, multipath and single file cache
> See [`@actions/glob`](https://github.com/actions/toolkit/tree/master/packages/glob) for supported patterns.
*`key` - An explicit key for restoring and saving the cache
*`restore-keys` - An ordered list of keys to use for restoring the cache if no cache hit occurred for key
@@ -46,7 +99,7 @@ jobs:
-name:Cache Primes
id:cache-primes
uses:actions/cache@v1
uses:actions/cache@v2
with:
path:prime-numbers
key:${{ runner.os }}-primes
@@ -93,9 +146,11 @@ A cache key can include any of the contexts, functions, literals, and operators
For example, using the [`hashFiles`](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#hashfiles) function allows you to create a new cache when dependencies change.
With `actions/cache@v2` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/master/packages/glob#exclude-patterns)