mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-07 16:56:12 +02:00
Add experimental support for cache-cleanup
- Includes basic implementation as `CacheCleaner` - Integration test that checks unused files are removed: - Downloaded dependencies - Local build cache entries - Wrapper distributions
This commit is contained in:
parent
ef638c00fd
commit
915123c493
14 changed files with 522 additions and 1 deletions
|
@ -16,6 +16,7 @@ const CACHE_DISABLED_PARAMETER = 'cache-disabled'
|
|||
const CACHE_READONLY_PARAMETER = 'cache-read-only'
|
||||
const CACHE_WRITEONLY_PARAMETER = 'cache-write-only'
|
||||
const STRICT_CACHE_MATCH_PARAMETER = 'gradle-home-cache-strict-match'
|
||||
const CACHE_CLEANUP_ENABLED_PARAMETER = 'gradle-home-cache-cleanup'
|
||||
const CACHE_DEBUG_VAR = 'GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED'
|
||||
|
||||
const CACHE_KEY_PREFIX_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX'
|
||||
|
@ -46,6 +47,10 @@ export function isCacheDebuggingEnabled(): boolean {
|
|||
return process.env[CACHE_DEBUG_VAR] ? true : false
|
||||
}
|
||||
|
||||
export function isCacheCleanupEnabled(): boolean {
|
||||
return core.getBooleanInput(CACHE_CLEANUP_ENABLED_PARAMETER)
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a key used to restore a cache entry.
|
||||
* The Github Actions cache will first try for an exact match on the key.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue