mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-10-21 08:38:56 +08:00
Add cache for project .gradle dir
- For now, this is limited to configuration-cache directory
This commit is contained in:
19
src/caches.ts
Normal file
19
src/caches.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as cacheGradleUserHome from './cache-gradle-user-home'
|
||||
import * as cacheProjectDotGradle from './cache-project-dot-gradle'
|
||||
import * as core from '@actions/core'
|
||||
|
||||
const BUILD_ROOT_DIR = 'BUILD_ROOT_DIR'
|
||||
|
||||
export async function restore(buildRootDirectory: string): Promise<void> {
|
||||
core.saveState(BUILD_ROOT_DIR, buildRootDirectory)
|
||||
|
||||
await cacheGradleUserHome.restore()
|
||||
await cacheProjectDotGradle.restore(buildRootDirectory)
|
||||
}
|
||||
|
||||
export async function save(): Promise<void> {
|
||||
const buildRootDirectory = core.getState(BUILD_ROOT_DIR)
|
||||
|
||||
await cacheGradleUserHome.save()
|
||||
await cacheProjectDotGradle.save(buildRootDirectory)
|
||||
}
|
Reference in New Issue
Block a user