mirror of
https://github.com/actions/cache.git
synced 2025-04-19 18:46:46 +00:00
Add new actions/cache version (with dryRun support)
This commit is contained in:
parent
6fd2d4538c
commit
eda4a77b7c
6 changed files with 47 additions and 11 deletions
11
dist/restore/index.js
vendored
11
dist/restore/index.js
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue