mirror of
https://github.com/gradle/actions.git
synced 2026-06-17 09:00:40 +00:00
9c445f57df
Pass develocityAccessToken and develocityServerUrl the `gradle-actions-caching`: required to support project-entry caching (build-logic + configuration-cache), which has experimental support in 'gradle-actions-cache@v0.8.0. This support is not yet released and will be available as a restricted trial. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
import {BuildResult} from './build-results'
|
|
|
|
export interface CacheOptions {
|
|
disabled: boolean
|
|
readOnly: boolean
|
|
writeOnly: boolean
|
|
overwriteExisting: boolean
|
|
strictMatch: boolean
|
|
cleanup: string
|
|
encryptionKey?: string
|
|
develocityAccessToken?: string
|
|
develocityServerUrl?: string
|
|
includes: string[]
|
|
excludes: string[]
|
|
}
|
|
|
|
export type CacheStatus =
|
|
| 'enabled'
|
|
| 'read-only'
|
|
| 'write-only'
|
|
| 'disabled'
|
|
| 'disabled-existing-home'
|
|
| 'not-available'
|
|
|
|
export type CacheCleanupStatus =
|
|
| 'enabled'
|
|
| 'disabled-param'
|
|
| 'disabled-failure'
|
|
| 'disabled-config-cache-hit'
|
|
| 'disabled-readonly'
|
|
|
|
export type ProjectCacheStatus =
|
|
| 'not-enabled' // the hidden opt-in env var was not set (rendered as nothing)
|
|
| 'trial-expired' // past the hard trial expiry
|
|
| 'trial-not-licensed' // Develocity trial token missing or invalid
|
|
| 'no-encryption-key' // Cannot store due to missing encryption key
|
|
| 'enabled' // Trial in effect: will attempt to save project state
|
|
|
|
export interface CacheEntryReport {
|
|
entryName: string
|
|
requestedKey?: string
|
|
restoredKey?: string
|
|
restoredSize?: number
|
|
restoredTime?: number
|
|
restoredOutcome: string
|
|
savedKey?: string
|
|
savedSize?: number
|
|
savedTime?: number
|
|
savedOutcome: string
|
|
}
|
|
|
|
/**
|
|
* Structured result of a cache save operation. Rendering this into a human-readable
|
|
* Job Summary is handled centrally by `caching-report.ts`.
|
|
*/
|
|
export interface CacheReport {
|
|
status: CacheStatus
|
|
cleanup?: CacheCleanupStatus
|
|
projectCache?: ProjectCacheStatus
|
|
entries: CacheEntryReport[]
|
|
}
|
|
|
|
export interface CacheService {
|
|
restore(gradleUserHome: string, cacheOptions: CacheOptions): Promise<void>
|
|
save(gradleUserHome: string, buildResults: BuildResult[], cacheOptions: CacheOptions): Promise<CacheReport>
|
|
}
|