diff --git a/src/main.ts b/src/main.ts index a9c504a..9f9f4ab 100644 --- a/src/main.ts +++ b/src/main.ts @@ -74,8 +74,9 @@ async function main() { destination: tmpFile.path, }); - console.log('🗜️ Extracting cache archive...'); - await extractTar(tmpFile.path, workspace); + await core.group('🗜️ Extracting cache archive...', () => + extractTar(tmpFile.path, workspace), + ); saveState({ cacheHitKind: bestMatchKind, diff --git a/src/post.ts b/src/post.ts index b82ef09..1450640 100644 --- a/src/post.ts +++ b/src/post.ts @@ -1,3 +1,4 @@ +import * as core from '@actions/core'; import * as github from '@actions/github'; import * as glob from '@actions/glob'; import { Storage } from '@google-cloud/storage'; @@ -42,8 +43,9 @@ async function main() { .then((files) => files.map((file) => path.relative(workspace, file))); return withTemporaryFile(async (tmpFile) => { - console.log('🗜️ Creating cache archive...'); - await createTar(tmpFile.path, paths, workspace); + await core.group('🗜️ Creating cache archive...', () => + createTar(tmpFile.path, paths, workspace), + ); console.log('🌐 Uploading cache archive to bucket...'); await bucket.upload(tmpFile.path, { diff --git a/src/tar-utils.ts b/src/tar-utils.ts index a8c3bf8..28e8e02 100644 --- a/src/tar-utils.ts +++ b/src/tar-utils.ts @@ -4,9 +4,9 @@ import * as exec from '@actions/exec'; import * as semver from 'semver'; enum CompressionMethod { - GZIP, - ZSTD_WITHOUT_LONG, - ZSTD, + GZIP = 'gzip', + ZSTD_WITHOUT_LONG = 'zstd (without long)', + ZSTD = 'zstd', } async function getTarCompressionMethod(): Promise { @@ -37,6 +37,7 @@ export async function createTar( cwd: string, ): Promise { const compressionMethod = await getTarCompressionMethod(); + console.log(`🔹 Using '${compressionMethod}' compression method.`); const compressionArgs = compressionMethod === CompressionMethod.GZIP @@ -62,6 +63,7 @@ export async function extractTar( cwd: string, ): Promise { const compressionMethod = await getTarCompressionMethod(); + console.log(`🔹 Using '${compressionMethod}' compression method.`); const compressionArgs = compressionMethod === CompressionMethod.GZIP