mirror of
https://github.com/gradle/actions
synced 2024-11-27 11:52:24 +00:00
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.
This commit is contained in:
parent
7137b09ae2
commit
f11e7d60d7
4 changed files with 4 additions and 2 deletions
2
dist/main/index.js
vendored
2
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/post/index.js
vendored
2
dist/post/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue