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:
Daz DeBoer
2021-12-07 12:56:36 -07:00
parent 253d6427fd
commit 1041604f29
4 changed files with 45 additions and 38 deletions

View File

@@ -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))