diff --git a/setup-gradle/README.md b/setup-gradle/README.md index ae59f330..e6871e39 100644 --- a/setup-gradle/README.md +++ b/setup-gradle/README.md @@ -215,7 +215,7 @@ env: GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true ``` -Note that this setting will also prevent certain cache operations from running in parallel, further assisting with debugging. +Note that when the workflow is run in debug mode (above), cache debugging is automatically enabled. ## How Gradle User Home caching works diff --git a/sources/src/cache-base.ts b/sources/src/cache-base.ts index 5aad7a27..4a7905cc 100644 --- a/sources/src/cache-base.ts +++ b/sources/src/cache-base.ts @@ -247,6 +247,8 @@ export class GradleStateCache { /** * When the GitHub environment ACTIONS_RUNNER_DEBUG is true, run Gradle with --info and --stacktrace. * see https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging + * + * @VisibleForTesting */ configureInfoLogLevel(): void { const infoProperties = `org.gradle.logging.level=info\norg.gradle.logging.stacktrace=all\n` @@ -262,11 +264,11 @@ export class GradleStateCache { } /** - * When cache debugging is enabled, this method will give a detailed report - * of the Gradle User Home contents. + * When cache debugging is enabled (or ACTIONS_STEP_DEBUG is on), + * this method will give a detailed report of the Gradle User Home contents. */ private async debugReportGradleUserHomeSize(label: string): Promise { - if (!isCacheDebuggingEnabled()) { + if (!isCacheDebuggingEnabled() && !core.isDebug()) { return } if (!fs.existsSync(this.gradleUserHome)) {