Skip to content

Commit b940106

Browse files
committed
Add both build scan identifiers as output
Signed-off-by: Jerome Prinet <jprinet@gradle.com>
1 parent 1a140c6 commit b940106

File tree

3 files changed

+42
-26
lines changed

3 files changed

+42
-26
lines changed

.github/composite/exp1/action.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Run experiment 1
2-
description: 'Run Gradle Experiment 1'
2+
description: "Run Gradle Experiment 1"
33

44
inputs:
55
repositoryUrl:
@@ -19,9 +19,12 @@ inputs:
1919
description: "Gradle Enterprise URL"
2020
required: true
2121
outputs:
22-
secondBuildScanUrl:
23-
description: "Second build scan URL"
24-
value: ${{ steps.run.outputs.secondBuildScanUrl }}
22+
buildScanId1:
23+
description: "First build scan identifier"
24+
value: ${{ steps.run.outputs.buildScanId1 }}
25+
buildScanId2:
26+
description: "Second build scan identifier"
27+
value: ${{ steps.run.outputs.buildScanId2 }}
2528

2629
runs:
2730
using: "composite"
@@ -31,15 +34,16 @@ runs:
3134
run: |
3235
cd gradle-enterprise-gradle-build-validation
3336
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+
# add instructions to save build scan urls
38+
BUILD_SCAN_FILE_1=$(pwd)/exp1-build-scan-url-1.txt
39+
BUILD_SCAN_FILE_2=$(pwd)/exp1-build-scan-url-2.txt
40+
echo "echo \${build_scan_urls[0]} > ${BUILD_SCAN_FILE_1}" >> 01-validate-incremental-building.sh
41+
echo "echo \${build_scan_urls[1]} > ${BUILD_SCAN_FILE_2}" >> 01-validate-incremental-building.sh
3742
3843
# run experiment
3944
./01-validate-incremental-building.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -p ${{ inputs.projectDir }} -s ${{ inputs.gradleEnterpriseUrl }}
4045
41-
cat $BUILD_SCAN_FILE
42-
4346
# set scan url as output
44-
echo "::set-output name=secondBuildScanUrl::$(cat ${BUILD_SCAN_FILE})"
47+
echo "::set-output name=buildScanId1::$(cat ${BUILD_SCAN_FILE_1} | sed 's:.*/::')"
48+
echo "::set-output name=buildScanId2::$(cat ${BUILD_SCAN_FILE_2} | sed 's:.*/::')"
4549
shell: bash

.github/composite/exp2/action.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Run experiment 2
2-
description: 'Run Gradle Experiment 2'
2+
description: "Run Gradle Experiment 2"
33

44
inputs:
55
repositoryUrl:
@@ -19,9 +19,12 @@ inputs:
1919
description: "Gradle Enterprise URL"
2020
required: true
2121
outputs:
22-
secondBuildScanUrl:
23-
description: "Second build scan URL"
24-
value: ${{ steps.run.outputs.secondBuildScanUrl }}
22+
buildScanId1:
23+
description: "First build scan identifier"
24+
value: ${{ steps.run.outputs.buildScanId1 }}
25+
buildScanId2:
26+
description: "Second build scan identifier"
27+
value: ${{ steps.run.outputs.buildScanId2 }}
2528

2629
runs:
2730
using: "composite"
@@ -31,13 +34,16 @@ runs:
3134
run: |
3235
cd gradle-enterprise-gradle-build-validation
3336
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+
# add instructions to save build scan urls
38+
BUILD_SCAN_FILE_1=$(pwd)/exp2-build-scan-url-1.txt
39+
BUILD_SCAN_FILE_2=$(pwd)/exp2-build-scan-url-2.txt
40+
echo "echo \${build_scan_urls[0]} > ${BUILD_SCAN_FILE_1}" >> 02-validate-local-build-caching-same-location.sh
41+
echo "echo \${build_scan_urls[1]} > ${BUILD_SCAN_FILE_2}" >> 02-validate-local-build-caching-same-location.sh
3742
3843
# run experiment
3944
./02-validate-local-build-caching-same-location.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -p ${{ inputs.projectDir }} -s ${{ inputs.gradleEnterpriseUrl }}
4045
4146
# set scan url as output
42-
echo "::set-output name=secondBuildScanUrl::$(cat ${BUILD_SCAN_FILE})"
47+
echo "::set-output name=buildScanId1::$(cat ${BUILD_SCAN_FILE_1} | sed 's:.*/::')"
48+
echo "::set-output name=buildScanId2::$(cat ${BUILD_SCAN_FILE_2} | sed 's:.*/::')"
4349
shell: bash

.github/composite/exp3/action.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Run experiment 3
2-
description: 'Run Gradle Experiment 3'
2+
description: "Run Gradle Experiment 3"
33

44
inputs:
55
repositoryUrl:
@@ -19,9 +19,12 @@ inputs:
1919
description: "Gradle Enterprise URL"
2020
required: true
2121
outputs:
22-
secondBuildScanUrl:
23-
description: "Second build scan URL"
24-
value: ${{ steps.run.outputs.secondBuildScanUrl }}
22+
buildScanId1:
23+
description: "First build scan identifier"
24+
value: ${{ steps.run.outputs.buildScanId1 }}
25+
buildScanId2:
26+
description: "Second build scan identifier"
27+
value: ${{ steps.run.outputs.buildScanId2 }}
2528

2629
runs:
2730
using: "composite"
@@ -31,13 +34,16 @@ runs:
3134
run: |
3235
cd gradle-enterprise-gradle-build-validation
3336
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+
# add instructions to save build scan urls
38+
BUILD_SCAN_FILE_1=$(pwd)/exp3-build-scan-url-1.txt
39+
BUILD_SCAN_FILE_2=$(pwd)/exp3-build-scan-url-2.txt
40+
echo "echo \${build_scan_urls[0]} > ${BUILD_SCAN_FILE_1}" >> 03-validate-local-build-caching-different-locations.sh
41+
echo "echo \${build_scan_urls[1]} > ${BUILD_SCAN_FILE_2}" >> 03-validate-local-build-caching-different-locations.sh
3742
3843
# run experiment
3944
./03-validate-local-build-caching-different-locations.sh -r ${{ inputs.repositoryUrl }} -b ${{ inputs.branch }} -t ${{ inputs.task }} -p ${{ inputs.projectDir }} -s ${{ inputs.gradleEnterpriseUrl }}
4045
4146
# set scan url as output
42-
echo "::set-output name=secondBuildScanUrl::$(cat ${BUILD_SCAN_FILE})"
47+
echo "::set-output name=buildScanId1::$(cat ${BUILD_SCAN_FILE_1} | sed 's:.*/::')"
48+
echo "::set-output name=buildScanId2::$(cat ${BUILD_SCAN_FILE_2} | sed 's:.*/::')"
4349
shell: bash

0 commit comments

Comments
 (0)