Skip to content

Commit 8f7ec59

Browse files
committed
add experiments as composite actions
1 parent 459f528 commit 8f7ec59

File tree

5 files changed

+115
-0
lines changed

5 files changed

+115
-0
lines changed

.github/composite/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Composite Github Actions
2+
3+
The composite actions provided here will simplify running the validation scripts in your Github Action workflow.
4+
5+
## Usage
6+
7+
Create a Github Action workflow, fulfilling the build requirements (add JDK...) and then add the following steps (replacing the placeholders):
8+
9+
```yaml
10+
steps:
11+
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/composite/[email protected]
12+
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/composite/[email protected]
13+
with:
14+
repositoryUrl: <PROJECT_GIT_URL>
15+
branch: <PROJECT_BRANCH>
16+
task: <PROJECT_BUILD_TASK>
17+
gradleEnterpriseUrl: <GRADLE_ENTERPRISE_URL>
18+
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/composite/[email protected]
19+
with:
20+
repositoryUrl: <PROJECT_GIT_URL>
21+
branch: <PROJECT_BRANCH>
22+
task: <PROJECT_BUILD_TASK>
23+
gradleEnterpriseUrl: <GRADLE_ENTERPRISE_URL>
24+
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/composite/[email protected]
25+
with:
26+
repositoryUrl: <PROJECT_GIT_URL>
27+
branch: <PROJECT_BRANCH>
28+
task: <PROJECT_BUILD_TASK>
29+
gradleEnterpriseUrl: <GRADLE_ENTERPRISE_URL>
30+
```
31+
32+
You can then navigate the workflow output and click the investigation links provided by the script.

.github/composite/exp1/action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Run experiment 1
2+
3+
inputs:
4+
repositoryUrl:
5+
required: true
6+
type: string
7+
branch:
8+
required: true
9+
type: string
10+
task:
11+
required: true
12+
type: string
13+
gradleEnterpriseUrl:
14+
required: true
15+
type: string
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Run Gradle Experiment 1
21+
run: |
22+
cd gradle-enterprise-gradle-build-validation
23+
./01-validate-incremental-building.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -s ${{ inputs.gradleEnterpriseUrl }}
24+
shell: bash

.github/composite/exp2/action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Run experiment 2
2+
3+
inputs:
4+
repositoryUrl:
5+
required: true
6+
type: string
7+
branch:
8+
required: true
9+
type: string
10+
task:
11+
required: true
12+
type: string
13+
gradleEnterpriseUrl:
14+
required: true
15+
type: string
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Run Gradle Experiment 2
21+
run: |
22+
cd gradle-enterprise-gradle-build-validation
23+
./02-validate-local-build-caching-same-location.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -s ${{ inputs.gradleEnterpriseUrl }}
24+
shell: bash

.github/composite/exp3/action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Run experiment 3
2+
3+
inputs:
4+
repositoryUrl:
5+
required: true
6+
type: string
7+
branch:
8+
required: true
9+
type: string
10+
task:
11+
required: true
12+
type: string
13+
gradleEnterpriseUrl:
14+
required: true
15+
type: string
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Run Gradle Experiment 3
21+
run: |
22+
cd gradle-enterprise-gradle-build-validation
23+
./03-validate-local-build-caching-different-locations.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -s ${{ inputs.gradleEnterpriseUrl }}
24+
shell: bash
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Get latest release
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Get latest release
7+
run: |
8+
downloadUrl=$(curl -s https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep -v maven)
9+
curl -s -L -o gradle-enterprise-gradle-build-validation.zip $downloadUrl
10+
unzip -q -o gradle-enterprise-gradle-build-validation.zip
11+
shell: bash

0 commit comments

Comments
 (0)