Skip to content

Commit d3d1172

Browse files
committed
Add Cache inputs to composite Experiment 5
Signed-off-by: Jerome Prinet <jprinet@gradle.com>
1 parent 2dfb479 commit d3d1172

File tree

5 files changed

+103
-25
lines changed

5 files changed

+103
-25
lines changed

.github/composite/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Create a Github Action workflow, fulfilling the build requirements (add JDK...)
99
```yaml
1010
steps:
1111
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/composite/getLatest@v1.0.2
12+
with:
13+
token: ${{ secrets.GITHUB_TOKEN }}
1214
- uses: gradle/gradle-enterprise-build-validation-scripts/.github/composite/exp1@v1.0.2
1315
with:
1416
repositoryUrl: <PROJECT_GIT_URL>

.github/composite/exp1/action.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,46 @@ description: 'Run Gradle Experiment 1'
33

44
inputs:
55
repositoryUrl:
6-
description: Project repository URL
6+
description: "Project repository URL"
77
required: true
88
branch:
9-
description: Git Branch
9+
description: "Git Branch"
1010
required: true
1111
task:
12-
description: Gradle task
12+
description: "Gradle task"
1313
required: true
1414
projectDir:
15-
description: Project directory
15+
description: "Project directory"
1616
required: false
1717
default: .
1818
gradleEnterpriseUrl:
19-
description: Gradle Enterprise URL
19+
description: "Gradle Enterprise URL"
2020
required: true
21+
outputs:
22+
secondBuildScanUrl:
23+
description: "Second build scan URL"
24+
value: ${{ steps.run.outputs.secondBuildScanUrl }}
2125

2226
runs:
2327
using: "composite"
2428
steps:
2529
- name: Run Gradle Experiment 1
30+
id: run
2631
run: |
2732
cd gradle-enterprise-gradle-build-validation
33+
34+
# add instruction to save build scan url
35+
BUILD_SCAN_FILE=$(pwd)/build-scan-url.txt
36+
echo "echo \$build_scan_urls > ${BUILD_SCAN_FILE}" >> 01-validate-incremental-building.sh
37+
38+
echo $BUILD_SCAN_FILE
39+
cat 01-validate-incremental-building.sh
40+
41+
# run experiment
2842
./01-validate-incremental-building.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -p ${{ inputs.projectDir }} -s ${{ inputs.gradleEnterpriseUrl }}
43+
44+
cat $BUILD_SCAN_FILE
45+
46+
# set scan url as output
47+
echo "::set-output name=secondBuildScanUrl::$(cat ${BUILD_SCAN_FILE})"
2948
shell: bash

.github/composite/exp2/action.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,41 @@ description: 'Run Gradle Experiment 2'
33

44
inputs:
55
repositoryUrl:
6-
description: Project repository URL
6+
description: "Project repository URL"
77
required: true
88
branch:
9-
description: Git Branch
9+
description: "Git Branch"
1010
required: true
1111
task:
12-
description: Gradle task
12+
description: "Gradle task"
1313
required: true
1414
projectDir:
15-
description: Project directory
15+
description: "Project directory"
1616
required: false
1717
default: .
1818
gradleEnterpriseUrl:
19-
description: Gradle Enterprise URL
19+
description: "Gradle Enterprise URL"
2020
required: true
21+
outputs:
22+
secondBuildScanUrl:
23+
description: "Second build scan URL"
24+
value: ${{ steps.run.outputs.secondBuildScanUrl }}
2125

2226
runs:
2327
using: "composite"
2428
steps:
2529
- name: Run Gradle Experiment 2
30+
id: run
2631
run: |
2732
cd gradle-enterprise-gradle-build-validation
33+
34+
# add instruction to save build scan url
35+
BUILD_SCAN_FILE=$(pwd)/build-scan-url.txt
36+
echo "echo \$build_scan_urls > ${BUILD_SCAN_FILE}" >> 02-validate-local-build-caching-same-location.sh
37+
38+
# run experiment
2839
./02-validate-local-build-caching-same-location.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -p ${{ inputs.projectDir }} -s ${{ inputs.gradleEnterpriseUrl }}
40+
41+
# set scan url as output
42+
echo "::set-output name=random-id::$(cat ${BUILD_SCAN_FILE})"
2943
shell: bash

.github/composite/exp3/action.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,41 @@ description: 'Run Gradle Experiment 3'
33

44
inputs:
55
repositoryUrl:
6-
description: Project repository URL
6+
description: "Project repository URL"
77
required: true
88
branch:
9-
description: Git Branch
9+
description: "Git Branch"
1010
required: true
1111
task:
12-
description: Gradle task
12+
description: "Gradle task"
1313
required: true
1414
projectDir:
15-
description: Project directory
15+
description: "Project directory"
1616
required: false
1717
default: .
1818
gradleEnterpriseUrl:
19-
description: Gradle Enterprise URL
19+
description: "Gradle Enterprise URL"
2020
required: true
21+
outputs:
22+
secondBuildScanUrl:
23+
description: "Second build scan URL"
24+
value: ${{ steps.run.outputs.secondBuildScanUrl }}
2125

2226
runs:
2327
using: "composite"
2428
steps:
2529
- name: Run Gradle Experiment 3
30+
id: run
2631
run: |
2732
cd gradle-enterprise-gradle-build-validation
33+
34+
# add instruction to save build scan url
35+
BUILD_SCAN_FILE=$(pwd)/build-scan-url.txt
36+
echo "echo \$build_scan_urls > ${BUILD_SCAN_FILE}" >> 03-validate-local-build-caching-different-locations.sh
37+
38+
# run experiment
2839
./03-validate-local-build-caching-different-locations.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -p ${{ inputs.projectDir }} -s ${{ inputs.gradleEnterpriseUrl }}
40+
41+
# set scan url as output
42+
echo "::set-output name=random-id::$(cat ${BUILD_SCAN_FILE})"
2943
shell: bash

.github/composite/exp5/action.yml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,65 @@ description: 'Run Gradle Experiment 5'
33

44
inputs:
55
repositoryUrl:
6-
description: Project repository URL
6+
description: "Project repository URL"
77
required: true
88
branch:
9-
description: Git Branch
9+
description: "Git Branch"
1010
required: true
1111
commitId:
12-
description: Commit identifier
12+
description: "Commit identifier"
1313
required: true
1414
task:
15-
description: Gradle task
15+
description: "Gradle task"
1616
required: true
1717
seedUrl:
18-
description: Seed build scan URL
18+
description: "Seed build scan URL"
1919
required: true
2020
projectDir:
21-
description: Project directory
21+
description: "Project directory"
2222
required: false
2323
default: .
2424
gradleEnterpriseUrl:
25-
description: Gradle Enterprise URL
25+
description: "Gradle Enterprise URL"
2626
required: true
27-
gradleCacheNodeUrl:
28-
description: Gradle cache node URL
27+
gradleCacheUrl:
28+
description: "Gradle cache URL"
2929
required: true
30+
gradleCachePush:
31+
description: "Whether to push to remote cache or not"
32+
required: false
33+
default: "false"
34+
gradleCacheUsername:
35+
description: "Gradle cache username"
36+
required: false
37+
gradleCachePassword:
38+
description: "Gradle cache password"
39+
required: false
40+
outputs:
41+
secondBuildScanUrl:
42+
description: "Second build scan URL"
43+
value: ${{ steps.run.outputs.secondBuildScanUrl }}
3044

3145
runs:
3246
using: "composite"
3347
steps:
3448
- name: Run Gradle Experiment 5
49+
id: run
3550
run: |
3651
cd gradle-enterprise-gradle-build-validation
37-
./05-validate-remote-build-caching-ci-local.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -c ${{ inputs.commitId }} -t ${{ inputs.task }} -p ${{ inputs.projectDir }} -1 ${{ inputs.seedUrl }} -s ${{ inputs.gradleEnterpriseUrl }} -u ${{ inputs.gradleCacheNodeUrl }}
52+
53+
# add instruction to save build scan url
54+
BUILD_SCAN_FILE=$(pwd)/build-scan-url.txt
55+
echo "echo \$build_scan_urls > ${BUILD_SCAN_FILE}" >> 05-validate-remote-build-caching-ci-local.sh
56+
57+
# run experiment
58+
./05-validate-remote-build-caching-ci-local.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -c ${{ inputs.commitId }} -t ${{ inputs.task }} -p ${{ inputs.projectDir }} -1 ${{ inputs.seedUrl }} -s ${{ inputs.gradleEnterpriseUrl }} -u ${{ inputs.gradleCacheUrl }}
59+
60+
# set scan url as output
61+
echo "::set-output name=random-id::$(cat ${BUILD_SCAN_FILE})"
62+
env:
63+
GRADLE_CACHE_PUSH: ${{ inputs.gradleCachePush }}
64+
GRADLE_CACHE_URL: ${{ inputs.gradleCacheUrl }}
65+
GRADLE_CACHE_USERNAME: ${{ inputs.gradleCacheUsername }}
66+
GRADLE_CACHE_PASSWORD: ${{ inputs.gradleCachePassword }}
3867
shell: bash

0 commit comments

Comments
 (0)