mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 09:02:50 +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
|
||||
}
|
||||
|
||||
core.startGroup('Restore Gradle state from cache')
|
||||
core.saveState(BUILD_ROOT_DIR, buildRootDirectory)
|
||||
new GradleUserHomeCache().restore()
|
||||
new ProjectDotGradleCache(buildRootDirectory).restore()
|
||||
core.endGroup()
|
||||
await core.group('Restore Gradle state from cache', async () => {
|
||||
core.saveState(BUILD_ROOT_DIR, buildRootDirectory)
|
||||
return Promise.all([
|
||||
new GradleUserHomeCache().restore(),
|
||||
new ProjectDotGradleCache(buildRootDirectory).restore()
|
||||
])
|
||||
})
|
||||
}
|
||||
|
||||
export async function save(): Promise<void> {
|
||||
|
@ -24,9 +26,11 @@ export async function save(): Promise<void> {
|
|||
return
|
||||
}
|
||||
|
||||
core.startGroup('Caching Gradle state')
|
||||
const buildRootDirectory = core.getState(BUILD_ROOT_DIR)
|
||||
new GradleUserHomeCache().save()
|
||||
new ProjectDotGradleCache(buildRootDirectory).save()
|
||||
core.endGroup()
|
||||
await core.group('Caching Gradle state', async () => {
|
||||
const buildRootDirectory = core.getState(BUILD_ROOT_DIR)
|
||||
return Promise.all([
|
||||
new GradleUserHomeCache().save(),
|
||||
new ProjectDotGradleCache(buildRootDirectory).save()
|
||||
])
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue