Skip to content

Commit c2dad17

Browse files
authored
Move build scan link captures in GitHub summary step (#825)
1 parent 7229ea9 commit c2dad17

File tree

5 files changed

+55
-85
lines changed

5 files changed

+55
-85
lines changed

.github/actions/gradle/experiment-1/action.yml

+11-17
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,15 @@ inputs:
4040
outputs:
4141
buildScanFirstBuild:
4242
description: "First build scan url"
43-
value: ${{ steps.run.outputs.buildScanFirstBuild }}
43+
value: ${{ steps.summary.outputs.buildScanFirstBuild }}
4444
buildScanSecondBuild:
4545
description: "Second build scan url"
46-
value: ${{ steps.run.outputs.buildScanSecondBuild }}
46+
value: ${{ steps.summary.outputs.buildScanSecondBuild }}
4747

4848
runs:
4949
using: "composite"
5050
steps:
5151
- name: Run Gradle Experiment 1
52-
id: run
5352
run: |
5453
# Read the action inputs
5554
ARG_GIT_REPO=""
@@ -98,9 +97,6 @@ runs:
9897
# Navigate into the folder containing the validation scripts
9998
cd develocity-gradle-build-validation
10099
101-
# Do not exit on error to allow post-actions
102-
set +e
103-
104100
# Run the experiment
105101
./01-validate-incremental-building.sh \
106102
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -113,16 +109,6 @@ runs:
113109
${ARG_DEVELOCITY_URL:+"-s" "$ARG_DEVELOCITY_URL"} \
114110
${ARG_DEVELOCITY_ENABLE:+"-e"} \
115111
${RUNNER_DEBUG:+"--debug"}
116-
EXPERIMENT_EXIT_CODE=$?
117-
118-
# Set the Build Scan urls as outputs
119-
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
120-
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
121-
122-
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
123-
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
124-
125-
exit $EXPERIMENT_EXIT_CODE
126112
shell: bash
127113
- name: Archive receipt
128114
id: upload-artifact
@@ -131,13 +117,21 @@ runs:
131117
with:
132118
name: experiment-1-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
133119
path: develocity-gradle-build-validation/.data/01-validate-incremental-building/latest/exp1-*.receipt
134-
- name: Fill GitHub summary
120+
- name: Fill GitHub summary and outputs
121+
id: summary
135122
if: always()
136123
run: |
137124
RECEIPT_FILE="develocity-gradle-build-validation/.data/01-validate-incremental-building/latest/exp1-*.receipt"
138125
if [ -f ${RECEIPT_FILE} ]; then
139126
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
140127
echo "-------------" >> $GITHUB_STEP_SUMMARY
141128
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
129+
130+
# Set the Build Scan urls as outputs
131+
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
132+
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
133+
134+
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
135+
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
142136
fi
143137
shell: bash

.github/actions/gradle/experiment-2/action.yml

+11-17
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@ inputs:
4343
outputs:
4444
buildScanFirstBuild:
4545
description: "First build scan url"
46-
value: ${{ steps.run.outputs.buildScanFirstBuild }}
46+
value: ${{ steps.summary.outputs.buildScanFirstBuild }}
4747
buildScanSecondBuild:
4848
description: "Second build scan url"
49-
value: ${{ steps.run.outputs.buildScanSecondBuild }}
49+
value: ${{ steps.summary.outputs.buildScanSecondBuild }}
5050

5151
runs:
5252
using: "composite"
5353
steps:
5454
- name: Run Gradle Experiment 2
55-
id: run
5655
run: |
5756
# Read the action inputs
5857
ARG_GIT_REPO=""
@@ -105,9 +104,6 @@ runs:
105104
# Navigate into the folder containing the validation scripts
106105
cd develocity-gradle-build-validation
107106
108-
# Do not exit on error to allow post-actions
109-
set +e
110-
111107
# Run the experiment
112108
./02-validate-local-build-caching-same-location.sh \
113109
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -121,16 +117,6 @@ runs:
121117
${ARG_DEVELOCITY_ENABLE:+"-e"} \
122118
${ARG_FAIL_IF_NOT_FULLY_CACHEABLE:+"-f"} \
123119
${RUNNER_DEBUG:+"--debug"}
124-
EXPERIMENT_EXIT_CODE=$?
125-
126-
# Set the Build Scan urls as outputs
127-
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
128-
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
129-
130-
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
131-
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
132-
133-
exit $EXPERIMENT_EXIT_CODE
134120
shell: bash
135121
- name: Archive receipt
136122
id: upload-artifact
@@ -139,13 +125,21 @@ runs:
139125
with:
140126
name: experiment-2-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
141127
path: develocity-gradle-build-validation/.data/02-validate-local-build-caching-same-location/latest/exp2-*.receipt
142-
- name: Fill GitHub summary
128+
- name: Fill GitHub summary and outputs
129+
id: summary
143130
if: always()
144131
run: |
145132
RECEIPT_FILE="develocity-gradle-build-validation/.data/02-validate-local-build-caching-same-location/latest/exp2-*.receipt"
146133
if [ -f ${RECEIPT_FILE} ]; then
147134
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
148135
echo "-------------" >> $GITHUB_STEP_SUMMARY
149136
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
137+
138+
# Set the Build Scan urls as outputs
139+
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
140+
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
141+
142+
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
143+
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
150144
fi
151145
shell: bash

.github/actions/gradle/experiment-3/action.yml

+11-17
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@ inputs:
4343
outputs:
4444
buildScanFirstBuild:
4545
description: "First build scan url"
46-
value: ${{ steps.run.outputs.buildScanFirstBuild }}
46+
value: ${{ steps.summary.outputs.buildScanFirstBuild }}
4747
buildScanSecondBuild:
4848
description: "Second build scan url"
49-
value: ${{ steps.run.outputs.buildScanSecondBuild }}
49+
value: ${{ steps.summary.outputs.buildScanSecondBuild }}
5050

5151
runs:
5252
using: "composite"
5353
steps:
5454
- name: Run Gradle Experiment 3
55-
id: run
5655
run: |
5756
# Read the action inputs
5857
ARG_GIT_REPO=""
@@ -105,9 +104,6 @@ runs:
105104
# Navigate into the folder containing the validation scripts
106105
cd develocity-gradle-build-validation
107106
108-
# Do not exit on error to allow post-actions
109-
set +e
110-
111107
# Run the experiment
112108
./03-validate-local-build-caching-different-locations.sh \
113109
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -121,16 +117,6 @@ runs:
121117
${ARG_DEVELOCITY_ENABLE:+"-e"} \
122118
${ARG_FAIL_IF_NOT_FULLY_CACHEABLE:+"-f"} \
123119
${RUNNER_DEBUG:+"--debug"}
124-
EXPERIMENT_EXIT_CODE=$?
125-
126-
# Set the Build Scan urls as outputs
127-
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
128-
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
129-
130-
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
131-
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
132-
133-
exit $EXPERIMENT_EXIT_CODE
134120
shell: bash
135121
- name: Archive receipt
136122
id: upload-artifact
@@ -139,13 +125,21 @@ runs:
139125
with:
140126
name: experiment-3-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
141127
path: develocity-gradle-build-validation/.data/03-validate-local-build-caching-different-locations/latest/exp3-*.receipt
142-
- name: Fill GitHub summary
128+
- name: Fill GitHub summary and outputs
129+
id: summary
143130
if: always()
144131
run: |
145132
RECEIPT_FILE="develocity-gradle-build-validation/.data/03-validate-local-build-caching-different-locations/latest/exp3-*.receipt"
146133
if [ -f ${RECEIPT_FILE} ]; then
147134
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
148135
echo "-------------" >> $GITHUB_STEP_SUMMARY
149136
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
137+
138+
# Set the Build Scan urls as outputs
139+
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
140+
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
141+
142+
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
143+
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
150144
fi
151145
shell: bash

.github/actions/maven/experiment-1/action.yml

+11-17
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@ inputs:
4343
outputs:
4444
buildScanFirstBuild:
4545
description: "First build scan url"
46-
value: ${{ steps.run.outputs.buildScanFirstBuild }}
46+
value: ${{ steps.summary.outputs.buildScanFirstBuild }}
4747
buildScanSecondBuild:
4848
description: "Second build scan url"
49-
value: ${{ steps.run.outputs.buildScanSecondBuild }}
49+
value: ${{ steps.summary.outputs.buildScanSecondBuild }}
5050

5151
runs:
5252
using: "composite"
5353
steps:
5454
- name: Run Maven Experiment 1
55-
id: run
5655
run: |
5756
# Read the action inputs
5857
ARG_GIT_REPO=""
@@ -105,9 +104,6 @@ runs:
105104
# Navigate into the folder containing the validation scripts
106105
cd develocity-maven-build-validation
107106
108-
# Do not exit on error to allow post-actions
109-
set +e
110-
111107
# Run the experiment
112108
./01-validate-local-build-caching-same-location.sh \
113109
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -121,16 +117,6 @@ runs:
121117
${ARG_DEVELOCITY_ENABLE:+"-e"} \
122118
${ARG_FAIL_IF_NOT_FULLY_CACHEABLE:+"-f"} \
123119
${RUNNER_DEBUG:+"--debug"}
124-
EXPERIMENT_EXIT_CODE=$?
125-
126-
# Set the Build Scan urls as outputs
127-
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
128-
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
129-
130-
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
131-
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
132-
133-
exit $EXPERIMENT_EXIT_CODE
134120
shell: bash
135121
- name: Archive receipt
136122
id: upload-artifact
@@ -139,13 +125,21 @@ runs:
139125
with:
140126
name: experiment-1-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
141127
path: develocity-maven-build-validation/.data/01-validate-local-build-caching-same-location/latest/exp1-*.receipt
142-
- name: Fill GitHub summary
128+
- name: Fill GitHub summary and outputs
129+
id: summary
143130
if: always()
144131
run: |
145132
RECEIPT_FILE="develocity-maven-build-validation/.data/01-validate-local-build-caching-same-location/latest/exp1-*.receipt"
146133
if [ -f ${RECEIPT_FILE} ]; then
147134
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
148135
echo "-------------" >> $GITHUB_STEP_SUMMARY
149136
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
137+
138+
# Set the Build Scan urls as outputs
139+
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
140+
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
141+
142+
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
143+
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
150144
fi
151145
shell: bash

.github/actions/maven/experiment-2/action.yml

+11-17
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@ inputs:
4343
outputs:
4444
buildScanFirstBuild:
4545
description: "First build scan url"
46-
value: ${{ steps.run.outputs.buildScanFirstBuild }}
46+
value: ${{ steps.summary.outputs.buildScanFirstBuild }}
4747
buildScanSecondBuild:
4848
description: "Second build scan url"
49-
value: ${{ steps.run.outputs.buildScanSecondBuild }}
49+
value: ${{ steps.summary.outputs.buildScanSecondBuild }}
5050

5151
runs:
5252
using: "composite"
5353
steps:
5454
- name: Run Maven Experiment 2
55-
id: run
5655
run: |
5756
# Read the action inputs
5857
ARG_GIT_REPO=""
@@ -105,9 +104,6 @@ runs:
105104
# Navigate into the folder containing the validation scripts
106105
cd develocity-maven-build-validation
107106
108-
# Do not exit on error to allow post-actions
109-
set +e
110-
111107
# Run the experiment
112108
./02-validate-local-build-caching-different-locations.sh \
113109
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -121,16 +117,6 @@ runs:
121117
${ARG_DEVELOCITY_ENABLE:+"-e"} \
122118
${ARG_FAIL_IF_NOT_FULLY_CACHEABLE:+"-f"} \
123119
${RUNNER_DEBUG:+"--debug"}
124-
EXPERIMENT_EXIT_CODE=$?
125-
126-
# Set the Build Scan urls as outputs
127-
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
128-
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
129-
130-
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
131-
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
132-
133-
exit $EXPERIMENT_EXIT_CODE
134120
shell: bash
135121
- name: Archive receipt
136122
id: upload-artifact
@@ -139,13 +125,21 @@ runs:
139125
with:
140126
name: experiment-2-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
141127
path: develocity-maven-build-validation/.data/02-validate-local-build-caching-different-locations/latest/exp2-*.receipt
142-
- name: Fill GitHub summary
128+
- name: Fill GitHub summary and outputs
129+
id: summary
143130
if: always()
144131
run: |
145132
RECEIPT_FILE="develocity-maven-build-validation/.data/02-validate-local-build-caching-different-locations/latest/exp2-*.receipt"
146133
if [ -f ${RECEIPT_FILE} ]; then
147134
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
148135
echo "-------------" >> $GITHUB_STEP_SUMMARY
149136
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
137+
138+
# Set the Build Scan urls as outputs
139+
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
140+
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | grep -o 'http.\S\+')
141+
142+
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
143+
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
150144
fi
151145
shell: bash

0 commit comments

Comments
 (0)