Fix order of operations bug in restore cache

This commit is contained in:
Bassem Dghaidi 2024-10-21 04:17:57 -07:00 committed by GitHub
parent cf539bd9ee
commit 0075a7b15e
4 changed files with 8 additions and 8 deletions

View File

@ -27881,10 +27881,10 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
yield (0, tar_1.listTar)(archivePath, compressionMethod); yield (0, tar_1.listTar)(archivePath, compressionMethod);
} }
core.debug(`Starting download of artifact to: ${archivePath}`); core.debug(`Starting download of artifact to: ${archivePath}`);
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
// 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);
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
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;

View File

@ -27881,10 +27881,10 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
yield (0, tar_1.listTar)(archivePath, compressionMethod); yield (0, tar_1.listTar)(archivePath, compressionMethod);
} }
core.debug(`Starting download of artifact to: ${archivePath}`); core.debug(`Starting download of artifact to: ${archivePath}`);
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
// 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);
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
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;

View File

@ -27881,10 +27881,10 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
yield (0, tar_1.listTar)(archivePath, compressionMethod); yield (0, tar_1.listTar)(archivePath, compressionMethod);
} }
core.debug(`Starting download of artifact to: ${archivePath}`); core.debug(`Starting download of artifact to: ${archivePath}`);
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
// 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);
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
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;

4
dist/save/index.js vendored
View File

@ -27881,10 +27881,10 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
yield (0, tar_1.listTar)(archivePath, compressionMethod); yield (0, tar_1.listTar)(archivePath, compressionMethod);
} }
core.debug(`Starting download of artifact to: ${archivePath}`); core.debug(`Starting download of artifact to: ${archivePath}`);
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
// 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);
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
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;