1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-02 04:57:46 +02:00

Add new actions/cache version (with dryRun support)

This commit is contained in:
Marc Mueller 2022-12-23 14:24:29 +01:00
parent 6fd2d4538c
commit eda4a77b7c
6 changed files with 47 additions and 11 deletions

View file

@ -41808,7 +41808,8 @@ function getDownloadOptions(copy) {
useAzureSdk: true,
downloadConcurrency: 8,
timeoutInMs: 30000,
segmentTimeoutInMs: 3600000
segmentTimeoutInMs: 3600000,
dryRun: false
};
if (copy) {
if (typeof copy.useAzureSdk === 'boolean') {
@ -41823,6 +41824,9 @@ function getDownloadOptions(copy) {
if (typeof copy.segmentTimeoutInMs === 'number') {
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
}
if (typeof copy.dryRun === 'boolean') {
result.dryRun = copy.dryRun;
}
}
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
if (segmentDownloadTimeoutMins &&
@ -41835,6 +41839,7 @@ function getDownloadOptions(copy) {
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
core.debug(`Dry run: ${result.dryRun}`);
return result;
}
exports.getDownloadOptions = getDownloadOptions;
@ -47283,6 +47288,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
// Cache not found
return undefined;
}
if (options === null || options === void 0 ? void 0 : options.dryRun) {
core.info('Dry run - skipping download');
return cacheEntry.cacheKey;
}
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
core.debug(`Archive Path: ${archivePath}`);
// Download the cache from the cache entry

11
dist/restore/index.js vendored
View file

@ -41779,7 +41779,8 @@ function getDownloadOptions(copy) {
useAzureSdk: true,
downloadConcurrency: 8,
timeoutInMs: 30000,
segmentTimeoutInMs: 3600000
segmentTimeoutInMs: 3600000,
dryRun: false
};
if (copy) {
if (typeof copy.useAzureSdk === 'boolean') {
@ -41794,6 +41795,9 @@ function getDownloadOptions(copy) {
if (typeof copy.segmentTimeoutInMs === 'number') {
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
}
if (typeof copy.dryRun === 'boolean') {
result.dryRun = copy.dryRun;
}
}
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
if (segmentDownloadTimeoutMins &&
@ -41806,6 +41810,7 @@ function getDownloadOptions(copy) {
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
core.debug(`Dry run: ${result.dryRun}`);
return result;
}
exports.getDownloadOptions = getDownloadOptions;
@ -47254,6 +47259,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
// Cache not found
return undefined;
}
if (options === null || options === void 0 ? void 0 : options.dryRun) {
core.info('Dry run - skipping download');
return cacheEntry.cacheKey;
}
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
core.debug(`Archive Path: ${archivePath}`);
// Download the cache from the cache entry

View file

@ -41920,7 +41920,8 @@ function getDownloadOptions(copy) {
useAzureSdk: true,
downloadConcurrency: 8,
timeoutInMs: 30000,
segmentTimeoutInMs: 3600000
segmentTimeoutInMs: 3600000,
dryRun: false
};
if (copy) {
if (typeof copy.useAzureSdk === 'boolean') {
@ -41935,6 +41936,9 @@ function getDownloadOptions(copy) {
if (typeof copy.segmentTimeoutInMs === 'number') {
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
}
if (typeof copy.dryRun === 'boolean') {
result.dryRun = copy.dryRun;
}
}
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
if (segmentDownloadTimeoutMins &&
@ -41947,6 +41951,7 @@ function getDownloadOptions(copy) {
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
core.debug(`Dry run: ${result.dryRun}`);
return result;
}
exports.getDownloadOptions = getDownloadOptions;
@ -47395,6 +47400,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
// Cache not found
return undefined;
}
if (options === null || options === void 0 ? void 0 : options.dryRun) {
core.info('Dry run - skipping download');
return cacheEntry.cacheKey;
}
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
core.debug(`Archive Path: ${archivePath}`);
// Download the cache from the cache entry

11
dist/save/index.js vendored
View file

@ -41864,7 +41864,8 @@ function getDownloadOptions(copy) {
useAzureSdk: true,
downloadConcurrency: 8,
timeoutInMs: 30000,
segmentTimeoutInMs: 3600000
segmentTimeoutInMs: 3600000,
dryRun: false
};
if (copy) {
if (typeof copy.useAzureSdk === 'boolean') {
@ -41879,6 +41880,9 @@ function getDownloadOptions(copy) {
if (typeof copy.segmentTimeoutInMs === 'number') {
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
}
if (typeof copy.dryRun === 'boolean') {
result.dryRun = copy.dryRun;
}
}
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
if (segmentDownloadTimeoutMins &&
@ -41891,6 +41895,7 @@ function getDownloadOptions(copy) {
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
core.debug(`Dry run: ${result.dryRun}`);
return result;
}
exports.getDownloadOptions = getDownloadOptions;
@ -47368,6 +47373,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
// Cache not found
return undefined;
}
if (options === null || options === void 0 ? void 0 : options.dryRun) {
core.info('Dry run - skipping download');
return cacheEntry.cacheKey;
}
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
core.debug(`Archive Path: ${archivePath}`);
// Download the cache from the cache entry

12
package-lock.json generated
View file

@ -9,7 +9,7 @@
"version": "3.2.2",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.1.2",
"@actions/cache": "https://github.com/cdce8p/toolkit/raw/cache-dry-run-release/packages/cache/actions-cache-3.1.2.tgz",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
@ -37,8 +37,9 @@
},
"node_modules/@actions/cache": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.2.tgz",
"integrity": "sha512-3XeKcXIonfIbqvW7gPm/VLOhv1RHQ1dtTgSBCH6OUhCgSTii9bEVgu0PIms7UbLnXeMCKFzECfpbud8fJEvBbQ==",
"resolved": "https://github.com/cdce8p/toolkit/raw/cache-dry-run-release/packages/cache/actions-cache-3.1.2.tgz",
"integrity": "sha512-1vcZXG2jWtEnDWq34byiQmS8tgOKAzFEIiMFPtxigm3vHOW+9FGdA2S+eWsK3NBLIbWd5erCkWgo4M0g6gw1yw==",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1",
@ -9722,9 +9723,8 @@
},
"dependencies": {
"@actions/cache": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.2.tgz",
"integrity": "sha512-3XeKcXIonfIbqvW7gPm/VLOhv1RHQ1dtTgSBCH6OUhCgSTii9bEVgu0PIms7UbLnXeMCKFzECfpbud8fJEvBbQ==",
"version": "https://github.com/cdce8p/toolkit/raw/cache-dry-run-release/packages/cache/actions-cache-3.1.2.tgz",
"integrity": "sha512-1vcZXG2jWtEnDWq34byiQmS8tgOKAzFEIiMFPtxigm3vHOW+9FGdA2S+eWsK3NBLIbWd5erCkWgo4M0g6gw1yw==",
"requires": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1",

View file

@ -23,7 +23,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.1.2",
"@actions/cache": "https://github.com/cdce8p/toolkit/raw/cache-dry-run-release/packages/cache/actions-cache-3.1.2.tgz",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"