Compare commits

...

2 Commits

Author SHA1 Message Date
Daz DeBoer a03a9c198b Improve basic cache messages 2026-06-10 15:36:52 -07:00
Daz DeBoer 2577c609e7 Reduce the visual impact of caching info messages 2026-06-10 15:25:34 -07:00
2 changed files with 11 additions and 15 deletions
+5 -5
View File
@@ -44,9 +44,9 @@ export class BasicCacheService implements CacheService {
if (cacheOptions.readOnly) {
const restoredKey = core.getState(RESTORED_KEY_STATE)
if (restoredKey) {
return `Basic caching was read-only. Restored from cache key \`${restoredKey}\`.`
return `Basic caching was read-only. Restored from cache key \`${restoredKey}\`.\n`
}
return 'Basic caching was read-only. No cache entry was found to restore.'
return 'Basic caching was read-only. No cache entry was found to restore.\n'
}
const primaryKey = core.getState(PRIMARY_KEY_STATE)
@@ -54,7 +54,7 @@ export class BasicCacheService implements CacheService {
if (restoredKey === primaryKey) {
core.info(`Basic caching restored entry with key \`${primaryKey}\`. Save was skipped.`)
return `Basic caching restored entry with key \`${primaryKey}\`. Save was skipped.`
return `Basic caching restored entry with key \`${primaryKey}\`. Save was skipped.\n`
}
const cachePaths = getCachePaths(gradleUserHome)
@@ -62,10 +62,10 @@ export class BasicCacheService implements CacheService {
try {
await cache.saveCache(cachePaths, primaryKey)
core.info(`Basic caching saved entry with key: ${primaryKey}`)
return `Basic caching saved entry with key \`${primaryKey}\`.`
return `Basic caching saved entry with key \`${primaryKey}\`.\n`
} catch (error) {
core.warning(`Basic caching failed to save entry with key \`${primaryKey}\`: ${error}`)
return `Basic caching save failed: ${error}`
return `Basic caching save failed: ${error}\n`
}
}
}
+6 -10
View File
@@ -14,21 +14,17 @@ const NOOP_CACHING_REPORT = `
const ENHANCED_CACHE_MESSAGE = `Enhanced Caching: This build is using the proprietary 'gradle-actions-caching' provider for optimized caching support. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for terms of use and opt-out instructions.`
const ENHANCED_CACHE_SUMMARY = `
> [!NOTE]
> ### ⚡️ Enhanced Caching enabled
> This build provides optimized caching support via the proprietary **gradle-actions-caching** provider.
> **⚡️ [Enhanced Caching](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#enhanced-caching)** This build provides optimized caching support via the proprietary **gradle-actions-caching** provider.
> See [DISTRIBUTION.md](https://github.com/gradle/actions/blob/main/DISTRIBUTION.md) for terms of use and opt-out instructions.
`
const BASIC_CACHE_MESSAGE = `Basic Caching: This build uses the open-source caching provider for reliable, path-based caching of Gradle dependencies. Upgrade available: for faster builds and advanced features, consider switching to the Enhanced Caching provider. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for details.`
const BASIC_CACHE_MESSAGE = `Basic Caching: This build uses the basic open-source caching provider. For faster builds and advanced features, consider switching to the Enhanced Caching provider. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for details.`
const BASIC_CACHE_SUMMARY = `
> [!NOTE]
> ### 🛡️ Basic Caching enabled
> This build uses the open-source caching provider for reliable, path-based caching of Gradle dependencies.
>
> **Upgrade Available:** For faster builds and advanced features, consider switching to the **Enhanced Caching** provider.
> See [DISTRIBUTION.md](https://github.com/gradle/actions/blob/main/DISTRIBUTION.md) for details.`
> **🛡️ [Basic Caching](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#basic-caching)** This build uses the basic open-source caching provider.
> For faster builds and advanced features, consider switching to the **[Enhanced Caching](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#enhanced-caching)** provider.
> See [DISTRIBUTION.md](https://github.com/gradle/actions/blob/main/DISTRIBUTION.md) for details.
`
class NoOpCacheService implements CacheService {
async restore(_gradleUserHome: string, _cacheOptions: CacheOptions): Promise<void> {