@actions/cache 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/lib/internal/tar.d.ts +1 -1
- package/lib/internal/tar.js +38 -42
- package/lib/internal/tar.js.map +1 -1
- package/lib/options.js +7 -0
- package/lib/options.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
> Functions necessary for caching dependencies and build outputs to improve workflow execution time.
|
|
4
4
|
|
|
5
|
-
See ["Caching dependencies to speed up workflows"](https://
|
|
5
|
+
See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows) for how caching works.
|
|
6
6
|
|
|
7
7
|
Note that GitHub will remove any cache entries that have not been accessed in over 7 days. There is no limit on the number of caches you can store, but the total size of all caches in a repository is limited to 10 GB. If you exceed this limit, GitHub will save your cache but will begin evicting caches until the total size is less than 10 GB.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
|
-
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).
|
|
11
|
+
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).
|
|
12
12
|
|
|
13
13
|
#### Save Cache
|
|
14
14
|
|
|
15
|
-
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.
|
|
15
|
+
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.
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
18
|
const cache = require('@actions/cache');
|
|
@@ -26,7 +26,7 @@ const cacheId = await cache.saveCache(paths, key)
|
|
|
26
26
|
|
|
27
27
|
#### Restore Cache
|
|
28
28
|
|
|
29
|
-
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.
|
|
29
|
+
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.
|
|
30
30
|
|
|
31
31
|
```js
|
|
32
32
|
const cache = require('@actions/cache');
|
|
@@ -42,3 +42,8 @@ const restoreKeys = [
|
|
|
42
42
|
const cacheKey = await cache.restoreCache(paths, key, restoreKeys)
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
##### Cache segment restore timeout
|
|
46
|
+
|
|
47
|
+
A cache gets downloaded in multiple segments of fixed sizes (`1GB` for a `32-bit` runner and `2GB` for a `64-bit` runner). Sometimes, a segment download gets stuck which causes the workflow job to be stuck forever and fail. Version `v3.0.4` of cache package introduces a segment download timeout. The segment download timeout will allow the segment download to get aborted and hence allow the job to proceed with a cache miss.
|
|
48
|
+
|
|
49
|
+
Default value of this timeout is 60 minutes and can be customized by specifying an [environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables) named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with timeout value in minutes.
|
package/lib/internal/tar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CompressionMethod } from './constants';
|
|
2
|
+
export declare function listTar(archivePath: string, compressionMethod: CompressionMethod): Promise<void>;
|
|
2
3
|
export declare function extractTar(archivePath: string, compressionMethod: CompressionMethod): Promise<void>;
|
|
3
4
|
export declare function createTar(archiveFolder: string, sourceDirectories: string[], compressionMethod: CompressionMethod): Promise<void>;
|
|
4
|
-
export declare function listTar(archivePath: string, compressionMethod: CompressionMethod): Promise<void>;
|
package/lib/internal/tar.js
CHANGED
|
@@ -22,6 +22,7 @@ const fs_1 = require("fs");
|
|
|
22
22
|
const path = __importStar(require("path"));
|
|
23
23
|
const utils = __importStar(require("./cacheUtils"));
|
|
24
24
|
const constants_1 = require("./constants");
|
|
25
|
+
const IS_WINDOWS = process.platform === 'win32';
|
|
25
26
|
function getTarPath(args, compressionMethod) {
|
|
26
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
28
|
switch (process.platform) {
|
|
@@ -69,26 +70,43 @@ function getWorkingDirectory() {
|
|
|
69
70
|
var _a;
|
|
70
71
|
return (_a = process.env['GITHUB_WORKSPACE']) !== null && _a !== void 0 ? _a : process.cwd();
|
|
71
72
|
}
|
|
73
|
+
// Common function for extractTar and listTar to get the compression method
|
|
74
|
+
function getCompressionProgram(compressionMethod) {
|
|
75
|
+
// -d: Decompress.
|
|
76
|
+
// unzstd is equivalent to 'zstd -d'
|
|
77
|
+
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
78
|
+
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
79
|
+
switch (compressionMethod) {
|
|
80
|
+
case constants_1.CompressionMethod.Zstd:
|
|
81
|
+
return [
|
|
82
|
+
'--use-compress-program',
|
|
83
|
+
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30'
|
|
84
|
+
];
|
|
85
|
+
case constants_1.CompressionMethod.ZstdWithoutLong:
|
|
86
|
+
return ['--use-compress-program', IS_WINDOWS ? 'zstd -d' : 'unzstd'];
|
|
87
|
+
default:
|
|
88
|
+
return ['-z'];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function listTar(archivePath, compressionMethod) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const args = [
|
|
94
|
+
...getCompressionProgram(compressionMethod),
|
|
95
|
+
'-tf',
|
|
96
|
+
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
97
|
+
'-P'
|
|
98
|
+
];
|
|
99
|
+
yield execTar(args, compressionMethod);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
exports.listTar = listTar;
|
|
72
103
|
function extractTar(archivePath, compressionMethod) {
|
|
73
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
105
|
// Create directory to extract tar into
|
|
75
106
|
const workingDirectory = getWorkingDirectory();
|
|
76
107
|
yield io.mkdirP(workingDirectory);
|
|
77
|
-
// --d: Decompress.
|
|
78
|
-
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
79
|
-
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
80
|
-
function getCompressionProgram() {
|
|
81
|
-
switch (compressionMethod) {
|
|
82
|
-
case constants_1.CompressionMethod.Zstd:
|
|
83
|
-
return ['--use-compress-program', 'unzstd --long=30'];
|
|
84
|
-
case constants_1.CompressionMethod.ZstdWithoutLong:
|
|
85
|
-
return ['--use-compress-program', 'unzstd'];
|
|
86
|
-
default:
|
|
87
|
-
return ['-z'];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
108
|
const args = [
|
|
91
|
-
...getCompressionProgram(),
|
|
109
|
+
...getCompressionProgram(compressionMethod),
|
|
92
110
|
'-xf',
|
|
93
111
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
94
112
|
'-P',
|
|
@@ -107,15 +125,19 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
|
|
|
107
125
|
fs_1.writeFileSync(path.join(archiveFolder, manifestFilename), sourceDirectories.join('\n'));
|
|
108
126
|
const workingDirectory = getWorkingDirectory();
|
|
109
127
|
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
|
|
128
|
+
// zstdmt is equivalent to 'zstd -T0'
|
|
110
129
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
111
130
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
112
131
|
// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.
|
|
113
132
|
function getCompressionProgram() {
|
|
114
133
|
switch (compressionMethod) {
|
|
115
134
|
case constants_1.CompressionMethod.Zstd:
|
|
116
|
-
return [
|
|
135
|
+
return [
|
|
136
|
+
'--use-compress-program',
|
|
137
|
+
IS_WINDOWS ? 'zstd -T0 --long=30' : 'zstdmt --long=30'
|
|
138
|
+
];
|
|
117
139
|
case constants_1.CompressionMethod.ZstdWithoutLong:
|
|
118
|
-
return ['--use-compress-program', 'zstdmt'];
|
|
140
|
+
return ['--use-compress-program', IS_WINDOWS ? 'zstd -T0' : 'zstdmt'];
|
|
119
141
|
default:
|
|
120
142
|
return ['-z'];
|
|
121
143
|
}
|
|
@@ -137,30 +159,4 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
|
|
|
137
159
|
});
|
|
138
160
|
}
|
|
139
161
|
exports.createTar = createTar;
|
|
140
|
-
function listTar(archivePath, compressionMethod) {
|
|
141
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
142
|
-
// --d: Decompress.
|
|
143
|
-
// --long=#: Enables long distance matching with # bits.
|
|
144
|
-
// Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
145
|
-
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
146
|
-
function getCompressionProgram() {
|
|
147
|
-
switch (compressionMethod) {
|
|
148
|
-
case constants_1.CompressionMethod.Zstd:
|
|
149
|
-
return ['--use-compress-program', 'unzstd --long=30'];
|
|
150
|
-
case constants_1.CompressionMethod.ZstdWithoutLong:
|
|
151
|
-
return ['--use-compress-program', 'unzstd'];
|
|
152
|
-
default:
|
|
153
|
-
return ['-z'];
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
const args = [
|
|
157
|
-
...getCompressionProgram(),
|
|
158
|
-
'-tf',
|
|
159
|
-
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
160
|
-
'-P'
|
|
161
|
-
];
|
|
162
|
-
yield execTar(args, compressionMethod);
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
exports.listTar = listTar;
|
|
166
162
|
//# sourceMappingURL=tar.js.map
|
package/lib/internal/tar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tar.js","sourceRoot":"","sources":["../../src/internal/tar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,wCAAkC;AAClC,gDAAiC;AACjC,2BAA4C;AAC5C,2CAA4B;AAC5B,oDAAqC;AACrC,2CAA6C;AAE7C,SAAe,UAAU,CACvB,IAAc,EACd,iBAAoC;;QAEpC,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,OAAO,CAAC,CAAC;gBACZ,MAAM,SAAS,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,qBAAqB,CAAA;gBAC/D,IAAI,iBAAiB,KAAK,6BAAiB,CAAC,IAAI,EAAE;oBAChD,gFAAgF;oBAChF,wDAAwD;oBACxD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;iBAC3B;qBAAM,IAAI,eAAU,CAAC,SAAS,CAAC,EAAE;oBAChC,OAAO,SAAS,CAAA;iBACjB;qBAAM,IAAI,MAAM,KAAK,CAAC,iBAAiB,EAAE,EAAE;oBAC1C,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;iBAC3B;gBACD,MAAK;aACN;YACD,KAAK,QAAQ,CAAC,CAAC;gBACb,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;gBAC5C,IAAI,MAAM,EAAE;oBACV,0HAA0H;oBAC1H,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;oBACtC,OAAO,MAAM,CAAA;iBACd;gBACD,MAAK;aACN;YACD;gBACE,MAAK;SACR;QACD,OAAO,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACpC,CAAC;CAAA;AAED,SAAe,OAAO,CACpB,IAAc,EACd,iBAAoC,EACpC,GAAY;;QAEZ,IAAI;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copy) {
|
|
|
57
57
|
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
|
|
61
|
+
if (segmentDownloadTimeoutMins &&
|
|
62
|
+
!isNaN(Number(segmentDownloadTimeoutMins)) &&
|
|
63
|
+
isFinite(Number(segmentDownloadTimeoutMins))) {
|
|
64
|
+
result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1000;
|
|
65
|
+
}
|
|
60
66
|
core.debug(`Use Azure SDK: ${result.useAzureSdk}`);
|
|
61
67
|
core.debug(`Download concurrency: ${result.downloadConcurrency}`);
|
|
62
68
|
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
|
|
69
|
+
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
|
|
63
70
|
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
|
|
64
71
|
return result;
|
|
65
72
|
}
|
package/lib/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAqC;AAyDrC;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,IAAoB;IACnD,MAAM,MAAM,GAAkB;QAC5B,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;KAClC,CAAA;IAED,IAAI,IAAI,EAAE;QACR,IAAI,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ,EAAE;YAC9C,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAA;SAClD;QAED,IAAI,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;YAC5C,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAA;SAC9C;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1C,QAAQ,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAC5C;QACA,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC,0BAA0B,CAAC,GAAG,EAAE,GAAG,IAAI,CAAA;KAC3E;IACD,IAAI,CAAC,KAAK,CAAC,kBAAkB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;IAClD,IAAI,CAAC,KAAK,CAAC,yBAAyB,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAA;IACjE,IAAI,CAAC,KAAK,CAAC,yBAAyB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;IACzD,IAAI,CAAC,KAAK,CACR,gDAAgD,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,EAAE,CAC/F,CAAA;IACD,IAAI,CAAC,KAAK,CAAC,kCAAkC,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAA;IAEzE,OAAO,MAAM,CAAA;AACf,CAAC;AA5CD,gDA4CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actions/cache",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"preview": true,
|
|
5
5
|
"description": "Actions cache lib",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"url": "https://github.com/actions/toolkit/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@actions/core": "^1.
|
|
40
|
+
"@actions/core": "^1.10.0",
|
|
41
41
|
"@actions/exec": "^1.0.1",
|
|
42
42
|
"@actions/glob": "^0.1.0",
|
|
43
43
|
"@actions/http-client": "^2.0.1",
|