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
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,34 @@ Remove compression artifacts after they are used. Default: `false`.
88
88
89
89
Note that if you turn on this option, every execution will create temporary files that may fill up your agent's storage.
90
90
91
+
### `key-extra`
92
+
93
+
Additional data used to compute the cache key. You can use this additional parameter to further differentiate within a given level.
94
+
95
+
For example when used in conjunction with a build matrix:
96
+
97
+
```yaml
98
+
steps:
99
+
- matrix:
100
+
- "darwin"
101
+
- "Linux"
102
+
- "Windows"
103
+
label: "{{matrix}} build"
104
+
command: "GOOS={{matrix}} go build"
105
+
env:
106
+
os: "{{matrix}}"
107
+
GOMODCACHE: pkg/cache
108
+
plugins:
109
+
- cache#v1.5.2:
110
+
path: pkg/cache
111
+
manifest:
112
+
- go.mod
113
+
- go.sum
114
+
restore: file
115
+
save: file
116
+
key-extra: "{{matrix}}"
117
+
```
118
+
91
119
### `manifest` (string or list of strings, required if using `file` caching level)
92
120
93
121
One or more paths to files or folders that will be hashed to create and restore file-level caches. If multiple files or folders are specified its ordering does not matter.
@@ -105,6 +133,8 @@ This plugin uses the following hierarchical structure for caches to be valid (me
105
133
106
134
When restoring from cache, **all levels, in the described order, up to the one specified** will be checked. The first one available will be restored and no further levels or checks will be made.
107
135
136
+
Note: you can use the [`key-extra`](#key-extra) option to further differentiate within a level
137
+
108
138
## Customizable backends
109
139
110
140
One of the greatest flexibilities of this plugin is its flexible backend architecture. You can provide whatever value you want for the `backend` option of this plugin (`X` for example) as long as there is an executable script accessible to the agent named `cache_X` that respects the following execution protocol:
0 commit comments