@actions/cache 1.0.5 → 1.0.9
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/LICENSE.md +8 -8
- package/README.md +44 -44
- package/lib/cache.d.ts +26 -26
- package/lib/cache.js +164 -146
- package/lib/cache.js.map +1 -1
- package/lib/internal/cacheHttpClient.d.ts +8 -8
- package/lib/internal/cacheHttpClient.js +215 -214
- package/lib/internal/cacheHttpClient.js.map +1 -1
- package/lib/internal/cacheUtils.d.ts +11 -11
- package/lib/internal/cacheUtils.js +169 -169
- package/lib/internal/constants.d.ts +12 -12
- package/lib/internal/constants.js +23 -23
- package/lib/internal/downloadUtils.d.ts +74 -74
- package/lib/internal/downloadUtils.js +229 -229
- package/lib/internal/downloadUtils.js.map +1 -1
- package/lib/internal/requestUtils.d.ts +7 -7
- package/lib/internal/requestUtils.js +118 -118
- package/lib/internal/tar.d.ts +4 -3
- package/lib/internal/tar.js +163 -124
- package/lib/internal/tar.js.map +1 -1
- package/lib/options.d.ts +56 -56
- package/lib/options.js +61 -61
- package/package.json +55 -55
package/lib/options.d.ts
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options to control cache upload
|
|
3
|
-
*/
|
|
4
|
-
export interface UploadOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Number of parallel cache upload
|
|
7
|
-
*
|
|
8
|
-
* @default 4
|
|
9
|
-
*/
|
|
10
|
-
uploadConcurrency?: number;
|
|
11
|
-
/**
|
|
12
|
-
* Maximum chunk size in bytes for cache upload
|
|
13
|
-
*
|
|
14
|
-
* @default 32MB
|
|
15
|
-
*/
|
|
16
|
-
uploadChunkSize?: number;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Options to control cache download
|
|
20
|
-
*/
|
|
21
|
-
export interface DownloadOptions {
|
|
22
|
-
/**
|
|
23
|
-
* Indicates whether to use the Azure Blob SDK to download caches
|
|
24
|
-
* that are stored on Azure Blob Storage to improve reliability and
|
|
25
|
-
* performance
|
|
26
|
-
*
|
|
27
|
-
* @default true
|
|
28
|
-
*/
|
|
29
|
-
useAzureSdk?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Number of parallel downloads (this option only applies when using
|
|
32
|
-
* the Azure SDK)
|
|
33
|
-
*
|
|
34
|
-
* @default 8
|
|
35
|
-
*/
|
|
36
|
-
downloadConcurrency?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Maximum time for each download request, in milliseconds (this
|
|
39
|
-
* option only applies when using the Azure SDK)
|
|
40
|
-
*
|
|
41
|
-
* @default 30000
|
|
42
|
-
*/
|
|
43
|
-
timeoutInMs?: number;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Returns a copy of the upload options with defaults filled in.
|
|
47
|
-
*
|
|
48
|
-
* @param copy the original upload options
|
|
49
|
-
*/
|
|
50
|
-
export declare function getUploadOptions(copy?: UploadOptions): UploadOptions;
|
|
51
|
-
/**
|
|
52
|
-
* Returns a copy of the download options with defaults filled in.
|
|
53
|
-
*
|
|
54
|
-
* @param copy the original download options
|
|
55
|
-
*/
|
|
56
|
-
export declare function getDownloadOptions(copy?: DownloadOptions): DownloadOptions;
|
|
1
|
+
/**
|
|
2
|
+
* Options to control cache upload
|
|
3
|
+
*/
|
|
4
|
+
export interface UploadOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Number of parallel cache upload
|
|
7
|
+
*
|
|
8
|
+
* @default 4
|
|
9
|
+
*/
|
|
10
|
+
uploadConcurrency?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Maximum chunk size in bytes for cache upload
|
|
13
|
+
*
|
|
14
|
+
* @default 32MB
|
|
15
|
+
*/
|
|
16
|
+
uploadChunkSize?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Options to control cache download
|
|
20
|
+
*/
|
|
21
|
+
export interface DownloadOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Indicates whether to use the Azure Blob SDK to download caches
|
|
24
|
+
* that are stored on Azure Blob Storage to improve reliability and
|
|
25
|
+
* performance
|
|
26
|
+
*
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
useAzureSdk?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Number of parallel downloads (this option only applies when using
|
|
32
|
+
* the Azure SDK)
|
|
33
|
+
*
|
|
34
|
+
* @default 8
|
|
35
|
+
*/
|
|
36
|
+
downloadConcurrency?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Maximum time for each download request, in milliseconds (this
|
|
39
|
+
* option only applies when using the Azure SDK)
|
|
40
|
+
*
|
|
41
|
+
* @default 30000
|
|
42
|
+
*/
|
|
43
|
+
timeoutInMs?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns a copy of the upload options with defaults filled in.
|
|
47
|
+
*
|
|
48
|
+
* @param copy the original upload options
|
|
49
|
+
*/
|
|
50
|
+
export declare function getUploadOptions(copy?: UploadOptions): UploadOptions;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a copy of the download options with defaults filled in.
|
|
53
|
+
*
|
|
54
|
+
* @param copy the original download options
|
|
55
|
+
*/
|
|
56
|
+
export declare function getDownloadOptions(copy?: DownloadOptions): DownloadOptions;
|
package/lib/options.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const core = __importStar(require("@actions/core"));
|
|
11
|
-
/**
|
|
12
|
-
* Returns a copy of the upload options with defaults filled in.
|
|
13
|
-
*
|
|
14
|
-
* @param copy the original upload options
|
|
15
|
-
*/
|
|
16
|
-
function getUploadOptions(copy) {
|
|
17
|
-
const result = {
|
|
18
|
-
uploadConcurrency: 4,
|
|
19
|
-
uploadChunkSize: 32 * 1024 * 1024
|
|
20
|
-
};
|
|
21
|
-
if (copy) {
|
|
22
|
-
if (typeof copy.uploadConcurrency === 'number') {
|
|
23
|
-
result.uploadConcurrency = copy.uploadConcurrency;
|
|
24
|
-
}
|
|
25
|
-
if (typeof copy.uploadChunkSize === 'number') {
|
|
26
|
-
result.uploadChunkSize = copy.uploadChunkSize;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
core.debug(`Upload concurrency: ${result.uploadConcurrency}`);
|
|
30
|
-
core.debug(`Upload chunk size: ${result.uploadChunkSize}`);
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
exports.getUploadOptions = getUploadOptions;
|
|
34
|
-
/**
|
|
35
|
-
* Returns a copy of the download options with defaults filled in.
|
|
36
|
-
*
|
|
37
|
-
* @param copy the original download options
|
|
38
|
-
*/
|
|
39
|
-
function getDownloadOptions(copy) {
|
|
40
|
-
const result = {
|
|
41
|
-
useAzureSdk: true,
|
|
42
|
-
downloadConcurrency: 8,
|
|
43
|
-
timeoutInMs: 30000
|
|
44
|
-
};
|
|
45
|
-
if (copy) {
|
|
46
|
-
if (typeof copy.useAzureSdk === 'boolean') {
|
|
47
|
-
result.useAzureSdk = copy.useAzureSdk;
|
|
48
|
-
}
|
|
49
|
-
if (typeof copy.downloadConcurrency === 'number') {
|
|
50
|
-
result.downloadConcurrency = copy.downloadConcurrency;
|
|
51
|
-
}
|
|
52
|
-
if (typeof copy.timeoutInMs === 'number') {
|
|
53
|
-
result.timeoutInMs = copy.timeoutInMs;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
core.debug(`Use Azure SDK: ${result.useAzureSdk}`);
|
|
57
|
-
core.debug(`Download concurrency: ${result.downloadConcurrency}`);
|
|
58
|
-
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
exports.getDownloadOptions = getDownloadOptions;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
+
if (mod && mod.__esModule) return mod;
|
|
4
|
+
var result = {};
|
|
5
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
+
result["default"] = mod;
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const core = __importStar(require("@actions/core"));
|
|
11
|
+
/**
|
|
12
|
+
* Returns a copy of the upload options with defaults filled in.
|
|
13
|
+
*
|
|
14
|
+
* @param copy the original upload options
|
|
15
|
+
*/
|
|
16
|
+
function getUploadOptions(copy) {
|
|
17
|
+
const result = {
|
|
18
|
+
uploadConcurrency: 4,
|
|
19
|
+
uploadChunkSize: 32 * 1024 * 1024
|
|
20
|
+
};
|
|
21
|
+
if (copy) {
|
|
22
|
+
if (typeof copy.uploadConcurrency === 'number') {
|
|
23
|
+
result.uploadConcurrency = copy.uploadConcurrency;
|
|
24
|
+
}
|
|
25
|
+
if (typeof copy.uploadChunkSize === 'number') {
|
|
26
|
+
result.uploadChunkSize = copy.uploadChunkSize;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
core.debug(`Upload concurrency: ${result.uploadConcurrency}`);
|
|
30
|
+
core.debug(`Upload chunk size: ${result.uploadChunkSize}`);
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
exports.getUploadOptions = getUploadOptions;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a copy of the download options with defaults filled in.
|
|
36
|
+
*
|
|
37
|
+
* @param copy the original download options
|
|
38
|
+
*/
|
|
39
|
+
function getDownloadOptions(copy) {
|
|
40
|
+
const result = {
|
|
41
|
+
useAzureSdk: true,
|
|
42
|
+
downloadConcurrency: 8,
|
|
43
|
+
timeoutInMs: 30000
|
|
44
|
+
};
|
|
45
|
+
if (copy) {
|
|
46
|
+
if (typeof copy.useAzureSdk === 'boolean') {
|
|
47
|
+
result.useAzureSdk = copy.useAzureSdk;
|
|
48
|
+
}
|
|
49
|
+
if (typeof copy.downloadConcurrency === 'number') {
|
|
50
|
+
result.downloadConcurrency = copy.downloadConcurrency;
|
|
51
|
+
}
|
|
52
|
+
if (typeof copy.timeoutInMs === 'number') {
|
|
53
|
+
result.timeoutInMs = copy.timeoutInMs;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
core.debug(`Use Azure SDK: ${result.useAzureSdk}`);
|
|
57
|
+
core.debug(`Download concurrency: ${result.downloadConcurrency}`);
|
|
58
|
+
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
exports.getDownloadOptions = getDownloadOptions;
|
|
62
62
|
//# sourceMappingURL=options.js.map
|
package/package.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@actions/cache",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"preview": true,
|
|
5
|
-
"description": "Actions cache lib",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"github",
|
|
8
|
-
"actions",
|
|
9
|
-
"cache"
|
|
10
|
-
],
|
|
11
|
-
"homepage": "https://github.com/actions/toolkit/tree/main/packages/cache",
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"main": "lib/cache.js",
|
|
14
|
-
"types": "lib/cache.d.ts",
|
|
15
|
-
"directories": {
|
|
16
|
-
"lib": "lib",
|
|
17
|
-
"test": "__tests__"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"lib",
|
|
21
|
-
"!.DS_Store"
|
|
22
|
-
],
|
|
23
|
-
"publishConfig": {
|
|
24
|
-
"access": "public"
|
|
25
|
-
},
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/actions/toolkit.git",
|
|
29
|
-
"directory": "packages/cache"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
|
33
|
-
"test": "echo \"Error: run tests from root\" && exit 1",
|
|
34
|
-
"tsc": "tsc"
|
|
35
|
-
},
|
|
36
|
-
"bugs": {
|
|
37
|
-
"url": "https://github.com/actions/toolkit/issues"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@actions/core": "^1.2.6",
|
|
41
|
-
"@actions/exec": "^1.0.1",
|
|
42
|
-
"@actions/glob": "^0.1.0",
|
|
43
|
-
"@actions/http-client": "^1.0.9",
|
|
44
|
-
"@actions/io": "^1.0.1",
|
|
45
|
-
"@azure/ms-rest-js": "^2.0
|
|
46
|
-
"@azure/storage-blob": "^12.
|
|
47
|
-
"semver": "^6.1.0",
|
|
48
|
-
"uuid": "^3.3.3"
|
|
49
|
-
},
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"typescript": "^3.8.3",
|
|
52
|
-
"@types/semver": "^6.0.0",
|
|
53
|
-
"@types/uuid": "^3.4.5"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@actions/cache",
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"preview": true,
|
|
5
|
+
"description": "Actions cache lib",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"github",
|
|
8
|
+
"actions",
|
|
9
|
+
"cache"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/actions/toolkit/tree/main/packages/cache",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"main": "lib/cache.js",
|
|
14
|
+
"types": "lib/cache.d.ts",
|
|
15
|
+
"directories": {
|
|
16
|
+
"lib": "lib",
|
|
17
|
+
"test": "__tests__"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"lib",
|
|
21
|
+
"!.DS_Store"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/actions/toolkit.git",
|
|
29
|
+
"directory": "packages/cache"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
|
33
|
+
"test": "echo \"Error: run tests from root\" && exit 1",
|
|
34
|
+
"tsc": "tsc"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/actions/toolkit/issues"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@actions/core": "^1.2.6",
|
|
41
|
+
"@actions/exec": "^1.0.1",
|
|
42
|
+
"@actions/glob": "^0.1.0",
|
|
43
|
+
"@actions/http-client": "^1.0.9",
|
|
44
|
+
"@actions/io": "^1.0.1",
|
|
45
|
+
"@azure/ms-rest-js": "^2.6.0",
|
|
46
|
+
"@azure/storage-blob": "^12.8.0",
|
|
47
|
+
"semver": "^6.1.0",
|
|
48
|
+
"uuid": "^3.3.3"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"typescript": "^3.8.3",
|
|
52
|
+
"@types/semver": "^6.0.0",
|
|
53
|
+
"@types/uuid": "^3.4.5"
|
|
54
|
+
}
|
|
55
|
+
}
|