Skip to content

Commit 8d29d06

Browse files
committed
Expose report unconditionally
1 parent c9eaf83 commit 8d29d06

File tree

5 files changed

+103
-33
lines changed

5 files changed

+103
-33
lines changed

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ runs:
9898
# Navigate into the folder containing the validation scripts
9999
cd develocity-gradle-build-validation
100100
101+
# Do not exit on error to allow post-actions
102+
set +e
103+
101104
# Run the experiment
102105
./01-validate-incremental-building.sh \
103106
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -110,25 +113,36 @@ runs:
110113
${ARG_DEVELOCITY_URL:+"-s" "$ARG_DEVELOCITY_URL"} \
111114
${ARG_DEVELOCITY_ENABLE:+"-e"} \
112115
${RUNNER_DEBUG:+"--debug"}
116+
EXPERIMENT_EXIT_CODE=$?
113117
114-
# Set the Build Scan urls as outputs
115-
RECEIPT_FILE=".data/01-validate-incremental-building/latest/exp1-*.receipt"
118+
# Set step outputs
116119
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
117120
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
118121
119122
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
120123
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
121124
122-
cat $RECEIPT_FILE >> $GITHUB_STEP_SUMMARY
125+
# Copy receipt to a predictable location
126+
RECEIPT_FILE=".data/01-validate-incremental-building/latest/exp1-*.receipt"
127+
if [ -f ${RECEIPT_FILE} ]; then
128+
cp ${RECEIPT_FILE} ../receipt.txt
129+
fi
130+
131+
exit $EXPERIMENT_EXIT_CODE
123132
shell: bash
124133
- name: Archive receipt
125134
id: upload-artifact
126135
uses: actions/upload-artifact@v4
136+
if: always()
127137
with:
128138
name: experiment-1-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
129-
path: develocity-gradle-build-validation/.data/01-validate-incremental-building/latest*/exp1-*.receipt
130-
- name: Add artifact link to summary
139+
path: receipt.txt
140+
- name: Fill GitHub summary
141+
if: always()
131142
run: |
132-
echo "-------------" >> $GITHUB_STEP_SUMMARY
133-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
143+
if [ -f "receipt.txt" ]; then
144+
cat receipt.txt >> $GITHUB_STEP_SUMMARY
145+
echo "-------------" >> $GITHUB_STEP_SUMMARY
146+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
147+
fi
134148
shell: bash

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ runs:
105105
# Navigate into the folder containing the validation scripts
106106
cd develocity-gradle-build-validation
107107
108+
# Do not exit on error to allow post-actions
109+
set +e
110+
108111
# Run the experiment
109112
./02-validate-local-build-caching-same-location.sh \
110113
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -118,25 +121,36 @@ runs:
118121
${ARG_DEVELOCITY_ENABLE:+"-e"} \
119122
${ARG_FAIL_IF_NOT_FULLY_CACHEABLE:+"-f"} \
120123
${RUNNER_DEBUG:+"--debug"}
124+
EXPERIMENT_EXIT_CODE=$?
121125
122126
# Set the Build Scan urls as outputs
123-
RECEIPT_FILE=".data/02-validate-local-build-caching-same-location/latest/exp2-*.receipt"
124127
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
125128
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
126129
127130
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
128131
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
129132
130-
cat $RECEIPT_FILE >> $GITHUB_STEP_SUMMARY
133+
# Copy receipt to a predictable location
134+
RECEIPT_FILE=".data/02-validate-local-build-caching-same-location/latest/exp2-*.receipt"
135+
if [ -f ${RECEIPT_FILE} ]; then
136+
cp ${RECEIPT_FILE} ../receipt.txt
137+
fi
138+
139+
exit $EXPERIMENT_EXIT_CODE
131140
shell: bash
132141
- name: Archive receipt
133142
id: upload-artifact
134143
uses: actions/upload-artifact@v4
144+
if: always()
135145
with:
136146
name: experiment-2-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
137-
path: develocity-gradle-build-validation/.data/02-validate-local-build-caching-same-location/latest*/exp2-*.receipt
138-
- name: Add artifact link to summary
147+
path: receipt.txt
148+
- name: Fill GitHub summary
149+
if: always()
139150
run: |
140-
echo "-------------" >> $GITHUB_STEP_SUMMARY
141-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
151+
if [ -f "receipt.txt" ]; then
152+
cat receipt.txt >> $GITHUB_STEP_SUMMARY
153+
echo "-------------" >> $GITHUB_STEP_SUMMARY
154+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
155+
fi
142156
shell: bash

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ runs:
105105
# Navigate into the folder containing the validation scripts
106106
cd develocity-gradle-build-validation
107107
108+
# Do not exit on error to allow post-actions
109+
set +e
110+
108111
# Run the experiment
109112
./03-validate-local-build-caching-different-locations.sh \
110113
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -118,25 +121,36 @@ runs:
118121
${ARG_DEVELOCITY_ENABLE:+"-e"} \
119122
${ARG_FAIL_IF_NOT_FULLY_CACHEABLE:+"-f"} \
120123
${RUNNER_DEBUG:+"--debug"}
124+
EXPERIMENT_EXIT_CODE=$?
121125
122126
# Set the Build Scan urls as outputs
123-
RECEIPT_FILE=".data/03-validate-local-build-caching-different-locations/latest/exp3-*.receipt"
124127
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
125128
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
126129
127130
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
128131
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
132+
133+
# Copy receipt to a predictable location
134+
RECEIPT_FILE=".data/03-validate-local-build-caching-different-locations/latest/exp3-*.receipt"
135+
if [ -f ${RECEIPT_FILE} ]; then
136+
cp ${RECEIPT_FILE} ../receipt.txt
137+
fi
129138
130-
cat $RECEIPT_FILE >> $GITHUB_STEP_SUMMARY
139+
exit $EXPERIMENT_EXIT_CODE
131140
shell: bash
132141
- name: Archive receipt
133142
id: upload-artifact
134143
uses: actions/upload-artifact@v4
144+
if: always()
135145
with:
136146
name: experiment-3-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
137-
path: develocity-gradle-build-validation/.data/03-validate-local-build-caching-different-locations/latest*/exp3-*.receipt
138-
- name: Add artifact link to summary
147+
path: receipt.txt
148+
- name: Fill GitHub summary
149+
if: always()
139150
run: |
140-
echo "-------------" >> $GITHUB_STEP_SUMMARY
141-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
151+
if [ -f "receipt.txt" ]; then
152+
cat receipt.txt >> $GITHUB_STEP_SUMMARY
153+
echo "-------------" >> $GITHUB_STEP_SUMMARY
154+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
155+
fi
142156
shell: bash

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ runs:
105105
# Navigate into the folder containing the validation scripts
106106
cd develocity-maven-build-validation
107107
108+
# Do not exit on error to allow post-actions
109+
set +e
110+
108111
# Run the experiment
109112
./01-validate-local-build-caching-same-location.sh \
110113
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -118,25 +121,36 @@ runs:
118121
${ARG_DEVELOCITY_ENABLE:+"-e"} \
119122
${ARG_FAIL_IF_NOT_FULLY_CACHEABLE:+"-f"} \
120123
${RUNNER_DEBUG:+"--debug"}
124+
EXPERIMENT_EXIT_CODE=$?
121125
122-
# Set the Build Scan urls as outputs
123-
RECEIPT_FILE=".data/01-validate-local-build-caching-same-location/latest/exp1-*.receipt"
126+
# Set step outputs
124127
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
125128
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
126129
127130
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
128131
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
129132
130-
cat $RECEIPT_FILE >> $GITHUB_STEP_SUMMARY
133+
# Copy receipt to a predictable location
134+
RECEIPT_FILE=".data/01-validate-local-build-caching-same-location/latest/exp1-*.receipt"
135+
if [ -f ${RECEIPT_FILE} ]; then
136+
cp ${RECEIPT_FILE} ../receipt.txt
137+
fi
138+
139+
exit $EXPERIMENT_EXIT_CODE
131140
shell: bash
132141
- name: Archive receipt
133142
id: upload-artifact
134143
uses: actions/upload-artifact@v4
144+
if: always()
135145
with:
136146
name: experiment-1-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
137-
path: develocity-maven-build-validation/.data/01-validate-local-build-caching-same-location/latest*/exp1-*.receipt
138-
- name: Add artifact link to summary
147+
path: receipt.txt
148+
- name: Fill GitHub summary
149+
if: always()
139150
run: |
140-
echo "-------------" >> $GITHUB_STEP_SUMMARY
141-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
151+
if [ -f "receipt.txt" ]; then
152+
cat receipt.txt >> $GITHUB_STEP_SUMMARY
153+
echo "-------------" >> $GITHUB_STEP_SUMMARY
154+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
155+
fi
142156
shell: bash

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ runs:
105105
# Navigate into the folder containing the validation scripts
106106
cd develocity-maven-build-validation
107107
108+
# Do not exit on error to allow post-actions
109+
set +e
110+
108111
# Run the experiment
109112
./02-validate-local-build-caching-different-locations.sh \
110113
${ARG_GIT_REPO:+"-r" "$ARG_GIT_REPO"} \
@@ -118,25 +121,36 @@ runs:
118121
${ARG_DEVELOCITY_ENABLE:+"-e"} \
119122
${ARG_FAIL_IF_NOT_FULLY_CACHEABLE:+"-f"} \
120123
${RUNNER_DEBUG:+"--debug"}
124+
EXPERIMENT_EXIT_CODE=$?
121125
122-
# Set the Build Scan urls as outputs
123-
RECEIPT_FILE=".data/02-validate-local-build-caching-different-locations/latest/exp2-*.receipt"
126+
# Set step outputs
124127
BUILD_SCAN_1=$(grep -m 1 "first build" ${RECEIPT_FILE} | sed 's/.* //')
125128
BUILD_SCAN_2=$(grep -m 1 "second build" ${RECEIPT_FILE} | sed 's/.* //')
126129
127130
echo "buildScanFirstBuild=$BUILD_SCAN_1" >> $GITHUB_OUTPUT
128131
echo "buildScanSecondBuild=$BUILD_SCAN_2" >> $GITHUB_OUTPUT
129132
130-
cat $RECEIPT_FILE >> $GITHUB_STEP_SUMMARY
133+
# Copy receipt to a predictable location
134+
RECEIPT_FILE=".data/02-validate-local-build-caching-different-locations/latest/exp2-*.receipt"
135+
if [ -f ${RECEIPT_FILE} ]; then
136+
cp ${RECEIPT_FILE} ../receipt.txt
137+
fi
138+
139+
exit $EXPERIMENT_EXIT_CODE
131140
shell: bash
132141
- name: Archive receipt
133142
id: upload-artifact
134143
uses: actions/upload-artifact@v4
144+
if: always()
135145
with:
136146
name: experiment-2-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }}
137-
path: develocity-maven-build-validation/.data/02-validate-local-build-caching-different-locations/latest*/exp2-*.receipt
138-
- name: Add artifact link to summary
147+
path: receipt.txt
148+
- name: Fill GitHub summary
149+
if: always()
139150
run: |
140-
echo "-------------" >> $GITHUB_STEP_SUMMARY
141-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
151+
if [ -f "receipt.txt" ]; then
152+
cat receipt.txt >> $GITHUB_STEP_SUMMARY
153+
echo "-------------" >> $GITHUB_STEP_SUMMARY
154+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
155+
fi
142156
shell: bash

0 commit comments

Comments
 (0)