Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/experiment-with-gradle-profiler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,31 @@ on:
required: false
type: boolean
default: true
configuration_cache:
description: "Gradle configuration cache behavior"
type: choice
required: false
default: 'off'
options:
- '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
required: false
default: 'off'
options:
- 'off'
- 'on'
- 'on-no-entry'
- 'diagnostics'
- 'diagnostics-no-entry'
os_args:
description: "Operating system configurations for variants"
type: string
Expand Down Expand Up @@ -91,6 +116,8 @@ 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 }}"
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 }}
Expand Down
50 changes: 47 additions & 3 deletions .github/workflows/experiment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,35 @@ 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'
- 'disabled'
- 'on'
- 'on-no-entry'
- 'warn'
- 'warn-no-entry'
- 'read-only'
- 'read-only-no-entry'
project_isolation:
description: "Gradle Isolated Projects behavior"
type: choice
required: true
default: 'off'
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/*"
os_args:
description: "Operating system configurations for variants"
type: string
Expand Down Expand Up @@ -112,7 +141,12 @@ jobs:
cache-exclude-script: "${{ env.cache_exclude_content }}"
task: "${{ github.event.inputs.task }}"
mode: "${{ github.event.inputs.mode }}"
experiment-id: "${{ github.run_number }}"
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 }}
experiment-id: "${{ github.repository_owner }}-${{ github.run_number }}"
variant: ${{ matrix.config.variant }}
api-key: ${{ secrets.DV_ACCESS_KEY }}
repository: ${{ github.event.inputs.repository }}
Expand Down Expand Up @@ -148,8 +182,13 @@ jobs:
with:
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 }}
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 }}
Expand Down Expand Up @@ -183,8 +222,13 @@ jobs:
with:
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 }}
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 }}
Expand Down
65 changes: 63 additions & 2 deletions .github/workflows/runner-gradle-profiler/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ inputs:
extra-args:
description: 'Extra arguments to pass to the Gradle command'
required: true
configuration-cache:
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, on-no-entry, diagnostics, or diagnostics-no-entry.'
required: false
default: 'off'
cache-url:
description: 'URL for the cache node, if applicable'
required: true
Expand Down Expand Up @@ -90,6 +98,59 @@ 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" "-Dorg.gradle.unsafe.isolated-projects=false")
;;
"on"|"on-no-entry")
CONFIGURATION_CACHE_ARGS=("--configuration-cache")
;;
"warn"|"warn-no-entry")
CONFIGURATION_CACHE_ARGS=("--configuration-cache" "--configuration-cache-problems=warn")
;;
"read-only"|"read-only-no-entry")
CONFIGURATION_CACHE_ARGS=("--configuration-cache" "-Dorg.gradle.configuration-cache.read-only=true")
;;
*)
echo "Unknown configuration cache option: ${{ inputs.configuration-cache }}"
exit 1
;;
esac

case "${{ inputs.project-isolation }}" in
"off"|"")
PROJECT_ISOLATION_ARGS=()
;;
"on"|"on-no-entry")
PROJECT_ISOLATION_ARGS=("--isolated-projects")
;;
"diagnostics"|"diagnostics-no-entry")
PROJECT_ISOLATION_ARGS=("--isolated-projects" "-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
if [ "${{ inputs.clean-between-iterations }}" = "true" ]; then
CLEANUP_TASKS='["clean"]'
Expand All @@ -103,15 +164,15 @@ 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 {
title = \"assemble\"
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

Expand Down
Loading
Loading