mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-12-17 17:02:20 +08:00
Ensure save/restore only on first action step
Instead of relying on the separate cache implementations to check for the existence of cached products, we now explicitly track whether or not the execution is the first time the action has been invoked for a job.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
import {AbstractCache} from './cache-base'
|
||||
|
||||
// TODO: Maybe allow the user to override / tweak this set
|
||||
@@ -17,11 +16,6 @@ export class ProjectDotGradleCache extends AbstractCache {
|
||||
this.rootDir = rootDir
|
||||
}
|
||||
|
||||
protected cacheOutputExists(): boolean {
|
||||
const dir = this.getProjectDotGradleDir()
|
||||
return fs.existsSync(dir)
|
||||
}
|
||||
|
||||
protected getCachePath(): string[] {
|
||||
const dir = this.getProjectDotGradleDir()
|
||||
return PATHS_TO_CACHE.map(x => path.resolve(dir, x))
|
||||
|
||||
Reference in New Issue
Block a user