mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-26 11:02:10 +00:00
Save and restore caches in parallel
This commit is contained in:
parent
6d1455a33e
commit
378bd0b6f8
1 changed files with 14 additions and 10 deletions
|
@ -11,11 +11,13 @@ export async function restore(buildRootDirectory: string): Promise<void> {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
core.startGroup('Restore Gradle state from cache')
|
await core.group('Restore Gradle state from cache', async () => {
|
||||||
core.saveState(BUILD_ROOT_DIR, buildRootDirectory)
|
core.saveState(BUILD_ROOT_DIR, buildRootDirectory)
|
||||||
new GradleUserHomeCache().restore()
|
return Promise.all([
|
||||||
|
new GradleUserHomeCache().restore(),
|
||||||
new ProjectDotGradleCache(buildRootDirectory).restore()
|
new ProjectDotGradleCache(buildRootDirectory).restore()
|
||||||
core.endGroup()
|
])
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function save(): Promise<void> {
|
export async function save(): Promise<void> {
|
||||||
|
@ -24,9 +26,11 @@ export async function save(): Promise<void> {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
core.startGroup('Caching Gradle state')
|
await core.group('Caching Gradle state', async () => {
|
||||||
const buildRootDirectory = core.getState(BUILD_ROOT_DIR)
|
const buildRootDirectory = core.getState(BUILD_ROOT_DIR)
|
||||||
new GradleUserHomeCache().save()
|
return Promise.all([
|
||||||
|
new GradleUserHomeCache().save(),
|
||||||
new ProjectDotGradleCache(buildRootDirectory).save()
|
new ProjectDotGradleCache(buildRootDirectory).save()
|
||||||
core.endGroup()
|
])
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue