Commit f11e7d60 authored by Paul Merlin's avatar Paul Merlin
Browse files

Short-circuit dependencies and configuration caching if cache dir already exists

This is relevant if you run this action several times in a single job.
This prevent doing unnecessary work starting with the second job using the action.
This prevent droping dependencies downloaded by the first job using the action.
This prevent Windows agents to fail unlinking already existing files.
parent 7137b09a
Loading
Loading
Loading
Loading
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1
Changes for src/cache-configuration.ts: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ export async function restoreCachedConfiguration(
    if (isConfigurationCacheDisabled()) return

    const cachePath = path.resolve(rootDir, '.gradle/configuration-cache')
    if (fs.existsSync(cachePath)) return
    core.saveState(CONFIGURATION_CACHE_PATH, cachePath)

    const inputCacheExact = github.inputBoolean('configuration-cache-exact')
+1
Changes for src/cache-dependencies.ts: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ export async function restoreCachedDependencies(
    if (isDependenciesCacheDisabled()) return

    const cachePath = path.resolve(os.homedir(), '.gradle/caches/modules-2')
    if (fs.existsSync(cachePath)) return
    core.saveState(DEPENDENCIES_CACHE_PATH, cachePath)

    const inputCacheExact = github.inputBoolean('dependencies-cache-exact')