Skip to content

Commit 7229ea9

Browse files
authored
Expose GitHub summary unconditionally (#821)
1 parent 332c237 commit 7229ea9

File tree

5 files changed

+75
-30
lines changed

5 files changed

+75
-30
lines changed

Diff for: .github/actions/gradle/experiment-1/action.yml

+15-6
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,31 @@ runs:
110113
${ARG_DEVELOCITY_URL:+"-s" "$ARG_DEVELOCITY_URL"} \
111114
${ARG_DEVELOCITY_ENABLE:+"-e"} \
112115
${RUNNER_DEBUG:+"--debug"}
116+
EXPERIMENT_EXIT_CODE=$?
113117
114118
# Set the Build Scan urls as outputs
115-
RECEIPT_FILE=".data/01-validate-incremental-building/latest/exp1-*.receipt"
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+
exit $EXPERIMENT_EXIT_CODE
123126
shell: bash
124127
- name: Archive receipt
125128
id: upload-artifact
126129
uses: actions/upload-artifact@v4
130+
if: always()
127131
with:
128132
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
133+
path: develocity-gradle-build-validation/.data/01-validate-incremental-building/latest/exp1-*.receipt
134+
- name: Fill GitHub summary
135+
if: always()
131136
run: |
132-
echo "-------------" >> $GITHUB_STEP_SUMMARY
133-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
137+
RECEIPT_FILE="develocity-gradle-build-validation/.data/01-validate-incremental-building/latest/exp1-*.receipt"
138+
if [ -f ${RECEIPT_FILE} ]; then
139+
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
140+
echo "-------------" >> $GITHUB_STEP_SUMMARY
141+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
142+
fi
134143
shell: bash

Diff for: .github/actions/gradle/experiment-2/action.yml

+15-6
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,31 @@ 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+
exit $EXPERIMENT_EXIT_CODE
131134
shell: bash
132135
- name: Archive receipt
133136
id: upload-artifact
134137
uses: actions/upload-artifact@v4
138+
if: always()
135139
with:
136140
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
141+
path: develocity-gradle-build-validation/.data/02-validate-local-build-caching-same-location/latest/exp2-*.receipt
142+
- name: Fill GitHub summary
143+
if: always()
139144
run: |
140-
echo "-------------" >> $GITHUB_STEP_SUMMARY
141-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
145+
RECEIPT_FILE="develocity-gradle-build-validation/.data/02-validate-local-build-caching-same-location/latest/exp2-*.receipt"
146+
if [ -f ${RECEIPT_FILE} ]; then
147+
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
148+
echo "-------------" >> $GITHUB_STEP_SUMMARY
149+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
150+
fi
142151
shell: bash

Diff for: .github/actions/gradle/experiment-3/action.yml

+15-6
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,31 @@ 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
129132
130-
cat $RECEIPT_FILE >> $GITHUB_STEP_SUMMARY
133+
exit $EXPERIMENT_EXIT_CODE
131134
shell: bash
132135
- name: Archive receipt
133136
id: upload-artifact
134137
uses: actions/upload-artifact@v4
138+
if: always()
135139
with:
136140
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
141+
path: develocity-gradle-build-validation/.data/03-validate-local-build-caching-different-locations/latest/exp3-*.receipt
142+
- name: Fill GitHub summary
143+
if: always()
139144
run: |
140-
echo "-------------" >> $GITHUB_STEP_SUMMARY
141-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
145+
RECEIPT_FILE="develocity-gradle-build-validation/.data/03-validate-local-build-caching-different-locations/latest/exp3-*.receipt"
146+
if [ -f ${RECEIPT_FILE} ]; then
147+
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
148+
echo "-------------" >> $GITHUB_STEP_SUMMARY
149+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
150+
fi
142151
shell: bash

Diff for: .github/actions/maven/experiment-1/action.yml

+15-6
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,31 @@ 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/01-validate-local-build-caching-same-location/latest/exp1-*.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+
exit $EXPERIMENT_EXIT_CODE
131134
shell: bash
132135
- name: Archive receipt
133136
id: upload-artifact
134137
uses: actions/upload-artifact@v4
138+
if: always()
135139
with:
136140
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
141+
path: develocity-maven-build-validation/.data/01-validate-local-build-caching-same-location/latest/exp1-*.receipt
142+
- name: Fill GitHub summary
143+
if: always()
139144
run: |
140-
echo "-------------" >> $GITHUB_STEP_SUMMARY
141-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
145+
RECEIPT_FILE="develocity-maven-build-validation/.data/01-validate-local-build-caching-same-location/latest/exp1-*.receipt"
146+
if [ -f ${RECEIPT_FILE} ]; then
147+
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
148+
echo "-------------" >> $GITHUB_STEP_SUMMARY
149+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
150+
fi
142151
shell: bash

Diff for: .github/actions/maven/experiment-2/action.yml

+15-6
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,31 @@ 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-different-locations/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+
exit $EXPERIMENT_EXIT_CODE
131134
shell: bash
132135
- name: Archive receipt
133136
id: upload-artifact
134137
uses: actions/upload-artifact@v4
138+
if: always()
135139
with:
136140
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
141+
path: develocity-maven-build-validation/.data/02-validate-local-build-caching-different-locations/latest/exp2-*.receipt
142+
- name: Fill GitHub summary
143+
if: always()
139144
run: |
140-
echo "-------------" >> $GITHUB_STEP_SUMMARY
141-
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
145+
RECEIPT_FILE="develocity-maven-build-validation/.data/02-validate-local-build-caching-different-locations/latest/exp2-*.receipt"
146+
if [ -f ${RECEIPT_FILE} ]; then
147+
cat ${RECEIPT_FILE} >> $GITHUB_STEP_SUMMARY
148+
echo "-------------" >> $GITHUB_STEP_SUMMARY
149+
echo "Download receipt: ${{ steps.upload-artifact.outputs.artifact-url }}" >> $GITHUB_STEP_SUMMARY
150+
fi
142151
shell: bash

0 commit comments

Comments
 (0)