From e0d2343c3d3416b07aff57fb75f027d3f9685d60 Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 31 Jul 2024 20:49:01 -0600 Subject: [PATCH] Improve logging --- sources/src/caching/cache-cleaner.ts | 4 +--- sources/src/caching/caches.ts | 14 ++++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sources/src/caching/cache-cleaner.ts b/sources/src/caching/cache-cleaner.ts index ac32fb40..27d2a45b 100644 --- a/sources/src/caching/cache-cleaner.ts +++ b/sources/src/caching/cache-cleaner.ts @@ -28,8 +28,6 @@ export class CacheCleaner { // Visible for testing async forceCleanupFilesOlderThan(cleanTimestamp: string): Promise { - core.info(`Cleaning up caches before ${cleanTimestamp}`) - // Run a dummy Gradle build to trigger cache cleanup const cleanupProjectDir = path.resolve(this.tmpDir, 'dummy-cleanup-project') fs.mkdirSync(cleanupProjectDir, {recursive: true}) @@ -59,7 +57,7 @@ export class CacheCleaner { const executable = await provisioner.provisionGradle('current') - await core.group('Executing Gradle build to clean up caches', async () => { + await core.group(`Executing Gradle to clean up caches before ${cleanTimestamp}`, async () => { await this.executeCleanupBuild(executable!, cleanupProjectDir) }) } diff --git a/sources/src/caching/caches.ts b/sources/src/caching/caches.ts index 7df90a7d..d3f4356c 100644 --- a/sources/src/caching/caches.ts +++ b/sources/src/caching/caches.ts @@ -115,12 +115,10 @@ export async function save( } async function performCacheCleanup(gradleUserHome: string): Promise { - await core.group('Performing cache cleanup', async () => { - const cacheCleaner = new CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']!) - try { - await cacheCleaner.forceCleanup() - } catch (e) { - core.warning(`Cache cleanup failed. Will continue. ${String(e)}`) - } - }) + const cacheCleaner = new CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']!) + try { + await cacheCleaner.forceCleanup() + } catch (e) { + core.warning(`Cache cleanup failed. Will continue. ${String(e)}`) + } }