mirror of
https://github.com/actions/cache.git
synced 2025-04-20 19:16:46 +00:00
Use zstd instead of gzip if available
Add zstd to cache versioning
This commit is contained in:
parent
9ceee97d99
commit
97f7baa910
14 changed files with 523 additions and 201 deletions
|
@ -54,8 +54,12 @@ async function run(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
const compressionMethod = await utils.getCompressionMethod();
|
||||
|
||||
try {
|
||||
const cacheEntry = await cacheHttpClient.getCacheEntry(keys);
|
||||
const cacheEntry = await cacheHttpClient.getCacheEntry(keys, {
|
||||
compressionMethod: compressionMethod
|
||||
});
|
||||
if (!cacheEntry?.archiveLocation) {
|
||||
core.info(`Cache not found for input keys: ${keys.join(", ")}`);
|
||||
return;
|
||||
|
@ -63,7 +67,7 @@ async function run(): Promise<void> {
|
|||
|
||||
const archivePath = path.join(
|
||||
await utils.createTempDirectory(),
|
||||
"cache.tgz"
|
||||
utils.getCacheFileName(compressionMethod)
|
||||
);
|
||||
core.debug(`Archive Path: ${archivePath}`);
|
||||
|
||||
|
@ -84,7 +88,7 @@ async function run(): Promise<void> {
|
|||
)} MB (${archiveFileSize} B)`
|
||||
);
|
||||
|
||||
await extractTar(archivePath);
|
||||
await extractTar(archivePath, compressionMethod);
|
||||
} finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue