mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 08:11:07 -05: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 ProjectDotGradleCache(buildRootDirectory).restore()
|
new GradleUserHomeCache().restore(),
|
||||||
core.endGroup()
|
new ProjectDotGradleCache(buildRootDirectory).restore()
|
||||||
|
])
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ProjectDotGradleCache(buildRootDirectory).save()
|
new GradleUserHomeCache().save(),
|
||||||
core.endGroup()
|
new ProjectDotGradleCache(buildRootDirectory).save()
|
||||||
|
])
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue