mirror of
https://github.com/actions/cache.git
synced 2024-12-01 06:12:25 +08:00
Fix order of operations bug in restore cache
This commit is contained in:
parent
0075a7b15e
commit
03bcea1bac
6
dist/restore-only/index.js
vendored
6
dist/restore-only/index.js
vendored
@ -27877,14 +27877,14 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
|||||||
}
|
}
|
||||||
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
||||||
core.debug(`Archive path: ${archivePath}`);
|
core.debug(`Archive path: ${archivePath}`);
|
||||||
if (core.isDebug()) {
|
|
||||||
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
|
||||||
}
|
|
||||||
core.debug(`Starting download of artifact to: ${archivePath}`);
|
core.debug(`Starting download of artifact to: ${archivePath}`);
|
||||||
// Attempt to download the cache file from ABS
|
// Attempt to download the cache file from ABS
|
||||||
yield (0, download_cache_1.DownloadCacheFile)(response.signedDownloadUrl, archivePath);
|
yield (0, download_cache_1.DownloadCacheFile)(response.signedDownloadUrl, archivePath);
|
||||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||||
|
if (core.isDebug()) {
|
||||||
|
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
||||||
|
}
|
||||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||||
core.info('Cache restored successfully');
|
core.info('Cache restored successfully');
|
||||||
return request.key;
|
return request.key;
|
||||||
|
6
dist/restore/index.js
vendored
6
dist/restore/index.js
vendored
@ -27877,14 +27877,14 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
|||||||
}
|
}
|
||||||
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
||||||
core.debug(`Archive path: ${archivePath}`);
|
core.debug(`Archive path: ${archivePath}`);
|
||||||
if (core.isDebug()) {
|
|
||||||
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
|
||||||
}
|
|
||||||
core.debug(`Starting download of artifact to: ${archivePath}`);
|
core.debug(`Starting download of artifact to: ${archivePath}`);
|
||||||
// Attempt to download the cache file from ABS
|
// Attempt to download the cache file from ABS
|
||||||
yield (0, download_cache_1.DownloadCacheFile)(response.signedDownloadUrl, archivePath);
|
yield (0, download_cache_1.DownloadCacheFile)(response.signedDownloadUrl, archivePath);
|
||||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||||
|
if (core.isDebug()) {
|
||||||
|
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
||||||
|
}
|
||||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||||
core.info('Cache restored successfully');
|
core.info('Cache restored successfully');
|
||||||
return request.key;
|
return request.key;
|
||||||
|
6
dist/save-only/index.js
vendored
6
dist/save-only/index.js
vendored
@ -27877,14 +27877,14 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
|||||||
}
|
}
|
||||||
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
||||||
core.debug(`Archive path: ${archivePath}`);
|
core.debug(`Archive path: ${archivePath}`);
|
||||||
if (core.isDebug()) {
|
|
||||||
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
|
||||||
}
|
|
||||||
core.debug(`Starting download of artifact to: ${archivePath}`);
|
core.debug(`Starting download of artifact to: ${archivePath}`);
|
||||||
// Attempt to download the cache file from ABS
|
// Attempt to download the cache file from ABS
|
||||||
yield (0, download_cache_1.DownloadCacheFile)(response.signedDownloadUrl, archivePath);
|
yield (0, download_cache_1.DownloadCacheFile)(response.signedDownloadUrl, archivePath);
|
||||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||||
|
if (core.isDebug()) {
|
||||||
|
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
||||||
|
}
|
||||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||||
core.info('Cache restored successfully');
|
core.info('Cache restored successfully');
|
||||||
return request.key;
|
return request.key;
|
||||||
|
6
dist/save/index.js
vendored
6
dist/save/index.js
vendored
@ -27877,14 +27877,14 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
|||||||
}
|
}
|
||||||
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
||||||
core.debug(`Archive path: ${archivePath}`);
|
core.debug(`Archive path: ${archivePath}`);
|
||||||
if (core.isDebug()) {
|
|
||||||
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
|
||||||
}
|
|
||||||
core.debug(`Starting download of artifact to: ${archivePath}`);
|
core.debug(`Starting download of artifact to: ${archivePath}`);
|
||||||
// Attempt to download the cache file from ABS
|
// Attempt to download the cache file from ABS
|
||||||
yield (0, download_cache_1.DownloadCacheFile)(response.signedDownloadUrl, archivePath);
|
yield (0, download_cache_1.DownloadCacheFile)(response.signedDownloadUrl, archivePath);
|
||||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||||
|
if (core.isDebug()) {
|
||||||
|
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
||||||
|
}
|
||||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||||
core.info('Cache restored successfully');
|
core.info('Cache restored successfully');
|
||||||
return request.key;
|
return request.key;
|
||||||
|
Loading…
Reference in New Issue
Block a user