From 3925c9aa5248698888bd78945d4aff00aa88dabb Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 7 Aug 2026 09:47:50 -0700 Subject: [PATCH 01/16] Add configuration cache experiment option --- .../experiment-with-gradle-profiler.yaml | 10 +++++ .github/workflows/experiment.yaml | 15 ++++++++ .../runner-gradle-profiler/action.yaml | 30 ++++++++++++++- .github/workflows/runner-seed/action.yaml | 36 +++++++++++++++++- .github/workflows/runner/action.yaml | 38 ++++++++++++++++++- README.md | 17 ++++++++- docs/actions-inputs.md | 38 ++++++++++++++++++- 7 files changed, 178 insertions(+), 6 deletions(-) diff --git a/.github/workflows/experiment-with-gradle-profiler.yaml b/.github/workflows/experiment-with-gradle-profiler.yaml index a1aa1e7..f1dd64d 100644 --- a/.github/workflows/experiment-with-gradle-profiler.yaml +++ b/.github/workflows/experiment-with-gradle-profiler.yaml @@ -31,6 +31,15 @@ on: required: false type: boolean default: true + configuration_cache: + description: "Gradle configuration cache behavior" + type: choice + required: false + default: 'off' + options: + - 'off' + - 'on' + - 'warn' os_args: description: "Operating system configurations for variants" type: string @@ -91,6 +100,7 @@ jobs: experiment-id: "profiler-${{ github.repository_owner }}-${{ github.run_number }}" variant: ${{ matrix.config.variant }} class: ${{ github.event.inputs.class }} + configuration-cache: "${{ github.event.inputs.configuration_cache }}" cache-url: ${{ secrets.CI_URL_CACHE_NODE }} warmups: 1 clean-between-iterations: ${{ github.event.inputs.clean_between_iterations }} diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index a4c17ad..6100cb6 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -41,6 +41,15 @@ on: - 'remote task cache - transforms cache' - 'remote task cache + dependencies cache - transforms cache' - 'dependencies cache - javaCompile cache' + configuration_cache: + description: "Gradle configuration cache behavior" + type: choice + required: true + default: 'off' + options: + - 'off' + - 'on' + - 'warn' os_args: description: "Operating system configurations for variants" type: string @@ -112,6 +121,8 @@ jobs: cache-exclude-script: "${{ env.cache_exclude_content }}" task: "${{ github.event.inputs.task }}" mode: "${{ github.event.inputs.mode }}" + configuration-cache: "${{ github.event.inputs.configuration_cache }}" + configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" experiment-id: "${{ github.run_number }}" variant: ${{ matrix.config.variant }} api-key: ${{ secrets.DV_ACCESS_KEY }} @@ -148,6 +159,8 @@ jobs: with: task: "${{ github.event.inputs.task }}" mode: "${{ github.event.inputs.mode }}" + configuration-cache: "${{ github.event.inputs.configuration_cache }}" + configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" execution-number: ${{ github.run_number }} variant: ${{ matrix.config.variant }} @@ -183,6 +196,8 @@ jobs: with: task: "${{ github.event.inputs.task }}" mode: "${{ github.event.inputs.mode }}" + configuration-cache: "${{ github.event.inputs.configuration_cache }}" + configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" execution-number: ${{ github.run_number }} variant: ${{ matrix.config.variant }} diff --git a/.github/workflows/runner-gradle-profiler/action.yaml b/.github/workflows/runner-gradle-profiler/action.yaml index 64a25e4..65a47fb 100644 --- a/.github/workflows/runner-gradle-profiler/action.yaml +++ b/.github/workflows/runner-gradle-profiler/action.yaml @@ -42,6 +42,10 @@ inputs: extra-args: description: 'Extra arguments to pass to the Gradle command' required: true + configuration-cache: + description: 'Gradle configuration cache behavior: off, on, or warn.' + required: false + default: 'off' cache-url: description: 'URL for the cache node, if applicable' required: true @@ -90,6 +94,28 @@ runs: EXTRA_ARG="${{ inputs.extra-args }}" fi + case "${{ inputs.configuration-cache }}" in + "off"|"") + CONFIGURATION_CACHE_ARGS=() + ;; + "on") + CONFIGURATION_CACHE_ARGS=("--configuration-cache") + ;; + "warn") + CONFIGURATION_CACHE_ARGS=("--configuration-cache" "--configuration-cache-problems=warn") + ;; + *) + echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}" + exit 1 + ;; + esac + + GRADLE_ARGS="[\"$EXTRA_ARG\"" + for ARG in "${CONFIGURATION_CACHE_ARGS[@]}"; do + GRADLE_ARGS="$GRADLE_ARGS, \"$ARG\"" + done + GRADLE_ARGS="$GRADLE_ARGS, \"-Dscan.tag.${{ inputs.experiment-id }}_${{ inputs.variant-prefix }}${{ inputs.variant }}\", \"-Dscan.tag.experiment\", \"-Dscan.tag.${{ inputs.experiment-id }}\"]" + # Gradle Profiler: cleanup-tasks run between iterations; [] = incremental re-runs if [ "${{ inputs.clean-between-iterations }}" = "true" ]; then CLEANUP_TASKS='["clean"]' @@ -103,7 +129,7 @@ runs: title = \"assemble\" tasks = [\"${{ inputs.task }}\"] cleanup-tasks = $CLEANUP_TASKS - gradle-args = [\"$EXTRA_ARG\", \"-Dscan.tag.${{ inputs.experiment-id }}_${{ inputs.variant-prefix }}${{ inputs.variant }}\", \"-Dscan.tag.experiment\", \"-Dscan.tag.${{ inputs.experiment-id }}\"] + gradle-args = $GRADLE_ARGS }" > scenario else echo "assemble { @@ -111,7 +137,7 @@ runs: tasks = [\"${{ inputs.task }}\"] cleanup-tasks = $CLEANUP_TASKS apply-abi-change-to = [${{ inputs.class }}] - gradle-args = [\"$EXTRA_ARG\", \"-Dscan.tag.${{ inputs.experiment-id }}_${{ inputs.variant-prefix }}${{ inputs.variant }}\", \"-Dscan.tag.experiment\", \"-Dscan.tag.${{ inputs.experiment-id }}\"] + gradle-args = $GRADLE_ARGS }" > scenario fi diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 03eedec..53ae065 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -31,6 +31,13 @@ inputs: mode: description: 'Mode of execution relative to caching.' required: true + configuration-cache: + description: 'Gradle configuration cache behavior: off, on, or warn.' + required: false + default: 'off' + configuration-cache-key: + description: 'Cache key used to save the project configuration cache.' + required: false extra-args: description: 'Extra arguments to pass to the Gradle command.' required: true @@ -130,10 +137,30 @@ runs: remote_monitoring: 'true' export_to_bigquery: 'true' + - name: Set Configuration Cache Arguments + id: configuration-cache-args + run: | + case "${{ inputs.configuration-cache }}" in + "off"|"") + echo "args=" >> "$GITHUB_OUTPUT" + ;; + "on") + echo "args=--configuration-cache" >> "$GITHUB_OUTPUT" + ;; + "warn") + echo "args=--configuration-cache --configuration-cache-problems=warn" >> "$GITHUB_OUTPUT" + ;; + *) + echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}" + exit 1 + ;; + esac + shell: bash + - name: Execute Gradle Build id: gradle-build run: | - ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} \ + ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} ${{ steps.configuration-cache-args.outputs.args }} \ -Dscan.tag.seed_${{ inputs.variant-prefix }}${{ inputs.variant }} \ -Dscan.tag.seed-"${{ inputs.mode }}" \ -Dscan.tag.seed \ @@ -143,5 +170,12 @@ runs: DEVELOCITY_ACCESS_KEY: ${{ inputs.api-key }} CI_URL_CACHE_NODE: ${{ inputs.cache-url }} + - name: Save Configuration Cache + if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' + uses: actions/cache/save@v4 + with: + path: .gradle/configuration-cache + key: ${{ inputs.configuration-cache-key }} + - name: Finalize Step uses: actions/checkout@v4 diff --git a/.github/workflows/runner/action.yaml b/.github/workflows/runner/action.yaml index 90c3562..5d98c2d 100644 --- a/.github/workflows/runner/action.yaml +++ b/.github/workflows/runner/action.yaml @@ -33,6 +33,13 @@ inputs: mode: description: 'Mode of execution relative to caching' required: true + configuration-cache: + description: 'Gradle configuration cache behavior: off, on, or warn.' + required: false + default: 'off' + configuration-cache-key: + description: 'Cache key used to restore the seeded project configuration cache.' + required: false extra-args: description: 'Extra arguments to pass to the Gradle command' required: true @@ -69,14 +76,43 @@ runs: GRADLE_BUILD_ACTION_CACHE_KEY_JOB: 'seed' GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.execution-number }}-${{ inputs.variant }} + - name: Restore Configuration Cache + if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' + uses: actions/cache/restore@v4 + with: + path: .gradle/configuration-cache + key: ${{ inputs.configuration-cache-key }} + fail-on-cache-miss: false + - uses: cdsap/build-process-watcher@v0.6.2 with: remote_monitoring: 'true' export_to_bigquery: 'true' + + - name: Set Configuration Cache Arguments + id: configuration-cache-args + run: | + case "${{ inputs.configuration-cache }}" in + "off"|"") + echo "args=" >> "$GITHUB_OUTPUT" + ;; + "on") + echo "args=--configuration-cache" >> "$GITHUB_OUTPUT" + ;; + "warn") + echo "args=--configuration-cache --configuration-cache-problems=warn" >> "$GITHUB_OUTPUT" + ;; + *) + echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}" + exit 1 + ;; + esac + shell: bash + - name: Execute Gradle Build id: gradle-build run: | - ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} \ + ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} ${{ steps.configuration-cache-args.outputs.args }} \ -Dscan.tag.${{ inputs.experiment-id }}_${{ inputs.variant-prefix }}${{ inputs.variant }} \ -Dscan.tag."${{ inputs.mode }}" \ -Dscan.tag.experiment \ diff --git a/README.md b/README.md index 55e8b51..65dc7f5 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,16 @@ This workflow executes Gradle tasks across two specified variants (branches) wit - `remote task cache + dependencies cache`: Combines remote task caching with dependency caching. - `remote task cache - transforms cache`: Caches task outputs remotely, excluding transforms cache. - `remote task cache + dependencies cache - transforms cache`: Combines remote task, dependency caching, and excludes transforms. - + + - `configuration_cache`: + - **Description**: Controls Gradle configuration cache usage independently of the selected task/dependency cache mode. In the standard experiment workflow, the seed job saves `.gradle/configuration-cache` with a variant-specific key and execution jobs restore that entry before running. In the Gradle Profiler workflow, the option is added to the generated scenario so profiler warmups and iterations can reuse the configuration cache in the same checkout. + - **Type**: `choice` + - **Default**: `off` + - **Options**: + - `off`: Do not pass configuration-cache arguments. + - `on`: Pass `--configuration-cache`. + - `warn`: Pass `--configuration-cache --configuration-cache-problems=warn`. + - `os_args`: - **Description**: Defines the operating system settings for each variant, specifying which OS image to use during workflow execution. This is useful for testing builds across different environments. - **Type**: `string` @@ -127,6 +136,12 @@ Instead of using agents based on experiment iterations, the Gradle Profiler expe - **Description**: Number of iterations for the experiment. - **Required**: `false` - **Default**: `5` + - `configuration_cache`: + - **Description**: Controls Gradle configuration cache usage for the generated Gradle Profiler scenario. Use `on` for strict configuration-cache execution, or `warn` while evaluating projects with remaining incompatibilities. + - **Type**: `choice` + - **Required**: `false` + - **Default**: `off` + - **Options**: `off`, `on`, `warn` - `os_args`: - **Description**: Operating system configurations for variants. - **Type**: `string` diff --git a/docs/actions-inputs.md b/docs/actions-inputs.md index 626b1b8..7e77d42 100644 --- a/docs/actions-inputs.md +++ b/docs/actions-inputs.md @@ -40,6 +40,15 @@ This section details the inputs for the primary dispatchable workflows: `experim - Description: A JSON string to configure report generation. See the "Extra Report Arguments (`extra_report_args`)" section under "JSON Format Examples" for details on the keys. - `experiment.yaml`: Required: `true`. Default: `"{deploy_results:'false',experiment_title:'', open_ai_request:'true', report_enabled:'true',tasktype_report:'true',taskpath_report:'true',kotlin_build_report:'false',process_report:'false',resource_usage_report:'true',gc_report:'false',only_cacheable_outcome:'false',threshold_task_duration:'1000'}"`. - `experiment-with-gradle-profiler.yaml`: Required: `false`. Default: `"{deploy_results:'false',experiment_title:'',open_ai_request:'true',report_enabled:'true',tasktype_report:'true',taskpath_report:'true',kotlin_build_report:'false',process_report:'false',resource_usage_report:'true',gc_report:'false',only_cacheable_outcome:'false',threshold_task_duration:'1000'}"`. +- **`configuration_cache`**: + - Description: Controls Gradle configuration cache usage independently of the selected task/dependency cache mode. + - `experiment.yaml`: Required: `true`. Default: `'off'`. + - `experiment-with-gradle-profiler.yaml`: Required: `false`. Default: `'off'`. + - Options: + - `'off'`: Do not pass configuration-cache arguments. + - `'on'`: Pass `--configuration-cache`. + - `'warn'`: Pass `--configuration-cache --configuration-cache-problems=warn`. + - Reuse behavior: `experiment.yaml` saves `.gradle/configuration-cache` from each seed job and restores the matching variant entry in execution jobs. `experiment-with-gradle-profiler.yaml` adds the selected arguments to the generated scenario so profiler warmups and iterations can reuse configuration in the same checkout. **Inputs Specific to `experiment.yaml`:** @@ -64,6 +73,7 @@ This section details the inputs for the primary dispatchable workflows: `experim - `'remote task cache + dependencies cache'` - `'remote task cache - transforms cache'` - `'remote task cache + dependencies cache - transforms cache'` + - `'dependencies cache - javaCompile cache'` **Inputs Specific to `experiment-with-gradle-profiler.yaml`:** @@ -169,6 +179,21 @@ This section describes the inputs for the reusable `report/action.yaml` workflow - Required: `true` (conditionally, if deploying). - Default: `""`. +## Reusable Workflow: Seed Runner Action (`.github/workflows/runner-seed/action.yaml`) + +This section lists the seed-action inputs that differ from or extend the standard runner. Other runner inputs such as `task`, `variant`, `repository`, `jdk_version`, `jdk_vendor`, `mode`, `extra-args`, and `cache-url` follow the same meaning as `runner/action.yaml`. + +- **`configuration-cache`**: + - Description: Gradle configuration cache behavior for the seed run (`off`, `on`, or `warn`). + - Required: `false`. + - Default: `off`. +- **`configuration-cache-key`**: + - Description: Variant-specific key used to save `.gradle/configuration-cache` for execution jobs. + - Required: `false`. +- **`cache-exclude-script`**: + - Description: Optional script content for excluding specific Gradle User Home cache entries. + - Required: `false`. + ## Reusable Workflow: Runner Action (`.github/workflows/runner/action.yaml`) This section details inputs for the reusable `runner/action.yaml` workflow, which executes a single Gradle build iteration for the standard experiment. @@ -205,6 +230,13 @@ This section details inputs for the reusable `runner/action.yaml` workflow, whic - **`mode`**: - Description: Specifies the caching mode for this run (e.g., `no caching`, `local task cache`). - Required: `true`. +- **`configuration-cache`**: + - Description: Gradle configuration cache behavior for the run (`off`, `on`, or `warn`). + - Required: `false`. + - Default: `off`. +- **`configuration-cache-key`**: + - Description: Variant-specific key used to restore the configuration cache saved by the seed job. + - Required: `false`. - **`extra-args`**: - Description: Any additional arguments to pass to the Gradle command. - Required: `true`. @@ -260,6 +292,10 @@ This section describes inputs for the reusable `runner-gradle-profiler/action.ya - **`extra-args`**: - Description: Any additional arguments to pass to the Gradle command. - Required: `true`. +- **`configuration-cache`**: + - Description: Gradle configuration cache behavior for the generated scenario (`off`, `on`, or `warn`). + - Required: `false`. + - Default: `off`. - **`cache-url`**: - Description: URL of the remote build cache node, if used. - Required: `true`. @@ -313,4 +349,4 @@ This JSON string configures various aspects of the reporting process. The exampl "only_cacheable_outcome": "false", "threshold_task_duration": "1000" } -``` \ No newline at end of file +``` From 74e38ed4759d62f03cb4edaaea33882c47a97089 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 7 Aug 2026 10:45:24 -0700 Subject: [PATCH 02/16] Cache included build outputs for configuration cache --- .github/workflows/experiment.yaml | 7 ++++++ .github/workflows/runner-seed/action.yaml | 26 ++++++++++++++++++++++- .github/workflows/runner/action.yaml | 26 ++++++++++++++++++++++- README.md | 6 +++++- docs/actions-inputs.md | 12 +++++++++++ 5 files changed, 74 insertions(+), 3 deletions(-) diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index 6100cb6..3b2448b 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -50,6 +50,10 @@ on: - 'off' - 'on' - 'warn' + configuration_cache_included_builds: + description: "Comma-separated included build paths whose build outputs should be saved with the configuration cache" + required: false + default: "buildSrc,build-logic" os_args: description: "Operating system configurations for variants" type: string @@ -123,6 +127,7 @@ jobs: mode: "${{ github.event.inputs.mode }}" configuration-cache: "${{ github.event.inputs.configuration_cache }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" + configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" experiment-id: "${{ github.run_number }}" variant: ${{ matrix.config.variant }} api-key: ${{ secrets.DV_ACCESS_KEY }} @@ -161,6 +166,7 @@ jobs: mode: "${{ github.event.inputs.mode }}" configuration-cache: "${{ github.event.inputs.configuration_cache }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" + configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" execution-number: ${{ github.run_number }} variant: ${{ matrix.config.variant }} @@ -198,6 +204,7 @@ jobs: mode: "${{ github.event.inputs.mode }}" configuration-cache: "${{ github.event.inputs.configuration_cache }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" + configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" execution-number: ${{ github.run_number }} variant: ${{ matrix.config.variant }} diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 53ae065..546d402 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -38,6 +38,10 @@ inputs: configuration-cache-key: description: 'Cache key used to save the project configuration cache.' required: false + configuration-cache-included-builds: + description: 'Comma-separated included build paths whose build outputs are required by the configuration cache.' + required: false + default: 'buildSrc,build-logic' extra-args: description: 'Extra arguments to pass to the Gradle command.' required: true @@ -157,6 +161,26 @@ runs: esac shell: bash + - name: Set Configuration Cache Paths + id: configuration-cache-paths + if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' + run: | + { + echo "paths<> "$GITHUB_OUTPUT" + shell: bash + - name: Execute Gradle Build id: gradle-build run: | @@ -174,7 +198,7 @@ runs: if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' uses: actions/cache/save@v4 with: - path: .gradle/configuration-cache + path: ${{ steps.configuration-cache-paths.outputs.paths }} key: ${{ inputs.configuration-cache-key }} - name: Finalize Step diff --git a/.github/workflows/runner/action.yaml b/.github/workflows/runner/action.yaml index 5d98c2d..a0f372c 100644 --- a/.github/workflows/runner/action.yaml +++ b/.github/workflows/runner/action.yaml @@ -40,6 +40,10 @@ inputs: configuration-cache-key: description: 'Cache key used to restore the seeded project configuration cache.' required: false + configuration-cache-included-builds: + description: 'Comma-separated included build paths whose build outputs are required by the configuration cache.' + required: false + default: 'buildSrc,build-logic' extra-args: description: 'Extra arguments to pass to the Gradle command' required: true @@ -76,11 +80,31 @@ runs: GRADLE_BUILD_ACTION_CACHE_KEY_JOB: 'seed' GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.execution-number }}-${{ inputs.variant }} + - name: Set Configuration Cache Paths + id: configuration-cache-paths + if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' + run: | + { + echo "paths<> "$GITHUB_OUTPUT" + shell: bash + - name: Restore Configuration Cache if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' uses: actions/cache/restore@v4 with: - path: .gradle/configuration-cache + path: ${{ steps.configuration-cache-paths.outputs.paths }} key: ${{ inputs.configuration-cache-key }} fail-on-cache-miss: false diff --git a/README.md b/README.md index 65dc7f5..516d714 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ This workflow executes Gradle tasks across two specified variants (branches) wit - `remote task cache + dependencies cache - transforms cache`: Combines remote task, dependency caching, and excludes transforms. - `configuration_cache`: - - **Description**: Controls Gradle configuration cache usage independently of the selected task/dependency cache mode. In the standard experiment workflow, the seed job saves `.gradle/configuration-cache` with a variant-specific key and execution jobs restore that entry before running. In the Gradle Profiler workflow, the option is added to the generated scenario so profiler warmups and iterations can reuse the configuration cache in the same checkout. + - **Description**: Controls Gradle configuration cache usage independently of the selected task/dependency cache mode. In the standard experiment workflow, the seed job saves `.gradle/configuration-cache` plus configured included-build outputs with a variant-specific key and execution jobs restore that entry before running. In the Gradle Profiler workflow, the option is added to the generated scenario so profiler warmups and iterations can reuse the configuration cache in the same checkout. - **Type**: `choice` - **Default**: `off` - **Options**: @@ -71,6 +71,10 @@ This workflow executes Gradle tasks across two specified variants (branches) wit - `on`: Pass `--configuration-cache`. - `warn`: Pass `--configuration-cache --configuration-cache-problems=warn`. + - `configuration_cache_included_builds`: + - **Description**: Comma-separated included build paths whose `build` directories are saved and restored with the configuration cache. This is needed when a restored configuration-cache entry references compiled included-build outputs, such as `build-logic/build`. + - **Default**: `buildSrc,build-logic` + - `os_args`: - **Description**: Defines the operating system settings for each variant, specifying which OS image to use during workflow execution. This is useful for testing builds across different environments. - **Type**: `string` diff --git a/docs/actions-inputs.md b/docs/actions-inputs.md index 7e77d42..d5f8335 100644 --- a/docs/actions-inputs.md +++ b/docs/actions-inputs.md @@ -49,6 +49,10 @@ This section details the inputs for the primary dispatchable workflows: `experim - `'on'`: Pass `--configuration-cache`. - `'warn'`: Pass `--configuration-cache --configuration-cache-problems=warn`. - Reuse behavior: `experiment.yaml` saves `.gradle/configuration-cache` from each seed job and restores the matching variant entry in execution jobs. `experiment-with-gradle-profiler.yaml` adds the selected arguments to the generated scenario so profiler warmups and iterations can reuse configuration in the same checkout. +- **`configuration_cache_included_builds`**: + - Description: Comma-separated included build paths whose build output directories must be saved and restored with the configuration cache. + - `experiment.yaml`: Required: `false`. Default: `"buildSrc,build-logic"`. + - Reuse behavior: Each listed path contributes its `build` directory, for example `build-logic` adds `build-logic/build`. This preserves included-build classpath outputs referenced by restored configuration-cache entries. **Inputs Specific to `experiment.yaml`:** @@ -190,6 +194,10 @@ This section lists the seed-action inputs that differ from or extend the standar - **`configuration-cache-key`**: - Description: Variant-specific key used to save `.gradle/configuration-cache` for execution jobs. - Required: `false`. +- **`configuration-cache-included-builds`**: + - Description: Comma-separated included build paths whose `build` directories are saved with the configuration cache. + - Required: `false`. + - Default: `buildSrc,build-logic`. - **`cache-exclude-script`**: - Description: Optional script content for excluding specific Gradle User Home cache entries. - Required: `false`. @@ -237,6 +245,10 @@ This section details inputs for the reusable `runner/action.yaml` workflow, whic - **`configuration-cache-key`**: - Description: Variant-specific key used to restore the configuration cache saved by the seed job. - Required: `false`. +- **`configuration-cache-included-builds`**: + - Description: Comma-separated included build paths whose `build` directories are restored with the configuration cache. + - Required: `false`. + - Default: `buildSrc,build-logic`. - **`extra-args`**: - Description: Any additional arguments to pass to the Gradle command. - Required: `true`. From 4a4a1d1f2c9ae2971033298fac89560dace9a384 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 7 Aug 2026 10:53:16 -0700 Subject: [PATCH 03/16] Include nested build logic outputs in configuration cache --- .github/workflows/experiment.yaml | 2 +- .github/workflows/runner-seed/action.yaml | 2 +- .github/workflows/runner/action.yaml | 2 +- README.md | 4 ++-- docs/actions-inputs.md | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index 3b2448b..fb14485 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -53,7 +53,7 @@ on: configuration_cache_included_builds: description: "Comma-separated included build paths whose build outputs should be saved with the configuration cache" required: false - default: "buildSrc,build-logic" + default: "buildSrc,build-logic,build-logic/*" os_args: description: "Operating system configurations for variants" type: string diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 546d402..7bafe35 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -41,7 +41,7 @@ inputs: configuration-cache-included-builds: description: 'Comma-separated included build paths whose build outputs are required by the configuration cache.' required: false - default: 'buildSrc,build-logic' + default: 'buildSrc,build-logic,build-logic/*' extra-args: description: 'Extra arguments to pass to the Gradle command.' required: true diff --git a/.github/workflows/runner/action.yaml b/.github/workflows/runner/action.yaml index a0f372c..899f556 100644 --- a/.github/workflows/runner/action.yaml +++ b/.github/workflows/runner/action.yaml @@ -43,7 +43,7 @@ inputs: configuration-cache-included-builds: description: 'Comma-separated included build paths whose build outputs are required by the configuration cache.' required: false - default: 'buildSrc,build-logic' + default: 'buildSrc,build-logic,build-logic/*' extra-args: description: 'Extra arguments to pass to the Gradle command' required: true diff --git a/README.md b/README.md index 516d714..4c7e5bc 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ This workflow executes Gradle tasks across two specified variants (branches) wit - `warn`: Pass `--configuration-cache --configuration-cache-problems=warn`. - `configuration_cache_included_builds`: - - **Description**: Comma-separated included build paths whose `build` directories are saved and restored with the configuration cache. This is needed when a restored configuration-cache entry references compiled included-build outputs, such as `build-logic/build`. - - **Default**: `buildSrc,build-logic` + - **Description**: Comma-separated included build paths whose `build` directories are saved and restored with the configuration cache. This is needed when a restored configuration-cache entry references compiled included-build outputs, such as `build-logic/build` or `build-logic/convention/build`. + - **Default**: `buildSrc,build-logic,build-logic/*` - `os_args`: - **Description**: Defines the operating system settings for each variant, specifying which OS image to use during workflow execution. This is useful for testing builds across different environments. diff --git a/docs/actions-inputs.md b/docs/actions-inputs.md index d5f8335..3c9ff09 100644 --- a/docs/actions-inputs.md +++ b/docs/actions-inputs.md @@ -51,8 +51,8 @@ This section details the inputs for the primary dispatchable workflows: `experim - Reuse behavior: `experiment.yaml` saves `.gradle/configuration-cache` from each seed job and restores the matching variant entry in execution jobs. `experiment-with-gradle-profiler.yaml` adds the selected arguments to the generated scenario so profiler warmups and iterations can reuse configuration in the same checkout. - **`configuration_cache_included_builds`**: - Description: Comma-separated included build paths whose build output directories must be saved and restored with the configuration cache. - - `experiment.yaml`: Required: `false`. Default: `"buildSrc,build-logic"`. - - Reuse behavior: Each listed path contributes its `build` directory, for example `build-logic` adds `build-logic/build`. This preserves included-build classpath outputs referenced by restored configuration-cache entries. + - `experiment.yaml`: Required: `false`. Default: `"buildSrc,build-logic,build-logic/*"`. + - Reuse behavior: Each listed path contributes its `build` directory, for example `build-logic` adds `build-logic/build` and `build-logic/*` adds one-level nested outputs such as `build-logic/convention/build`. This preserves included-build classpath outputs referenced by restored configuration-cache entries. **Inputs Specific to `experiment.yaml`:** @@ -197,7 +197,7 @@ This section lists the seed-action inputs that differ from or extend the standar - **`configuration-cache-included-builds`**: - Description: Comma-separated included build paths whose `build` directories are saved with the configuration cache. - Required: `false`. - - Default: `buildSrc,build-logic`. + - Default: `buildSrc,build-logic,build-logic/*`. - **`cache-exclude-script`**: - Description: Optional script content for excluding specific Gradle User Home cache entries. - Required: `false`. @@ -248,7 +248,7 @@ This section details inputs for the reusable `runner/action.yaml` workflow, whic - **`configuration-cache-included-builds`**: - Description: Comma-separated included build paths whose `build` directories are restored with the configuration cache. - Required: `false`. - - Default: `buildSrc,build-logic`. + - Default: `buildSrc,build-logic,build-logic/*`. - **`extra-args`**: - Description: Any additional arguments to pass to the Gradle command. - Required: `true`. From 72f67d703a4b43b55e631d924cd8c31999abbc3d Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 8 Aug 2026 16:03:29 -0700 Subject: [PATCH 04/16] Prime configuration cache with execution parameters --- .github/workflows/experiment.yaml | 2 +- .github/workflows/runner-seed/action.yaml | 16 +++++++++++++++- README.md | 2 +- docs/actions-inputs.md | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index fb14485..19e5940 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -128,7 +128,7 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" - experiment-id: "${{ github.run_number }}" + experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" variant: ${{ matrix.config.variant }} api-key: ${{ secrets.DV_ACCESS_KEY }} repository: ${{ github.event.inputs.repository }} diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 7bafe35..b42b28c 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -184,7 +184,7 @@ runs: - name: Execute Gradle Build id: gradle-build run: | - ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} ${{ steps.configuration-cache-args.outputs.args }} \ + ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} \ -Dscan.tag.seed_${{ inputs.variant-prefix }}${{ inputs.variant }} \ -Dscan.tag.seed-"${{ inputs.mode }}" \ -Dscan.tag.seed \ @@ -194,6 +194,20 @@ runs: DEVELOCITY_ACCESS_KEY: ${{ inputs.api-key }} CI_URL_CACHE_NODE: ${{ inputs.cache-url }} + - name: Prime Configuration Cache + id: prime-configuration-cache + if: inputs.configuration-cache != 'off' + run: | + ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} ${{ steps.configuration-cache-args.outputs.args }} \ + -Dscan.tag.${{ inputs.experiment-id }}_${{ inputs.variant-prefix }}${{ inputs.variant }} \ + -Dscan.tag."${{ inputs.mode }}" \ + -Dscan.tag.experiment \ + -Dscan.tag.${{ inputs.experiment-id }} + shell: bash + env: + DEVELOCITY_ACCESS_KEY: ${{ inputs.api-key }} + CI_URL_CACHE_NODE: ${{ inputs.cache-url }} + - name: Save Configuration Cache if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' uses: actions/cache/save@v4 diff --git a/README.md b/README.md index 4c7e5bc..d02c0c2 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ This workflow executes Gradle tasks across two specified variants (branches) wit - `remote task cache + dependencies cache - transforms cache`: Combines remote task, dependency caching, and excludes transforms. - `configuration_cache`: - - **Description**: Controls Gradle configuration cache usage independently of the selected task/dependency cache mode. In the standard experiment workflow, the seed job saves `.gradle/configuration-cache` plus configured included-build outputs with a variant-specific key and execution jobs restore that entry before running. In the Gradle Profiler workflow, the option is added to the generated scenario so profiler warmups and iterations can reuse the configuration cache in the same checkout. + - **Description**: Controls Gradle configuration cache usage independently of the selected task/dependency cache mode. In the standard experiment workflow, the seed job primes `.gradle/configuration-cache` with the same Gradle start parameters used by execution jobs, then saves it plus configured included-build outputs with a variant-specific key. Execution jobs restore that entry before running. In the Gradle Profiler workflow, the option is added to the generated scenario so profiler warmups and iterations can reuse the configuration cache in the same checkout. - **Type**: `choice` - **Default**: `off` - **Options**: diff --git a/docs/actions-inputs.md b/docs/actions-inputs.md index 3c9ff09..28d585d 100644 --- a/docs/actions-inputs.md +++ b/docs/actions-inputs.md @@ -48,7 +48,7 @@ This section details the inputs for the primary dispatchable workflows: `experim - `'off'`: Do not pass configuration-cache arguments. - `'on'`: Pass `--configuration-cache`. - `'warn'`: Pass `--configuration-cache --configuration-cache-problems=warn`. - - Reuse behavior: `experiment.yaml` saves `.gradle/configuration-cache` from each seed job and restores the matching variant entry in execution jobs. `experiment-with-gradle-profiler.yaml` adds the selected arguments to the generated scenario so profiler warmups and iterations can reuse configuration in the same checkout. + - Reuse behavior: `experiment.yaml` primes `.gradle/configuration-cache` in each seed job with the same Gradle start parameters used by execution jobs, then restores the matching variant entry in execution jobs. `experiment-with-gradle-profiler.yaml` adds the selected arguments to the generated scenario so profiler warmups and iterations can reuse configuration in the same checkout. - **`configuration_cache_included_builds`**: - Description: Comma-separated included build paths whose build output directories must be saved and restored with the configuration cache. - `experiment.yaml`: Required: `false`. Default: `"buildSrc,build-logic,build-logic/*"`. From 8c85216a916262abf7a151cfb577fe3a7e6d9ce7 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 8 Aug 2026 16:31:27 -0700 Subject: [PATCH 05/16] Align configuration cache seed environment --- .github/workflows/experiment.yaml | 4 ++-- .github/workflows/runner-seed/action.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index 19e5940..29ab3d2 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -168,7 +168,7 @@ jobs: configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" - execution-number: ${{ github.run_number }} + execution-number: ${{ github.repository_owner }}-${{ github.run_number }} variant: ${{ matrix.config.variant }} api-key: ${{ secrets.DV_ACCESS_KEY }} cache-excludes: ${{ steps.seed.outputs.cache-excludes }} @@ -206,7 +206,7 @@ jobs: configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" - execution-number: ${{ github.run_number }} + execution-number: ${{ github.repository_owner }}-${{ github.run_number }} variant: ${{ matrix.config.variant }} api-key: ${{ secrets.DV_ACCESS_KEY }} repository: ${{ github.event.inputs.repository }} diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index b42b28c..6fa8c63 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -192,6 +192,7 @@ runs: shell: bash env: DEVELOCITY_ACCESS_KEY: ${{ inputs.api-key }} + GRADLE_BUILD_ACTION_CACHE_KEY_JOB: 'seed' CI_URL_CACHE_NODE: ${{ inputs.cache-url }} - name: Prime Configuration Cache From 2abb76f2efbfd8dd50e673aa3dafc57bcefae92b Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 8 Aug 2026 19:23:03 -0700 Subject: [PATCH 06/16] Expand included build cache paths --- .github/workflows/runner-seed/action.yaml | 15 ++++++++++++++- .github/workflows/runner/action.yaml | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 6fa8c63..4c21e13 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -172,7 +172,20 @@ runs: IFS=',' read -ra INCLUDED_BUILDS <<< "${{ inputs.configuration-cache-included-builds }}" for included_build in "${INCLUDED_BUILDS[@]}"; do included_build="$(printf '%s' "$included_build" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" - if [ -n "$included_build" ]; then + if [ -z "$included_build" ]; then + continue + fi + + if [[ "$included_build" == */\* ]]; then + parent="${included_build%/*}" + if [ -d "$parent" ]; then + for child in "$parent"/*; do + if [ -d "$child" ]; then + echo "$child/build" + fi + done + fi + else echo "$included_build/build" fi done diff --git a/.github/workflows/runner/action.yaml b/.github/workflows/runner/action.yaml index 899f556..9caa461 100644 --- a/.github/workflows/runner/action.yaml +++ b/.github/workflows/runner/action.yaml @@ -91,7 +91,20 @@ runs: IFS=',' read -ra INCLUDED_BUILDS <<< "${{ inputs.configuration-cache-included-builds }}" for included_build in "${INCLUDED_BUILDS[@]}"; do included_build="$(printf '%s' "$included_build" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" - if [ -n "$included_build" ]; then + if [ -z "$included_build" ]; then + continue + fi + + if [[ "$included_build" == */\* ]]; then + parent="${included_build%/*}" + if [ -d "$parent" ]; then + for child in "$parent"/*; do + if [ -d "$child" ]; then + echo "$child/build" + fi + done + fi + else echo "$included_build/build" fi done From e95b78f639434316841f071af3620e188b977717 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 8 Aug 2026 19:58:24 -0700 Subject: [PATCH 07/16] Remove generated init scripts for configuration cache --- .github/workflows/runner-seed/action.yaml | 8 ++++++++ .github/workflows/runner/action.yaml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 4c21e13..8a4cf25 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -136,6 +136,14 @@ runs: env: GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.experiment-id }}-${{ inputs.variant }} + - name: Disable Gradle Action Init Scripts for Configuration Cache + if: inputs.configuration-cache != 'off' + run: | + if [ -n "${GRADLE_USER_HOME:-}" ] && [ -d "$GRADLE_USER_HOME/init.d" ]; then + find "$GRADLE_USER_HOME/init.d" -maxdepth 1 -type f -name 'gradle-actions*.init.gradle' -delete + fi + shell: bash + - uses: cdsap/build-process-watcher@v0.6.2 with: remote_monitoring: 'true' diff --git a/.github/workflows/runner/action.yaml b/.github/workflows/runner/action.yaml index 9caa461..190a9ac 100644 --- a/.github/workflows/runner/action.yaml +++ b/.github/workflows/runner/action.yaml @@ -80,6 +80,14 @@ runs: GRADLE_BUILD_ACTION_CACHE_KEY_JOB: 'seed' GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.execution-number }}-${{ inputs.variant }} + - name: Disable Gradle Action Init Scripts for Configuration Cache + if: inputs.configuration-cache != 'off' + run: | + if [ -n "${GRADLE_USER_HOME:-}" ] && [ -d "$GRADLE_USER_HOME/init.d" ]; then + find "$GRADLE_USER_HOME/init.d" -maxdepth 1 -type f -name 'gradle-actions*.init.gradle' -delete + fi + shell: bash + - name: Set Configuration Cache Paths id: configuration-cache-paths if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' From 589b93ed81895e3567f4cae285300a61a1cac1b6 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 8 Aug 2026 20:44:12 -0700 Subject: [PATCH 08/16] Match configuration cache prime environment --- .github/workflows/runner-seed/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 8a4cf25..47e5cd3 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -228,6 +228,7 @@ runs: shell: bash env: DEVELOCITY_ACCESS_KEY: ${{ inputs.api-key }} + GRADLE_BUILD_ACTION_CACHE_KEY_JOB: 'seed' CI_URL_CACHE_NODE: ${{ inputs.cache-url }} - name: Save Configuration Cache From 8d01648d444c36f8f9ee589cef9442d43e69aaee Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Mon, 10 Aug 2026 15:55:54 -0700 Subject: [PATCH 09/16] Restore Gradle configuration cache inputs --- .github/workflows/experiment.yaml | 3 +++ .github/workflows/runner-seed/action.yaml | 20 +++++++++++++---- .github/workflows/runner/action.yaml | 27 ++++++++++++++++------- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index 29ab3d2..1a57fbd 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -128,6 +128,7 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" + gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" variant: ${{ matrix.config.variant }} api-key: ${{ secrets.DV_ACCESS_KEY }} @@ -167,6 +168,7 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" + gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" execution-number: ${{ github.repository_owner }}-${{ github.run_number }} variant: ${{ matrix.config.variant }} @@ -205,6 +207,7 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" + gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" execution-number: ${{ github.repository_owner }}-${{ github.run_number }} variant: ${{ matrix.config.variant }} diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 47e5cd3..eed2500 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -42,6 +42,9 @@ inputs: description: 'Comma-separated included build paths whose build outputs are required by the configuration cache.' required: false default: 'buildSrc,build-logic,build-logic/*' + gradle-encryption-key: + description: 'Stable Gradle configuration cache encryption key shared by seed and execution jobs.' + required: false extra-args: description: 'Extra arguments to pass to the Gradle command.' required: true @@ -136,17 +139,20 @@ runs: env: GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.experiment-id }}-${{ inputs.variant }} - - name: Disable Gradle Action Init Scripts for Configuration Cache + - name: Validate Configuration Cache Encryption Key if: inputs.configuration-cache != 'off' run: | - if [ -n "${GRADLE_USER_HOME:-}" ] && [ -d "$GRADLE_USER_HOME/init.d" ]; then - find "$GRADLE_USER_HOME/init.d" -maxdepth 1 -type f -name 'gradle-actions*.init.gradle' -delete + if [ -z "$CHECK_GRADLE_ENCRYPTION_KEY" ]; then + echo "GRADLE_ENCRYPTION_KEY is required when configuration cache is enabled." + exit 1 fi shell: bash + env: + CHECK_GRADLE_ENCRYPTION_KEY: ${{ inputs.gradle-encryption-key }} - uses: cdsap/build-process-watcher@v0.6.2 with: - remote_monitoring: 'true' + remote_monitoring: 'true' export_to_bigquery: 'true' - name: Set Configuration Cache Arguments @@ -176,6 +182,10 @@ runs: { echo "paths<> "$GITHUB_OUTPUT" shell: bash + - uses: cdsap/build-process-watcher@v0.6.2 + with: + remote_monitoring: 'true' + export_to_bigquery: 'true' + - name: Restore Configuration Cache if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' uses: actions/cache/restore@v4 @@ -129,11 +144,6 @@ runs: key: ${{ inputs.configuration-cache-key }} fail-on-cache-miss: false - - uses: cdsap/build-process-watcher@v0.6.2 - with: - remote_monitoring: 'true' - export_to_bigquery: 'true' - - name: Set Configuration Cache Arguments id: configuration-cache-args run: | @@ -166,4 +176,5 @@ runs: env: DEVELOCITY_ACCESS_KEY: ${{ inputs.api-key }} GRADLE_BUILD_ACTION_CACHE_KEY_JOB: 'seed' + GRADLE_ENCRYPTION_KEY: ${{ inputs.gradle-encryption-key }} CI_URL_CACHE_NODE: ${{ inputs.cache-url }} From 60e72c64839a0ff05838510d8b3e1757cc58e4c1 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Mon, 10 Aug 2026 19:29:16 -0700 Subject: [PATCH 10/16] Add Gradle project isolation input --- .../experiment-with-gradle-profiler.yaml | 10 +++++ .github/workflows/experiment.yaml | 12 ++++++ .../runner-gradle-profiler/action.yaml | 23 +++++++++++ .github/workflows/runner-seed/action.yaml | 38 +++++++++++++++---- .github/workflows/runner/action.yaml | 34 ++++++++++++++--- 5 files changed, 105 insertions(+), 12 deletions(-) diff --git a/.github/workflows/experiment-with-gradle-profiler.yaml b/.github/workflows/experiment-with-gradle-profiler.yaml index f1dd64d..c17d04c 100644 --- a/.github/workflows/experiment-with-gradle-profiler.yaml +++ b/.github/workflows/experiment-with-gradle-profiler.yaml @@ -40,6 +40,15 @@ on: - 'off' - 'on' - 'warn' + project_isolation: + description: "Gradle Isolated Projects behavior" + type: choice + required: false + default: 'off' + options: + - 'off' + - 'on' + - 'diagnostics' os_args: description: "Operating system configurations for variants" type: string @@ -101,6 +110,7 @@ jobs: variant: ${{ matrix.config.variant }} class: ${{ github.event.inputs.class }} configuration-cache: "${{ github.event.inputs.configuration_cache }}" + project-isolation: "${{ github.event.inputs.project_isolation }}" cache-url: ${{ secrets.CI_URL_CACHE_NODE }} warmups: 1 clean-between-iterations: ${{ github.event.inputs.clean_between_iterations }} diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index 1a57fbd..26f2322 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -50,6 +50,15 @@ on: - 'off' - 'on' - 'warn' + project_isolation: + description: "Gradle Isolated Projects behavior" + type: choice + required: true + default: 'off' + options: + - 'off' + - 'on' + - 'diagnostics' configuration_cache_included_builds: description: "Comma-separated included build paths whose build outputs should be saved with the configuration cache" required: false @@ -126,6 +135,7 @@ jobs: task: "${{ github.event.inputs.task }}" mode: "${{ github.event.inputs.mode }}" configuration-cache: "${{ github.event.inputs.configuration_cache }}" + project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} @@ -166,6 +176,7 @@ jobs: task: "${{ github.event.inputs.task }}" mode: "${{ github.event.inputs.mode }}" configuration-cache: "${{ github.event.inputs.configuration_cache }}" + project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} @@ -205,6 +216,7 @@ jobs: task: "${{ github.event.inputs.task }}" mode: "${{ github.event.inputs.mode }}" configuration-cache: "${{ github.event.inputs.configuration_cache }}" + project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} diff --git a/.github/workflows/runner-gradle-profiler/action.yaml b/.github/workflows/runner-gradle-profiler/action.yaml index 65a47fb..d7484c2 100644 --- a/.github/workflows/runner-gradle-profiler/action.yaml +++ b/.github/workflows/runner-gradle-profiler/action.yaml @@ -46,6 +46,10 @@ inputs: description: 'Gradle configuration cache behavior: off, on, or warn.' required: false default: 'off' + project-isolation: + description: 'Gradle Isolated Projects behavior: off, on, or diagnostics.' + required: false + default: 'off' cache-url: description: 'URL for the cache node, if applicable' required: true @@ -110,10 +114,29 @@ runs: ;; esac + case "${{ inputs.project-isolation }}" in + "off"|"") + PROJECT_ISOLATION_ARGS=() + ;; + "on") + PROJECT_ISOLATION_ARGS=("-Dorg.gradle.unsafe.isolated-projects=true") + ;; + "diagnostics") + PROJECT_ISOLATION_ARGS=("-Dorg.gradle.unsafe.isolated-projects=true" "-Dorg.gradle.unsafe.isolated-projects.diagnostics=true") + ;; + *) + echo "Unknown project isolation option: ${{ inputs.project-isolation }}" + exit 1 + ;; + esac + GRADLE_ARGS="[\"$EXTRA_ARG\"" for ARG in "${CONFIGURATION_CACHE_ARGS[@]}"; do GRADLE_ARGS="$GRADLE_ARGS, \"$ARG\"" done + for ARG in "${PROJECT_ISOLATION_ARGS[@]}"; do + GRADLE_ARGS="$GRADLE_ARGS, \"$ARG\"" + done GRADLE_ARGS="$GRADLE_ARGS, \"-Dscan.tag.${{ inputs.experiment-id }}_${{ inputs.variant-prefix }}${{ inputs.variant }}\", \"-Dscan.tag.experiment\", \"-Dscan.tag.${{ inputs.experiment-id }}\"]" # Gradle Profiler: cleanup-tasks run between iterations; [] = incremental re-runs diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index eed2500..63a99f3 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -35,6 +35,10 @@ inputs: description: 'Gradle configuration cache behavior: off, on, or warn.' required: false default: 'off' + project-isolation: + description: 'Gradle Isolated Projects behavior: off, on, or diagnostics.' + required: false + default: 'off' configuration-cache-key: description: 'Cache key used to save the project configuration cache.' required: false @@ -140,10 +144,10 @@ runs: GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.experiment-id }}-${{ inputs.variant }} - name: Validate Configuration Cache Encryption Key - if: inputs.configuration-cache != 'off' + if: inputs.configuration-cache != 'off' || inputs.project-isolation != 'off' run: | if [ -z "$CHECK_GRADLE_ENCRYPTION_KEY" ]; then - echo "GRADLE_ENCRYPTION_KEY is required when configuration cache is enabled." + echo "GRADLE_ENCRYPTION_KEY is required when configuration cache or project isolation is enabled." exit 1 fi shell: bash @@ -175,9 +179,29 @@ runs: esac shell: bash + - name: Set Project Isolation Arguments + id: project-isolation-args + run: | + case "${{ inputs.project-isolation }}" in + "off"|"") + echo "args=" >> "$GITHUB_OUTPUT" + ;; + "on") + echo "args=-Dorg.gradle.unsafe.isolated-projects=true" >> "$GITHUB_OUTPUT" + ;; + "diagnostics") + echo "args=-Dorg.gradle.unsafe.isolated-projects=true -Dorg.gradle.unsafe.isolated-projects.diagnostics=true" >> "$GITHUB_OUTPUT" + ;; + *) + echo "Unknown project isolation option: ${{ inputs.project-isolation }}" + exit 1 + ;; + esac + shell: bash + - name: Set Configuration Cache Paths id: configuration-cache-paths - if: inputs.configuration-cache != 'off' && inputs.configuration-cache-key != '' + if: (inputs.configuration-cache != 'off' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' run: | { echo "paths<> "$GITHUB_OUTPUT" + ;; + "diagnostics") + echo "args=-Dorg.gradle.unsafe.isolated-projects=true -Dorg.gradle.unsafe.isolated-projects.diagnostics=true" >> "$GITHUB_OUTPUT" + ;; + *) + echo "Unknown project isolation option: ${{ inputs.project-isolation }}" + exit 1 + ;; + esac + shell: bash + - name: Execute Gradle Build id: gradle-build run: | - ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} ${{ steps.configuration-cache-args.outputs.args }} \ + ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} ${{ steps.configuration-cache-args.outputs.args }} ${{ steps.project-isolation-args.outputs.args }} \ -Dscan.tag.${{ inputs.experiment-id }}_${{ inputs.variant-prefix }}${{ inputs.variant }} \ -Dscan.tag."${{ inputs.mode }}" \ -Dscan.tag.experiment \ From b88315a23bbd7ea0d609ff9c7e95b58bf3e26e79 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 11 Aug 2026 10:06:01 -0700 Subject: [PATCH 11/16] Use Gradle isolated projects flag --- .github/workflows/runner-gradle-profiler/action.yaml | 4 ++-- .github/workflows/runner-seed/action.yaml | 4 ++-- .github/workflows/runner/action.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/runner-gradle-profiler/action.yaml b/.github/workflows/runner-gradle-profiler/action.yaml index d7484c2..cee5f00 100644 --- a/.github/workflows/runner-gradle-profiler/action.yaml +++ b/.github/workflows/runner-gradle-profiler/action.yaml @@ -119,10 +119,10 @@ runs: PROJECT_ISOLATION_ARGS=() ;; "on") - PROJECT_ISOLATION_ARGS=("-Dorg.gradle.unsafe.isolated-projects=true") + PROJECT_ISOLATION_ARGS=("--isolated-projects") ;; "diagnostics") - PROJECT_ISOLATION_ARGS=("-Dorg.gradle.unsafe.isolated-projects=true" "-Dorg.gradle.unsafe.isolated-projects.diagnostics=true") + PROJECT_ISOLATION_ARGS=("--isolated-projects" "-Dorg.gradle.unsafe.isolated-projects.diagnostics=true") ;; *) echo "Unknown project isolation option: ${{ inputs.project-isolation }}" diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 63a99f3..c887d7d 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -187,10 +187,10 @@ runs: echo "args=" >> "$GITHUB_OUTPUT" ;; "on") - echo "args=-Dorg.gradle.unsafe.isolated-projects=true" >> "$GITHUB_OUTPUT" + echo "args=--isolated-projects" >> "$GITHUB_OUTPUT" ;; "diagnostics") - echo "args=-Dorg.gradle.unsafe.isolated-projects=true -Dorg.gradle.unsafe.isolated-projects.diagnostics=true" >> "$GITHUB_OUTPUT" + echo "args=--isolated-projects -Dorg.gradle.unsafe.isolated-projects.diagnostics=true" >> "$GITHUB_OUTPUT" ;; *) echo "Unknown project isolation option: ${{ inputs.project-isolation }}" diff --git a/.github/workflows/runner/action.yaml b/.github/workflows/runner/action.yaml index b07fbe0..fcad658 100644 --- a/.github/workflows/runner/action.yaml +++ b/.github/workflows/runner/action.yaml @@ -176,10 +176,10 @@ runs: echo "args=" >> "$GITHUB_OUTPUT" ;; "on") - echo "args=-Dorg.gradle.unsafe.isolated-projects=true" >> "$GITHUB_OUTPUT" + echo "args=--isolated-projects" >> "$GITHUB_OUTPUT" ;; "diagnostics") - echo "args=-Dorg.gradle.unsafe.isolated-projects=true -Dorg.gradle.unsafe.isolated-projects.diagnostics=true" >> "$GITHUB_OUTPUT" + echo "args=--isolated-projects -Dorg.gradle.unsafe.isolated-projects.diagnostics=true" >> "$GITHUB_OUTPUT" ;; *) echo "Unknown project isolation option: ${{ inputs.project-isolation }}" From 718165508b057a6e0119ecadf241d66b74b50991 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 11 Aug 2026 11:23:01 -0700 Subject: [PATCH 12/16] Allow skipping configuration cache entry reuse --- .github/workflows/experiment.yaml | 11 +++++++++++ .github/workflows/runner-seed/action.yaml | 22 +++++++++++++++++++--- .github/workflows/runner/action.yaml | 20 ++++++++++++++++++-- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index 26f2322..9ea788e 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -63,6 +63,14 @@ on: description: "Comma-separated included build paths whose build outputs should be saved with the configuration cache" required: false default: "buildSrc,build-logic,build-logic/*" + configuration_cache_entry: + description: "Whether to save and restore the explicit configuration cache entry bundle" + type: choice + required: true + default: 'restore' + options: + - 'restore' + - 'skip' os_args: description: "Operating system configurations for variants" type: string @@ -137,6 +145,7 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" + configuration-cache-entry: "${{ github.event.inputs.configuration_cache_entry }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" @@ -178,6 +187,7 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" + configuration-cache-entry: "${{ github.event.inputs.configuration_cache_entry }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" @@ -218,6 +228,7 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" + configuration-cache-entry: "${{ github.event.inputs.configuration_cache_entry }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index c887d7d..fb24754 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -42,6 +42,10 @@ inputs: configuration-cache-key: description: 'Cache key used to save the project configuration cache.' required: false + configuration-cache-entry: + description: 'Whether to save the seeded configuration cache entry bundle: restore or skip.' + required: false + default: 'restore' configuration-cache-included-builds: description: 'Comma-separated included build paths whose build outputs are required by the configuration cache.' required: false @@ -199,9 +203,21 @@ runs: esac shell: bash + - name: Validate Configuration Cache Entry Mode + run: | + case "${{ inputs.configuration-cache-entry }}" in + "restore"|"skip"|"") + ;; + *) + echo "Unknown configuration cache entry option: ${{ inputs.configuration-cache-entry }}" + exit 1 + ;; + esac + shell: bash + - name: Set Configuration Cache Paths id: configuration-cache-paths - if: (inputs.configuration-cache != 'off' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' + if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache != 'off' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' run: | { echo "paths< Date: Wed, 12 Aug 2026 15:31:17 -0700 Subject: [PATCH 13/16] Add explicit configuration cache disable mode --- .../experiment-with-gradle-profiler.yaml | 1 + .github/workflows/experiment.yaml | 1 + .../workflows/runner-gradle-profiler/action.yaml | 5 ++++- .github/workflows/runner-seed/action.yaml | 15 +++++++++------ .github/workflows/runner/action.yaml | 11 +++++++---- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/experiment-with-gradle-profiler.yaml b/.github/workflows/experiment-with-gradle-profiler.yaml index c17d04c..38eb3a7 100644 --- a/.github/workflows/experiment-with-gradle-profiler.yaml +++ b/.github/workflows/experiment-with-gradle-profiler.yaml @@ -38,6 +38,7 @@ on: default: 'off' options: - 'off' + - 'disabled' - 'on' - 'warn' project_isolation: diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index 9ea788e..970ecba 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -48,6 +48,7 @@ on: default: 'off' options: - 'off' + - 'disabled' - 'on' - 'warn' project_isolation: diff --git a/.github/workflows/runner-gradle-profiler/action.yaml b/.github/workflows/runner-gradle-profiler/action.yaml index cee5f00..fc0d157 100644 --- a/.github/workflows/runner-gradle-profiler/action.yaml +++ b/.github/workflows/runner-gradle-profiler/action.yaml @@ -43,7 +43,7 @@ inputs: description: 'Extra arguments to pass to the Gradle command' required: true configuration-cache: - description: 'Gradle configuration cache behavior: off, on, or warn.' + description: 'Gradle configuration cache behavior: off, disabled, on, or warn.' required: false default: 'off' project-isolation: @@ -102,6 +102,9 @@ runs: "off"|"") CONFIGURATION_CACHE_ARGS=() ;; + "disabled") + CONFIGURATION_CACHE_ARGS=("--no-configuration-cache") + ;; "on") CONFIGURATION_CACHE_ARGS=("--configuration-cache") ;; diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index fb24754..6141cfb 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -32,7 +32,7 @@ inputs: description: 'Mode of execution relative to caching.' required: true configuration-cache: - description: 'Gradle configuration cache behavior: off, on, or warn.' + description: 'Gradle configuration cache behavior: off, disabled, on, or warn.' required: false default: 'off' project-isolation: @@ -148,7 +148,7 @@ runs: GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.experiment-id }}-${{ inputs.variant }} - name: Validate Configuration Cache Encryption Key - if: inputs.configuration-cache != 'off' || inputs.project-isolation != 'off' + if: inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.project-isolation != 'off' run: | if [ -z "$CHECK_GRADLE_ENCRYPTION_KEY" ]; then echo "GRADLE_ENCRYPTION_KEY is required when configuration cache or project isolation is enabled." @@ -170,6 +170,9 @@ runs: "off"|"") echo "args=" >> "$GITHUB_OUTPUT" ;; + "disabled") + echo "args=--no-configuration-cache" >> "$GITHUB_OUTPUT" + ;; "on") echo "args=--configuration-cache" >> "$GITHUB_OUTPUT" ;; @@ -217,7 +220,7 @@ runs: - name: Set Configuration Cache Paths id: configuration-cache-paths - if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache != 'off' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' + if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' run: | { echo "paths<> "$GITHUB_OUTPUT" + ;; "on") echo "args=--configuration-cache" >> "$GITHUB_OUTPUT" ;; From ac94125a3ed92c4171a87b63937924952033fa30 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 12 Aug 2026 15:49:47 -0700 Subject: [PATCH 14/16] Add read-only configuration cache mode --- .../workflows/experiment-with-gradle-profiler.yaml | 1 + .github/workflows/experiment.yaml | 1 + .github/workflows/runner-gradle-profiler/action.yaml | 5 ++++- .github/workflows/runner-seed/action.yaml | 9 ++++++--- .github/workflows/runner/action.yaml | 11 +++++++---- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/experiment-with-gradle-profiler.yaml b/.github/workflows/experiment-with-gradle-profiler.yaml index 38eb3a7..cbccb3a 100644 --- a/.github/workflows/experiment-with-gradle-profiler.yaml +++ b/.github/workflows/experiment-with-gradle-profiler.yaml @@ -41,6 +41,7 @@ on: - 'disabled' - 'on' - 'warn' + - 'read-only' project_isolation: description: "Gradle Isolated Projects behavior" type: choice diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index 970ecba..d65342b 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -51,6 +51,7 @@ on: - 'disabled' - 'on' - 'warn' + - 'read-only' project_isolation: description: "Gradle Isolated Projects behavior" type: choice diff --git a/.github/workflows/runner-gradle-profiler/action.yaml b/.github/workflows/runner-gradle-profiler/action.yaml index fc0d157..719e789 100644 --- a/.github/workflows/runner-gradle-profiler/action.yaml +++ b/.github/workflows/runner-gradle-profiler/action.yaml @@ -43,7 +43,7 @@ inputs: description: 'Extra arguments to pass to the Gradle command' required: true configuration-cache: - description: 'Gradle configuration cache behavior: off, disabled, on, or warn.' + description: 'Gradle configuration cache behavior: off, disabled, on, warn, or read-only.' required: false default: 'off' project-isolation: @@ -111,6 +111,9 @@ runs: "warn") CONFIGURATION_CACHE_ARGS=("--configuration-cache" "--configuration-cache-problems=warn") ;; + "read-only") + CONFIGURATION_CACHE_ARGS=("--configuration-cache" "-Dorg.gradle.configuration-cache.read-only=true") + ;; *) echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}" exit 1 diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 6141cfb..4e39885 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -32,7 +32,7 @@ inputs: description: 'Mode of execution relative to caching.' required: true configuration-cache: - description: 'Gradle configuration cache behavior: off, disabled, on, or warn.' + description: 'Gradle configuration cache behavior: off, disabled, on, warn, or read-only.' required: false default: 'off' project-isolation: @@ -148,7 +148,7 @@ runs: GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.experiment-id }}-${{ inputs.variant }} - name: Validate Configuration Cache Encryption Key - if: inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.project-isolation != 'off' + if: inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.configuration-cache == 'read-only' || inputs.project-isolation != 'off' run: | if [ -z "$CHECK_GRADLE_ENCRYPTION_KEY" ]; then echo "GRADLE_ENCRYPTION_KEY is required when configuration cache or project isolation is enabled." @@ -179,6 +179,9 @@ runs: "warn") echo "args=--configuration-cache --configuration-cache-problems=warn" >> "$GITHUB_OUTPUT" ;; + "read-only") + echo "args=--configuration-cache -Dorg.gradle.configuration-cache.read-only=true" >> "$GITHUB_OUTPUT" + ;; *) echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}" exit 1 @@ -220,7 +223,7 @@ runs: - name: Set Configuration Cache Paths id: configuration-cache-paths - if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' + if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.configuration-cache == 'read-only' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' run: | { echo "paths<> "$GITHUB_OUTPUT" ;; + "read-only") + echo "args=--configuration-cache -Dorg.gradle.configuration-cache.read-only=true" >> "$GITHUB_OUTPUT" + ;; *) echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}" exit 1 From 7248760a0ba8671e4c7aea50fec53d5f7b083de0 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 13 Aug 2026 10:59:59 -0700 Subject: [PATCH 15/16] Force-disable configuration cache option --- .github/workflows/runner-gradle-profiler/action.yaml | 8 +++++++- .github/workflows/runner-seed/action.yaml | 11 ++++++++++- .github/workflows/runner/action.yaml | 11 ++++++++++- README.md | 8 +++++--- docs/actions-inputs.md | 11 +++++++---- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/.github/workflows/runner-gradle-profiler/action.yaml b/.github/workflows/runner-gradle-profiler/action.yaml index 719e789..ca7a7b9 100644 --- a/.github/workflows/runner-gradle-profiler/action.yaml +++ b/.github/workflows/runner-gradle-profiler/action.yaml @@ -98,12 +98,18 @@ runs: EXTRA_ARG="${{ inputs.extra-args }}" fi + if [ "${{ inputs.configuration-cache }}" = "disabled" ] && [ "${{ inputs.project-isolation }}" != "off" ] && [ -n "${{ inputs.project-isolation }}" ]; then + echo "configuration-cache=disabled cannot be combined with project-isolation=${{ inputs.project-isolation }}." + echo "Gradle requires configuration cache when Isolated Projects is enabled." + exit 1 + fi + case "${{ inputs.configuration-cache }}" in "off"|"") CONFIGURATION_CACHE_ARGS=() ;; "disabled") - CONFIGURATION_CACHE_ARGS=("--no-configuration-cache") + CONFIGURATION_CACHE_ARGS=("--no-configuration-cache" "-Dorg.gradle.unsafe.isolated-projects=false") ;; "on") CONFIGURATION_CACHE_ARGS=("--configuration-cache") diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index 4e39885..a762fbd 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -163,6 +163,15 @@ runs: remote_monitoring: 'true' export_to_bigquery: 'true' + - name: Validate Gradle Feature Combination + run: | + if [ "${{ inputs.configuration-cache }}" = "disabled" ] && [ "${{ inputs.project-isolation }}" != "off" ] && [ -n "${{ inputs.project-isolation }}" ]; then + echo "configuration-cache=disabled cannot be combined with project-isolation=${{ inputs.project-isolation }}." + echo "Gradle requires configuration cache when Isolated Projects is enabled." + exit 1 + fi + shell: bash + - name: Set Configuration Cache Arguments id: configuration-cache-args run: | @@ -171,7 +180,7 @@ runs: echo "args=" >> "$GITHUB_OUTPUT" ;; "disabled") - echo "args=--no-configuration-cache" >> "$GITHUB_OUTPUT" + echo "args=--no-configuration-cache -Dorg.gradle.unsafe.isolated-projects=false" >> "$GITHUB_OUTPUT" ;; "on") echo "args=--configuration-cache" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/runner/action.yaml b/.github/workflows/runner/action.yaml index 64a6b52..ce84784 100644 --- a/.github/workflows/runner/action.yaml +++ b/.github/workflows/runner/action.yaml @@ -114,6 +114,15 @@ runs: esac shell: bash + - name: Validate Gradle Feature Combination + run: | + if [ "${{ inputs.configuration-cache }}" = "disabled" ] && [ "${{ inputs.project-isolation }}" != "off" ] && [ -n "${{ inputs.project-isolation }}" ]; then + echo "configuration-cache=disabled cannot be combined with project-isolation=${{ inputs.project-isolation }}." + echo "Gradle requires configuration cache when Isolated Projects is enabled." + exit 1 + fi + shell: bash + - name: Set Configuration Cache Paths id: configuration-cache-paths if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.configuration-cache == 'read-only' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' @@ -172,7 +181,7 @@ runs: echo "args=" >> "$GITHUB_OUTPUT" ;; "disabled") - echo "args=--no-configuration-cache" >> "$GITHUB_OUTPUT" + echo "args=--no-configuration-cache -Dorg.gradle.unsafe.isolated-projects=false" >> "$GITHUB_OUTPUT" ;; "on") echo "args=--configuration-cache" >> "$GITHUB_OUTPUT" diff --git a/README.md b/README.md index d02c0c2..a4f4a59 100644 --- a/README.md +++ b/README.md @@ -67,9 +67,11 @@ This workflow executes Gradle tasks across two specified variants (branches) wit - **Type**: `choice` - **Default**: `off` - **Options**: - - `off`: Do not pass configuration-cache arguments. + - `off`: Do not pass configuration-cache arguments; target repository defaults still apply. + - `disabled`: Pass `--no-configuration-cache -Dorg.gradle.unsafe.isolated-projects=false` to force configuration cache off even when the target repository enables Isolated Projects in `gradle.properties`. - `on`: Pass `--configuration-cache`. - `warn`: Pass `--configuration-cache --configuration-cache-problems=warn`. + - `read-only`: Pass `--configuration-cache -Dorg.gradle.configuration-cache.read-only=true`. - `configuration_cache_included_builds`: - **Description**: Comma-separated included build paths whose `build` directories are saved and restored with the configuration cache. This is needed when a restored configuration-cache entry references compiled included-build outputs, such as `build-logic/build` or `build-logic/convention/build`. @@ -141,11 +143,11 @@ Instead of using agents based on experiment iterations, the Gradle Profiler expe - **Required**: `false` - **Default**: `5` - `configuration_cache`: - - **Description**: Controls Gradle configuration cache usage for the generated Gradle Profiler scenario. Use `on` for strict configuration-cache execution, or `warn` while evaluating projects with remaining incompatibilities. + - **Description**: Controls Gradle configuration cache usage for the generated Gradle Profiler scenario. Use `on` for strict configuration-cache execution, `warn` while evaluating projects with remaining incompatibilities, `read-only` to reuse an existing entry without writing a new one, or `disabled` to force configuration cache off even when the target repository enables Isolated Projects. - **Type**: `choice` - **Required**: `false` - **Default**: `off` - - **Options**: `off`, `on`, `warn` + - **Options**: `off`, `disabled`, `on`, `warn`, `read-only` - `os_args`: - **Description**: Operating system configurations for variants. - **Type**: `string` diff --git a/docs/actions-inputs.md b/docs/actions-inputs.md index 28d585d..d57d4d1 100644 --- a/docs/actions-inputs.md +++ b/docs/actions-inputs.md @@ -45,9 +45,12 @@ This section details the inputs for the primary dispatchable workflows: `experim - `experiment.yaml`: Required: `true`. Default: `'off'`. - `experiment-with-gradle-profiler.yaml`: Required: `false`. Default: `'off'`. - Options: - - `'off'`: Do not pass configuration-cache arguments. + - `'off'`: Do not pass configuration-cache arguments; target repository defaults still apply. + - `'disabled'`: Pass `--no-configuration-cache -Dorg.gradle.unsafe.isolated-projects=false` to force configuration cache off even when the target repository enables Isolated Projects in `gradle.properties`. - `'on'`: Pass `--configuration-cache`. - `'warn'`: Pass `--configuration-cache --configuration-cache-problems=warn`. + - `'read-only'`: Pass `--configuration-cache -Dorg.gradle.configuration-cache.read-only=true`. + - Compatibility: `'disabled'` cannot be combined with `project_isolation` values other than `'off'`, because Gradle requires configuration cache when Isolated Projects is enabled. - Reuse behavior: `experiment.yaml` primes `.gradle/configuration-cache` in each seed job with the same Gradle start parameters used by execution jobs, then restores the matching variant entry in execution jobs. `experiment-with-gradle-profiler.yaml` adds the selected arguments to the generated scenario so profiler warmups and iterations can reuse configuration in the same checkout. - **`configuration_cache_included_builds`**: - Description: Comma-separated included build paths whose build output directories must be saved and restored with the configuration cache. @@ -188,7 +191,7 @@ This section describes the inputs for the reusable `report/action.yaml` workflow This section lists the seed-action inputs that differ from or extend the standard runner. Other runner inputs such as `task`, `variant`, `repository`, `jdk_version`, `jdk_vendor`, `mode`, `extra-args`, and `cache-url` follow the same meaning as `runner/action.yaml`. - **`configuration-cache`**: - - Description: Gradle configuration cache behavior for the seed run (`off`, `on`, or `warn`). + - Description: Gradle configuration cache behavior for the seed run (`off`, `disabled`, `on`, `warn`, or `read-only`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. - Required: `false`. - Default: `off`. - **`configuration-cache-key`**: @@ -239,7 +242,7 @@ This section details inputs for the reusable `runner/action.yaml` workflow, whic - Description: Specifies the caching mode for this run (e.g., `no caching`, `local task cache`). - Required: `true`. - **`configuration-cache`**: - - Description: Gradle configuration cache behavior for the run (`off`, `on`, or `warn`). + - Description: Gradle configuration cache behavior for the run (`off`, `disabled`, `on`, `warn`, or `read-only`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. - Required: `false`. - Default: `off`. - **`configuration-cache-key`**: @@ -305,7 +308,7 @@ This section describes inputs for the reusable `runner-gradle-profiler/action.ya - Description: Any additional arguments to pass to the Gradle command. - Required: `true`. - **`configuration-cache`**: - - Description: Gradle configuration cache behavior for the generated scenario (`off`, `on`, or `warn`). + - Description: Gradle configuration cache behavior for the generated scenario (`off`, `disabled`, `on`, `warn`, or `read-only`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. - Required: `false`. - Default: `off`. - **`cache-url`**: From 067853e565c376e01b57ad1c3e5621ea6695cb44 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 18 Aug 2026 15:34:44 -0700 Subject: [PATCH 16/16] Fold cache entry mode into Gradle feature options --- .../experiment-with-gradle-profiler.yaml | 5 + .github/workflows/experiment.yaml | 16 +- .../runner-gradle-profiler/action.yaml | 14 +- .github/workflows/runner-seed/action.yaml | 159 +++++++++++------- .github/workflows/runner/action.yaml | 85 +++++++--- README.md | 25 ++- docs/actions-inputs.md | 27 ++- 7 files changed, 212 insertions(+), 119 deletions(-) diff --git a/.github/workflows/experiment-with-gradle-profiler.yaml b/.github/workflows/experiment-with-gradle-profiler.yaml index cbccb3a..194d491 100644 --- a/.github/workflows/experiment-with-gradle-profiler.yaml +++ b/.github/workflows/experiment-with-gradle-profiler.yaml @@ -40,8 +40,11 @@ on: - 'off' - 'disabled' - 'on' + - 'on-no-entry' - 'warn' + - 'warn-no-entry' - 'read-only' + - 'read-only-no-entry' project_isolation: description: "Gradle Isolated Projects behavior" type: choice @@ -50,7 +53,9 @@ on: options: - 'off' - 'on' + - 'on-no-entry' - 'diagnostics' + - 'diagnostics-no-entry' os_args: description: "Operating system configurations for variants" type: string diff --git a/.github/workflows/experiment.yaml b/.github/workflows/experiment.yaml index d65342b..e204bf3 100644 --- a/.github/workflows/experiment.yaml +++ b/.github/workflows/experiment.yaml @@ -50,8 +50,11 @@ on: - 'off' - 'disabled' - 'on' + - 'on-no-entry' - 'warn' + - 'warn-no-entry' - 'read-only' + - 'read-only-no-entry' project_isolation: description: "Gradle Isolated Projects behavior" type: choice @@ -60,19 +63,13 @@ on: options: - 'off' - 'on' + - 'on-no-entry' - 'diagnostics' + - 'diagnostics-no-entry' configuration_cache_included_builds: description: "Comma-separated included build paths whose build outputs should be saved with the configuration cache" required: false default: "buildSrc,build-logic,build-logic/*" - configuration_cache_entry: - description: "Whether to save and restore the explicit configuration cache entry bundle" - type: choice - required: true - default: 'restore' - options: - - 'restore' - - 'skip' os_args: description: "Operating system configurations for variants" type: string @@ -147,7 +144,6 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" - configuration-cache-entry: "${{ github.event.inputs.configuration_cache_entry }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" @@ -189,7 +185,6 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" - configuration-cache-entry: "${{ github.event.inputs.configuration_cache_entry }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" @@ -230,7 +225,6 @@ jobs: configuration-cache: "${{ github.event.inputs.configuration_cache }}" project-isolation: "${{ github.event.inputs.project_isolation }}" configuration-cache-key: "configuration-cache-${{ runner.os }}-${{ github.repository_owner }}-${{ github.run_number }}-${{ matrix.config.index }}" - configuration-cache-entry: "${{ github.event.inputs.configuration_cache_entry }}" configuration-cache-included-builds: "${{ github.event.inputs.configuration_cache_included_builds }}" gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}" diff --git a/.github/workflows/runner-gradle-profiler/action.yaml b/.github/workflows/runner-gradle-profiler/action.yaml index ca7a7b9..66beeb0 100644 --- a/.github/workflows/runner-gradle-profiler/action.yaml +++ b/.github/workflows/runner-gradle-profiler/action.yaml @@ -43,11 +43,11 @@ inputs: description: 'Extra arguments to pass to the Gradle command' required: true configuration-cache: - description: 'Gradle configuration cache behavior: off, disabled, on, warn, or read-only.' + description: 'Gradle configuration cache behavior: off, disabled, on, on-no-entry, warn, warn-no-entry, read-only, or read-only-no-entry.' required: false default: 'off' project-isolation: - description: 'Gradle Isolated Projects behavior: off, on, or diagnostics.' + description: 'Gradle Isolated Projects behavior: off, on, on-no-entry, diagnostics, or diagnostics-no-entry.' required: false default: 'off' cache-url: @@ -111,13 +111,13 @@ runs: "disabled") CONFIGURATION_CACHE_ARGS=("--no-configuration-cache" "-Dorg.gradle.unsafe.isolated-projects=false") ;; - "on") + "on"|"on-no-entry") CONFIGURATION_CACHE_ARGS=("--configuration-cache") ;; - "warn") + "warn"|"warn-no-entry") CONFIGURATION_CACHE_ARGS=("--configuration-cache" "--configuration-cache-problems=warn") ;; - "read-only") + "read-only"|"read-only-no-entry") CONFIGURATION_CACHE_ARGS=("--configuration-cache" "-Dorg.gradle.configuration-cache.read-only=true") ;; *) @@ -130,10 +130,10 @@ runs: "off"|"") PROJECT_ISOLATION_ARGS=() ;; - "on") + "on"|"on-no-entry") PROJECT_ISOLATION_ARGS=("--isolated-projects") ;; - "diagnostics") + "diagnostics"|"diagnostics-no-entry") PROJECT_ISOLATION_ARGS=("--isolated-projects" "-Dorg.gradle.unsafe.isolated-projects.diagnostics=true") ;; *) diff --git a/.github/workflows/runner-seed/action.yaml b/.github/workflows/runner-seed/action.yaml index a762fbd..8f8b15d 100644 --- a/.github/workflows/runner-seed/action.yaml +++ b/.github/workflows/runner-seed/action.yaml @@ -32,20 +32,16 @@ inputs: description: 'Mode of execution relative to caching.' required: true configuration-cache: - description: 'Gradle configuration cache behavior: off, disabled, on, warn, or read-only.' + description: 'Gradle configuration cache behavior: off, disabled, on, on-no-entry, warn, warn-no-entry, read-only, or read-only-no-entry.' required: false default: 'off' project-isolation: - description: 'Gradle Isolated Projects behavior: off, on, or diagnostics.' + description: 'Gradle Isolated Projects behavior: off, on, on-no-entry, diagnostics, or diagnostics-no-entry.' required: false default: 'off' configuration-cache-key: description: 'Cache key used to save the project configuration cache.' required: false - configuration-cache-entry: - description: 'Whether to save the seeded configuration cache entry bundle: restore or skip.' - required: false - default: 'restore' configuration-cache-included-builds: description: 'Comma-separated included build paths whose build outputs are required by the configuration cache.' required: false @@ -147,8 +143,57 @@ runs: env: GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.experiment-id }}-${{ inputs.variant }} + - name: Set Gradle Feature State + id: gradle-feature-state + run: | + feature_enabled=false + entry_mode=skip + no_entry=false + + case "${{ inputs.configuration-cache }}" in + "off"|"disabled"|"") + ;; + "on"|"warn"|"read-only") + feature_enabled=true + entry_mode=restore + ;; + "on-no-entry"|"warn-no-entry"|"read-only-no-entry") + feature_enabled=true + no_entry=true + ;; + *) + echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}" + exit 1 + ;; + esac + + case "${{ inputs.project-isolation }}" in + "off"|"") + ;; + "on"|"diagnostics") + feature_enabled=true + entry_mode=restore + ;; + "on-no-entry"|"diagnostics-no-entry") + feature_enabled=true + no_entry=true + ;; + *) + echo "Unknown project isolation option: ${{ inputs.project-isolation }}" + exit 1 + ;; + esac + + if [ "$no_entry" = true ]; then + entry_mode=skip + fi + + echo "feature_enabled=$feature_enabled" >> "$GITHUB_OUTPUT" + echo "entry_mode=$entry_mode" >> "$GITHUB_OUTPUT" + shell: bash + - name: Validate Configuration Cache Encryption Key - if: inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.configuration-cache == 'read-only' || inputs.project-isolation != 'off' + if: steps.gradle-feature-state.outputs.feature_enabled == 'true' run: | if [ -z "$CHECK_GRADLE_ENCRYPTION_KEY" ]; then echo "GRADLE_ENCRYPTION_KEY is required when configuration cache or project isolation is enabled." @@ -172,6 +217,43 @@ runs: fi shell: bash + - name: Set Configuration Cache Paths + id: configuration-cache-paths + if: steps.gradle-feature-state.outputs.entry_mode == 'restore' && steps.gradle-feature-state.outputs.feature_enabled == 'true' && inputs.configuration-cache-key != '' + run: | + { + echo "paths<> "$GITHUB_OUTPUT" + shell: bash + - name: Set Configuration Cache Arguments id: configuration-cache-args run: | @@ -182,13 +264,13 @@ runs: "disabled") echo "args=--no-configuration-cache -Dorg.gradle.unsafe.isolated-projects=false" >> "$GITHUB_OUTPUT" ;; - "on") + "on"|"on-no-entry") echo "args=--configuration-cache" >> "$GITHUB_OUTPUT" ;; - "warn") + "warn"|"warn-no-entry") echo "args=--configuration-cache --configuration-cache-problems=warn" >> "$GITHUB_OUTPUT" ;; - "read-only") + "read-only"|"read-only-no-entry") echo "args=--configuration-cache -Dorg.gradle.configuration-cache.read-only=true" >> "$GITHUB_OUTPUT" ;; *) @@ -205,10 +287,10 @@ runs: "off"|"") echo "args=" >> "$GITHUB_OUTPUT" ;; - "on") + "on"|"on-no-entry") echo "args=--isolated-projects" >> "$GITHUB_OUTPUT" ;; - "diagnostics") + "diagnostics"|"diagnostics-no-entry") echo "args=--isolated-projects -Dorg.gradle.unsafe.isolated-projects.diagnostics=true" >> "$GITHUB_OUTPUT" ;; *) @@ -218,55 +300,6 @@ runs: esac shell: bash - - name: Validate Configuration Cache Entry Mode - run: | - case "${{ inputs.configuration-cache-entry }}" in - "restore"|"skip"|"") - ;; - *) - echo "Unknown configuration cache entry option: ${{ inputs.configuration-cache-entry }}" - exit 1 - ;; - esac - shell: bash - - - name: Set Configuration Cache Paths - id: configuration-cache-paths - if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.configuration-cache == 'read-only' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' - run: | - { - echo "paths<> "$GITHUB_OUTPUT" - shell: bash - - name: Execute Gradle Build id: gradle-build run: | @@ -284,7 +317,7 @@ runs: - name: Prime Configuration Cache id: prime-configuration-cache - if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.project-isolation != 'off') + if: steps.gradle-feature-state.outputs.entry_mode == 'restore' && steps.gradle-feature-state.outputs.feature_enabled == 'true' run: | ./gradlew ${{ inputs.task }} ${{ inputs.extra-args }} ${{ steps.configuration-cache-args.outputs.args }} ${{ steps.project-isolation-args.outputs.args }} \ -Dscan.tag.${{ inputs.experiment-id }}_${{ inputs.variant-prefix }}${{ inputs.variant }} \ @@ -299,7 +332,7 @@ runs: CI_URL_CACHE_NODE: ${{ inputs.cache-url }} - name: Save Configuration Cache - if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' + if: steps.gradle-feature-state.outputs.entry_mode == 'restore' && steps.gradle-feature-state.outputs.feature_enabled == 'true' && inputs.configuration-cache-key != '' uses: actions/cache/save@v4 with: path: ${{ steps.configuration-cache-paths.outputs.paths }} diff --git a/.github/workflows/runner/action.yaml b/.github/workflows/runner/action.yaml index ce84784..20b89ee 100644 --- a/.github/workflows/runner/action.yaml +++ b/.github/workflows/runner/action.yaml @@ -34,20 +34,16 @@ inputs: description: 'Mode of execution relative to caching' required: true configuration-cache: - description: 'Gradle configuration cache behavior: off, disabled, on, warn, or read-only.' + description: 'Gradle configuration cache behavior: off, disabled, on, on-no-entry, warn, warn-no-entry, read-only, or read-only-no-entry.' required: false default: 'off' project-isolation: - description: 'Gradle Isolated Projects behavior: off, on, or diagnostics.' + description: 'Gradle Isolated Projects behavior: off, on, on-no-entry, diagnostics, or diagnostics-no-entry.' required: false default: 'off' configuration-cache-key: description: 'Cache key used to restore the seeded project configuration cache.' required: false - configuration-cache-entry: - description: 'Whether to restore the seeded configuration cache entry bundle: restore or skip.' - required: false - default: 'restore' configuration-cache-included-builds: description: 'Comma-separated included build paths whose build outputs are required by the configuration cache.' required: false @@ -91,8 +87,57 @@ runs: GRADLE_BUILD_ACTION_CACHE_KEY_JOB: 'seed' GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ${{ inputs.execution-number }}-${{ inputs.variant }} + - name: Set Gradle Feature State + id: gradle-feature-state + run: | + feature_enabled=false + entry_mode=skip + no_entry=false + + case "${{ inputs.configuration-cache }}" in + "off"|"disabled"|"") + ;; + "on"|"warn"|"read-only") + feature_enabled=true + entry_mode=restore + ;; + "on-no-entry"|"warn-no-entry"|"read-only-no-entry") + feature_enabled=true + no_entry=true + ;; + *) + echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}" + exit 1 + ;; + esac + + case "${{ inputs.project-isolation }}" in + "off"|"") + ;; + "on"|"diagnostics") + feature_enabled=true + entry_mode=restore + ;; + "on-no-entry"|"diagnostics-no-entry") + feature_enabled=true + no_entry=true + ;; + *) + echo "Unknown project isolation option: ${{ inputs.project-isolation }}" + exit 1 + ;; + esac + + if [ "$no_entry" = true ]; then + entry_mode=skip + fi + + echo "feature_enabled=$feature_enabled" >> "$GITHUB_OUTPUT" + echo "entry_mode=$entry_mode" >> "$GITHUB_OUTPUT" + shell: bash + - name: Validate Configuration Cache Encryption Key - if: inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.configuration-cache == 'read-only' || inputs.project-isolation != 'off' + if: steps.gradle-feature-state.outputs.feature_enabled == 'true' run: | if [ -z "$CHECK_GRADLE_ENCRYPTION_KEY" ]; then echo "GRADLE_ENCRYPTION_KEY is required when configuration cache or project isolation is enabled." @@ -102,18 +147,6 @@ runs: env: CHECK_GRADLE_ENCRYPTION_KEY: ${{ inputs.gradle-encryption-key }} - - name: Validate Configuration Cache Entry Mode - run: | - case "${{ inputs.configuration-cache-entry }}" in - "restore"|"skip"|"") - ;; - *) - echo "Unknown configuration cache entry option: ${{ inputs.configuration-cache-entry }}" - exit 1 - ;; - esac - shell: bash - - name: Validate Gradle Feature Combination run: | if [ "${{ inputs.configuration-cache }}" = "disabled" ] && [ "${{ inputs.project-isolation }}" != "off" ] && [ -n "${{ inputs.project-isolation }}" ]; then @@ -125,7 +158,7 @@ runs: - name: Set Configuration Cache Paths id: configuration-cache-paths - if: inputs.configuration-cache-entry == 'restore' && (inputs.configuration-cache == 'on' || inputs.configuration-cache == 'warn' || inputs.configuration-cache == 'read-only' || inputs.project-isolation != 'off') && inputs.configuration-cache-key != '' + if: steps.gradle-feature-state.outputs.entry_mode == 'restore' && steps.gradle-feature-state.outputs.feature_enabled == 'true' && inputs.configuration-cache-key != '' run: | { echo "paths<> "$GITHUB_OUTPUT" ;; - "on") + "on"|"on-no-entry") echo "args=--configuration-cache" >> "$GITHUB_OUTPUT" ;; - "warn") + "warn"|"warn-no-entry") echo "args=--configuration-cache --configuration-cache-problems=warn" >> "$GITHUB_OUTPUT" ;; - "read-only") + "read-only"|"read-only-no-entry") echo "args=--configuration-cache -Dorg.gradle.configuration-cache.read-only=true" >> "$GITHUB_OUTPUT" ;; *) @@ -206,10 +239,10 @@ runs: "off"|"") echo "args=" >> "$GITHUB_OUTPUT" ;; - "on") + "on"|"on-no-entry") echo "args=--isolated-projects" >> "$GITHUB_OUTPUT" ;; - "diagnostics") + "diagnostics"|"diagnostics-no-entry") echo "args=--isolated-projects -Dorg.gradle.unsafe.isolated-projects.diagnostics=true" >> "$GITHUB_OUTPUT" ;; *) diff --git a/README.md b/README.md index a4f4a59..170189e 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,24 @@ This workflow executes Gradle tasks across two specified variants (branches) wit - **Options**: - `off`: Do not pass configuration-cache arguments; target repository defaults still apply. - `disabled`: Pass `--no-configuration-cache -Dorg.gradle.unsafe.isolated-projects=false` to force configuration cache off even when the target repository enables Isolated Projects in `gradle.properties`. - - `on`: Pass `--configuration-cache`. - - `warn`: Pass `--configuration-cache --configuration-cache-problems=warn`. - - `read-only`: Pass `--configuration-cache -Dorg.gradle.configuration-cache.read-only=true`. + - `on`: Pass `--configuration-cache` and save/restore the explicit configuration-cache entry bundle in the standard workflow. + - `on-no-entry`: Pass `--configuration-cache` without saving or restoring the explicit configuration-cache entry bundle. + - `warn`: Pass `--configuration-cache --configuration-cache-problems=warn` and save/restore the explicit configuration-cache entry bundle in the standard workflow. + - `warn-no-entry`: Pass `--configuration-cache --configuration-cache-problems=warn` without saving or restoring the explicit configuration-cache entry bundle. + - `read-only`: Pass `--configuration-cache -Dorg.gradle.configuration-cache.read-only=true` and restore the explicit configuration-cache entry bundle in the standard workflow. + - `read-only-no-entry`: Pass `--configuration-cache -Dorg.gradle.configuration-cache.read-only=true` without restoring the explicit configuration-cache entry bundle. + - **Entry behavior**: The explicit configuration-cache entry bundle is shared by configuration cache and Isolated Projects. If either selected feature value ends in `-no-entry`, the standard workflow skips saving and restoring that bundle. + + - `project_isolation`: + - **Description**: Controls Gradle Isolated Projects independently of the selected task/dependency cache mode. Values without `-no-entry` save/restore the explicit configuration-cache entry bundle in the standard workflow because Isolated Projects requires configuration cache. + - **Type**: `choice` + - **Default**: `off` + - **Options**: + - `off`: Do not pass Isolated Projects arguments; target repository defaults still apply. + - `on`: Pass `--isolated-projects` and save/restore the explicit configuration-cache entry bundle in the standard workflow. + - `on-no-entry`: Pass `--isolated-projects` without saving or restoring the explicit configuration-cache entry bundle. + - `diagnostics`: Pass `--isolated-projects -Dorg.gradle.unsafe.isolated-projects.diagnostics=true` and save/restore the explicit configuration-cache entry bundle in the standard workflow. + - `diagnostics-no-entry`: Pass `--isolated-projects -Dorg.gradle.unsafe.isolated-projects.diagnostics=true` without saving or restoring the explicit configuration-cache entry bundle. - `configuration_cache_included_builds`: - **Description**: Comma-separated included build paths whose `build` directories are saved and restored with the configuration cache. This is needed when a restored configuration-cache entry references compiled included-build outputs, such as `build-logic/build` or `build-logic/convention/build`. @@ -143,11 +158,11 @@ Instead of using agents based on experiment iterations, the Gradle Profiler expe - **Required**: `false` - **Default**: `5` - `configuration_cache`: - - **Description**: Controls Gradle configuration cache usage for the generated Gradle Profiler scenario. Use `on` for strict configuration-cache execution, `warn` while evaluating projects with remaining incompatibilities, `read-only` to reuse an existing entry without writing a new one, or `disabled` to force configuration cache off even when the target repository enables Isolated Projects. + - **Description**: Controls Gradle configuration cache usage for the generated Gradle Profiler scenario. Use `on` for strict configuration-cache execution, `warn` while evaluating projects with remaining incompatibilities, `read-only` to reuse an existing entry without writing a new one, or `disabled` to force configuration cache off even when the target repository enables Isolated Projects. `*-no-entry` values are accepted for parity with the standard workflow and pass the same Gradle arguments as their base value. - **Type**: `choice` - **Required**: `false` - **Default**: `off` - - **Options**: `off`, `disabled`, `on`, `warn`, `read-only` + - **Options**: `off`, `disabled`, `on`, `on-no-entry`, `warn`, `warn-no-entry`, `read-only`, `read-only-no-entry` - `os_args`: - **Description**: Operating system configurations for variants. - **Type**: `string` diff --git a/docs/actions-inputs.md b/docs/actions-inputs.md index d57d4d1..ea4e1bd 100644 --- a/docs/actions-inputs.md +++ b/docs/actions-inputs.md @@ -47,11 +47,24 @@ This section details the inputs for the primary dispatchable workflows: `experim - Options: - `'off'`: Do not pass configuration-cache arguments; target repository defaults still apply. - `'disabled'`: Pass `--no-configuration-cache -Dorg.gradle.unsafe.isolated-projects=false` to force configuration cache off even when the target repository enables Isolated Projects in `gradle.properties`. - - `'on'`: Pass `--configuration-cache`. - - `'warn'`: Pass `--configuration-cache --configuration-cache-problems=warn`. - - `'read-only'`: Pass `--configuration-cache -Dorg.gradle.configuration-cache.read-only=true`. + - `'on'`: Pass `--configuration-cache` and save/restore the explicit configuration-cache entry bundle in the standard workflow. + - `'on-no-entry'`: Pass `--configuration-cache` without saving or restoring the explicit configuration-cache entry bundle. + - `'warn'`: Pass `--configuration-cache --configuration-cache-problems=warn` and save/restore the explicit configuration-cache entry bundle in the standard workflow. + - `'warn-no-entry'`: Pass `--configuration-cache --configuration-cache-problems=warn` without saving or restoring the explicit configuration-cache entry bundle. + - `'read-only'`: Pass `--configuration-cache -Dorg.gradle.configuration-cache.read-only=true` and restore the explicit configuration-cache entry bundle in the standard workflow. + - `'read-only-no-entry'`: Pass `--configuration-cache -Dorg.gradle.configuration-cache.read-only=true` without restoring the explicit configuration-cache entry bundle. - Compatibility: `'disabled'` cannot be combined with `project_isolation` values other than `'off'`, because Gradle requires configuration cache when Isolated Projects is enabled. - - Reuse behavior: `experiment.yaml` primes `.gradle/configuration-cache` in each seed job with the same Gradle start parameters used by execution jobs, then restores the matching variant entry in execution jobs. `experiment-with-gradle-profiler.yaml` adds the selected arguments to the generated scenario so profiler warmups and iterations can reuse configuration in the same checkout. + - Reuse behavior: `experiment.yaml` primes `.gradle/configuration-cache` in each seed job with the same Gradle start parameters used by execution jobs, then restores the matching variant entry in execution jobs. If either `configuration_cache` or `project_isolation` ends in `-no-entry`, the standard workflow skips saving and restoring that shared bundle. `experiment-with-gradle-profiler.yaml` adds the selected arguments to the generated scenario so profiler warmups and iterations can reuse configuration in the same checkout. +- **`project_isolation`**: + - Description: Controls Gradle Isolated Projects independently of the selected task/dependency cache mode. Values without `-no-entry` save/restore the explicit configuration-cache entry bundle in the standard workflow because Isolated Projects requires configuration cache. + - `experiment.yaml`: Required: `true`. Default: `'off'`. + - `experiment-with-gradle-profiler.yaml`: Required: `false`. Default: `'off'`. + - Options: + - `'off'`: Do not pass Isolated Projects arguments; target repository defaults still apply. + - `'on'`: Pass `--isolated-projects` and save/restore the explicit configuration-cache entry bundle in the standard workflow. + - `'on-no-entry'`: Pass `--isolated-projects` without saving or restoring the explicit configuration-cache entry bundle. + - `'diagnostics'`: Pass `--isolated-projects -Dorg.gradle.unsafe.isolated-projects.diagnostics=true` and save/restore the explicit configuration-cache entry bundle in the standard workflow. + - `'diagnostics-no-entry'`: Pass `--isolated-projects -Dorg.gradle.unsafe.isolated-projects.diagnostics=true` without saving or restoring the explicit configuration-cache entry bundle. - **`configuration_cache_included_builds`**: - Description: Comma-separated included build paths whose build output directories must be saved and restored with the configuration cache. - `experiment.yaml`: Required: `false`. Default: `"buildSrc,build-logic,build-logic/*"`. @@ -191,7 +204,7 @@ This section describes the inputs for the reusable `report/action.yaml` workflow This section lists the seed-action inputs that differ from or extend the standard runner. Other runner inputs such as `task`, `variant`, `repository`, `jdk_version`, `jdk_vendor`, `mode`, `extra-args`, and `cache-url` follow the same meaning as `runner/action.yaml`. - **`configuration-cache`**: - - Description: Gradle configuration cache behavior for the seed run (`off`, `disabled`, `on`, `warn`, or `read-only`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. + - Description: Gradle configuration cache behavior for the seed run (`off`, `disabled`, `on`, `on-no-entry`, `warn`, `warn-no-entry`, `read-only`, or `read-only-no-entry`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. - Required: `false`. - Default: `off`. - **`configuration-cache-key`**: @@ -242,7 +255,7 @@ This section details inputs for the reusable `runner/action.yaml` workflow, whic - Description: Specifies the caching mode for this run (e.g., `no caching`, `local task cache`). - Required: `true`. - **`configuration-cache`**: - - Description: Gradle configuration cache behavior for the run (`off`, `disabled`, `on`, `warn`, or `read-only`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. + - Description: Gradle configuration cache behavior for the run (`off`, `disabled`, `on`, `on-no-entry`, `warn`, `warn-no-entry`, `read-only`, or `read-only-no-entry`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. - Required: `false`. - Default: `off`. - **`configuration-cache-key`**: @@ -308,7 +321,7 @@ This section describes inputs for the reusable `runner-gradle-profiler/action.ya - Description: Any additional arguments to pass to the Gradle command. - Required: `true`. - **`configuration-cache`**: - - Description: Gradle configuration cache behavior for the generated scenario (`off`, `disabled`, `on`, `warn`, or `read-only`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. + - Description: Gradle configuration cache behavior for the generated scenario (`off`, `disabled`, `on`, `on-no-entry`, `warn`, `warn-no-entry`, `read-only`, or `read-only-no-entry`). `disabled` forces configuration cache off and disables repo-level Isolated Projects with `-Dorg.gradle.unsafe.isolated-projects=false`. - Required: `false`. - Default: `off`. - **`cache-url`**: