Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
20d23e4
add experiments as composite actions
jprinet Mar 11, 2022
02ebe59
Add parameters description
jprinet Mar 14, 2022
905a72c
Add project directory variable
jprinet Mar 17, 2022
10e3bf2
Add Composite Experiment 5
jprinet Mar 22, 2022
2dfb479
Set GITHUB_TOKEN to curl command
jprinet Mar 23, 2022
d381ba5
Add Cache inputs to composite Experiment 5
jprinet Mar 23, 2022
1a140c6
Remove experiment 5
jprinet Apr 5, 2022
b940106
Add both build scan identifiers as output
jprinet Apr 5, 2022
5314bbd
Formatting and comments
jprinet Apr 5, 2022
d015559
Merge branch 'gradle:main' into feature/expe_as_composite_actions
jprinet Apr 5, 2022
2dfc534
CR follow-up: change directory structure
jprinet Apr 19, 2022
f60a8dd
CR follow-up: align script and GH action parameters
jprinet Apr 19, 2022
d062c51
CR follow-up: remove build scan ids as composite output
jprinet Apr 19, 2022
d84c36c
CR follow-up: Set Github token as optional input
jprinet Apr 20, 2022
8ace879
Polish readme a bit
etiennestuder Apr 22, 2022
4e9927c
Polish comments a bit
etiennestuder Apr 22, 2022
5fd4a98
Polish action descriptions a bit
etiennestuder Apr 22, 2022
a1891e0
Streamline action inputs' description and ordering
etiennestuder Apr 22, 2022
c8dc067
Treat tasks inputs as optional
etiennestuder Apr 22, 2022
702435f
Rename actions
etiennestuder Apr 22, 2022
13a4967
CR follow-up: Align experiments 2 and 3 with experiment 1
jprinet Apr 22, 2022
0e24e7a
Merge remote-tracking branch 'jprinet/feature/expe_as_composite_actio…
etiennestuder Apr 24, 2022
131a9ee
Polish
etiennestuder Apr 27, 2022
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
40 changes: 40 additions & 0 deletions .github/actions/gradle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Composite GitHub Actions

The composite actions provided here will simplify running the build validation scripts from your GitHub Actions workflow.

## Usage

Create a GitHub Actions workflow, add the steps to configure the build requirements like JDK, etc., and then add the
following steps to invoke the actual experiments:

```yaml
steps:
# Download the latest version of the build validation scripts
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Run experiment 1
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/[email protected]
with:
gitRepo: <PROJECT_GIT_URL>
gitBranch: <PROJECT_BRANCH>
tasks: <PROJECT_BUILD_TASK>
...
# Run experiment 2
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/[email protected]
with:
gitRepo: <PROJECT_GIT_URL>
gitBranch: <PROJECT_BRANCH>
tasks: <PROJECT_BUILD_TASK>
...
# Run experiment 3
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/actions/gradle/[email protected]
with:
gitRepo: <PROJECT_GIT_URL>
gitBranch: <PROJECT_BRANCH>
tasks: <PROJECT_BUILD_TASK>
...
```

Once the workflow has been triggered and finishes executing, you can navigate to the workflow's output and investigate the summary
produced by the build validation scripts.
33 changes: 33 additions & 0 deletions .github/actions/gradle/download/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Download latest Gradle build validation scripts
description: "Downloads the latest release of the build validation scripts for Gradle"

inputs:
token:
description: "GitHub token"
required: false

runs:
using: "composite"
steps:
- name: Download latest build Gradle validation scripts
run: |
authHeader=""
if [ ! -z "${{ inputs.token }}" ]; then
authHeader="--header 'Authorization: Bearer ${{ inputs.token }}'"
fi

# Build the command to get the details of the latest version of the build validation scripts
cmdGetLatestReleaseData="curl -s $authHeader https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest"

# Get the download url of the latest version of the build validation scripts
downloadUrl=$($cmdGetLatestReleaseData | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep -v maven)

# Build the command to download the latest version of the build validation scripts
cmdGetLatestRelease="curl -s -L $authHeader -o gradle-enterprise-gradle-build-validation.zip $downloadUrl"

# Download the latest version of the build validation scripts
eval "$cmdGetLatestRelease"

# Unzip the downloaded build validation scripts
unzip -q -o gradle-enterprise-gradle-build-validation.zip
shell: bash
63 changes: 63 additions & 0 deletions .github/actions/gradle/experiment-1/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Run experiment 1
description: "Runs experiment 1 of the build validation scripts for Gradle"

inputs:
gitRepo:
description: "The URL for the Git repository to validate"
required: true
gitBranch:
description: "The branch for the Git repository to validate"
required: false
gitCommitId:
description: "The Git commit id for the Git repository to validate"
required: false
projectDir:
description: "The build invocation directory within the Git repository"
required: false
tasks:
description: "The Gradle tasks to invoke"
required: false
args:
description: "Additional arguments to pass to Gradle"
required: false
gradleEnterpriseUrl:
description: "The URL for the Gradle Enterprise server to connect to"
required: false
enableGradleEnterprise:
description: "Enables Gradle Enterprise on a project not already connected"
required: false

runs:
using: "composite"
steps:
- name: Run Gradle Experiment 1
id: run
run: |
cd gradle-enterprise-gradle-build-validation

EXTRA_ARGS=""
if [ ! -z "${{ inputs.gitBranch }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -b ${{ inputs.gitBranch }}"
fi
if [ ! -z "${{ inputs.gitCommitId }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -c ${{ inputs.gitCommitId }}"
fi
if [ ! -z "${{ inputs.projectDir }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -p ${{ inputs.projectDir }}"
fi
if [ ! -z "${{ inputs.tasks }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -t ${{ inputs.tasks }}"
fi
if [ ! -z "${{ inputs.args }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -a ${{ inputs.args }}"
fi
if [ ! -z "${{ inputs.gradleEnterpriseUrl }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -s ${{ inputs.gradleEnterpriseUrl }}"
fi
if [ ! -z "${{ inputs.enableGradleEnterprise }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -e"
fi

# run experiment
./01-validate-incremental-building.sh -r ${{ inputs.gitRepo }} $EXTRA_ARGS
shell: bash
63 changes: 63 additions & 0 deletions .github/actions/gradle/experiment-2/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Run experiment 2
description: "Runs experiment 2 of the build validation scripts for Gradle"

inputs:
gitRepo:
description: "The URL for the Git repository to validate"
required: true
gitBranch:
description: "The branch for the Git repository to validate"
required: false
gitCommitId:
description: "The Git commit id for the Git repository to validate"
required: false
projectDir:
description: "The build invocation directory within the Git repository"
required: false
tasks:
description: "The Gradle tasks to invoke"
required: false
args:
description: "Additional arguments to pass to Gradle"
required: false
gradleEnterpriseUrl:
description: "The URL for the Gradle Enterprise server to connect to"
required: false
enableGradleEnterprise:
description: "Enables Gradle Enterprise on a project not already connected"
required: false

runs:
using: "composite"
steps:
- name: Run Gradle Experiment 2
id: run
run: |
cd gradle-enterprise-gradle-build-validation

EXTRA_ARGS=""
if [ ! -z "${{ inputs.gitBranch }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -b ${{ inputs.gitBranch }}"
fi
if [ ! -z "${{ inputs.gitCommitId }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -c ${{ inputs.gitCommitId }}"
fi
if [ ! -z "${{ inputs.projectDir }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -p ${{ inputs.projectDir }}"
fi
if [ ! -z "${{ inputs.tasks }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -t ${{ inputs.tasks }}"
fi
if [ ! -z "${{ inputs.args }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -a ${{ inputs.args }}"
fi
if [ ! -z "${{ inputs.gradleEnterpriseUrl }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -s ${{ inputs.gradleEnterpriseUrl }}"
fi
if [ ! -z "${{ inputs.enableGradleEnterprise }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -e"
fi

# run experiment
./02-validate-local-build-caching-same-location.sh -r ${{ inputs.gitRepo }} $EXTRA_ARGS
shell: bash
63 changes: 63 additions & 0 deletions .github/actions/gradle/experiment-3/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Run experiment 3
description: "Runs experiment 3 of the build validation scripts for Gradle"

inputs:
gitRepo:
description: "The URL for the Git repository to validate"
required: true
gitBranch:
description: "The branch for the Git repository to validate"
required: false
gitCommitId:
description: "The Git commit id for the Git repository to validate"
required: false
projectDir:
description: "The build invocation directory within the Git repository"
required: false
tasks:
description: "The Gradle tasks to invoke"
required: false
args:
description: "Additional arguments to pass to Gradle"
required: false
gradleEnterpriseUrl:
description: "The URL for the Gradle Enterprise server to connect to"
required: false
enableGradleEnterprise:
description: "Enables Gradle Enterprise on a project not already connected"
required: false

runs:
using: "composite"
steps:
- name: Run Gradle Experiment 3
id: run
run: |
cd gradle-enterprise-gradle-build-validation

EXTRA_ARGS=""
if [ ! -z "${{ inputs.gitBranch }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -b ${{ inputs.gitBranch }}"
fi
if [ ! -z "${{ inputs.gitCommitId }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -c ${{ inputs.gitCommitId }}"
fi
if [ ! -z "${{ inputs.projectDir }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -p ${{ inputs.projectDir }}"
fi
if [ ! -z "${{ inputs.tasks }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -t ${{ inputs.tasks }}"
fi
if [ ! -z "${{ inputs.args }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -a ${{ inputs.args }}"
fi
if [ ! -z "${{ inputs.gradleEnterpriseUrl }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -s ${{ inputs.gradleEnterpriseUrl }}"
fi
if [ ! -z "${{ inputs.enableGradleEnterprise }}" ]; then
EXTRA_ARGS="$EXTRA_ARGS -e"
fi

# run experiment
./03-validate-local-build-caching-different-locations.sh -r ${{ inputs.gitRepo }} $EXTRA_ARGS
shell: bash