Loading src/caches.ts +7 −9 Changes for src/caches.ts: 7 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ const GRADLE_USER_HOME = 'GRADLE_USER_HOME' const CACHE_LISTENER = 'CACHE_LISTENER' export async function restore(gradleUserHome: string): Promise<void> { // Only restore cache on first action step in workflow. // Bypass restore cache on all but first action step in workflow. if (process.env[CACHE_RESTORED_VAR]) { core.info('Cache only restored on first action step.') return Loading @@ -17,13 +17,6 @@ export async function restore(gradleUserHome: string): Promise<void> { // Initialize the Gradle User Home even when caching is disabled. const gradleStateCache = new GradleStateCache(gradleUserHome) if (gradleStateCache.cacheOutputExists()) { core.info('Gradle User Home already exists: will not restore from cache.') // We still add init-scripts for build-scan capture gradleStateCache.init() return } gradleStateCache.init() if (isCacheDisabled()) { Loading @@ -31,6 +24,11 @@ export async function restore(gradleUserHome: string): Promise<void> { return } if (gradleStateCache.cacheOutputExists()) { core.info('Gradle User Home already exists: will not restore from cache.') return } await core.group('Restore Gradle state from cache', async () => { core.saveState(GRADLE_USER_HOME, gradleUserHome) Loading Loading @@ -72,7 +70,7 @@ function shouldSaveCaches(): boolean { } if (!core.getState(CACHE_RESTORED_VAR)) { core.info('Cache will only be saved in final post-action step.') core.info('Cache will not be saved: not restored in main action step.') return false } Loading Loading
src/caches.ts +7 −9 Changes for src/caches.ts: 7 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ const GRADLE_USER_HOME = 'GRADLE_USER_HOME' const CACHE_LISTENER = 'CACHE_LISTENER' export async function restore(gradleUserHome: string): Promise<void> { // Only restore cache on first action step in workflow. // Bypass restore cache on all but first action step in workflow. if (process.env[CACHE_RESTORED_VAR]) { core.info('Cache only restored on first action step.') return Loading @@ -17,13 +17,6 @@ export async function restore(gradleUserHome: string): Promise<void> { // Initialize the Gradle User Home even when caching is disabled. const gradleStateCache = new GradleStateCache(gradleUserHome) if (gradleStateCache.cacheOutputExists()) { core.info('Gradle User Home already exists: will not restore from cache.') // We still add init-scripts for build-scan capture gradleStateCache.init() return } gradleStateCache.init() if (isCacheDisabled()) { Loading @@ -31,6 +24,11 @@ export async function restore(gradleUserHome: string): Promise<void> { return } if (gradleStateCache.cacheOutputExists()) { core.info('Gradle User Home already exists: will not restore from cache.') return } await core.group('Restore Gradle state from cache', async () => { core.saveState(GRADLE_USER_HOME, gradleUserHome) Loading Loading @@ -72,7 +70,7 @@ function shouldSaveCaches(): boolean { } if (!core.getState(CACHE_RESTORED_VAR)) { core.info('Cache will only be saved in final post-action step.') core.info('Cache will not be saved: not restored in main action step.') return false } Loading