You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Functions necessary for caching dependencies and build outputs to improve workflow execution time.
4
+
5
+
This module exposes bindings to the [@actions/cache package](https://github.com/actions/toolkit/tree/main/packages/cache). See [the @actions/cache README](https://github.com/actions/toolkit/tree/main/packages/cache#actionscache) for more details and important cache limit information.
6
+
7
+
## Usage
8
+
9
+
This package is used by the v2+ versions of our first party cache action. You can find an example implementation in the cache repo [here](https://github.com/actions/cache).
10
+
11
+
#### Restore Cache
12
+
13
+
Restores a cache based on `key` and `restoreKeys` to the `paths` provided. Function returns the cache key for cache hit and returns undefined if cache not found.
14
+
15
+
```purescript
16
+
let paths =
17
+
[ "node_modules"
18
+
, "packages/*/node_modules"
19
+
]
20
+
let primaryKey = 'npm-foobar-d5ea0750'
21
+
let restoreKeys =
22
+
[ "npm-foobar-"
23
+
, "npm-"
24
+
]
25
+
Cache.restoreCache { paths, primaryKey, restoreKeys: Just restoreKeys, options: Nothing }
26
+
```
27
+
28
+
#### Save Cache
29
+
30
+
Saves a cache containing the files in `paths` using the `key` provided. The files would be compressed using zstandard compression algorithm if zstd is installed, otherwise gzip is used. Function returns the cache id if the cache was saved succesfully and throws an error if cache upload fails.
0 commit comments