@@ -23,7 +23,7 @@ inputs:
23
23
required : false
24
24
retries-on-failure :
25
25
description : ' How many times every command should be retried before giving up'
26
- default : ' 1 '
26
+ default : ' 2 '
27
27
required : false
28
28
wait-between-retries :
29
29
description : ' How many seconds to wait after a step failure before attempting a new run'
@@ -152,14 +152,20 @@ runs:
152
152
key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
153
153
restore-keys : |
154
154
${{ runner.os }}-gradle-
155
+ - name : Compute the heredoc id
156
+ id : hd-id
157
+ shell : bash
158
+ run : echo heredoc=${{ github.sha }} >> $GITHUB_OUTPUT
155
159
- name : Pre-build
156
160
working-directory : ${{ inputs.working-directory }}
157
161
shell : bash
158
162
run : |
159
- echo "::group::Pre-build"
160
- COMMAND='${{ inputs.pre-build-command }}'
163
+ echo "::group::Pre-Build"
161
164
for attempt in $(seq 1 "${{ inputs.retries-on-failure}}"); do
162
- $(echo $COMMAND) && break || sleep "${{ inputs.wait-between-retries }}"
165
+ echo "Attempt $attempt/${{ inputs.retries-on-failure }}"
166
+ {
167
+ ${{ inputs.pre-build-command }}
168
+ } && break || sleep "${{ inputs.wait-between-retries }}"
163
169
done
164
170
echo "::endgroup::"
165
171
- name : Build
@@ -169,17 +175,22 @@ runs:
169
175
echo "::group::Build"
170
176
COMMAND='${{ inputs.build-command }}'
171
177
for attempt in $(seq 1 "${{ inputs.retries-on-failure}}"); do
172
- $(echo $COMMAND) && break || sleep "${{ inputs.wait-between-retries }}"
178
+ echo "Attempt $attempt/${{ inputs.retries-on-failure }}"
179
+ {
180
+ ${{ inputs.build-command }}
181
+ } && break || sleep "${{ inputs.wait-between-retries }}"
173
182
done
174
183
echo "::endgroup::"
175
184
- name : Check
176
185
shell : bash
177
186
working-directory : ${{ inputs.working-directory }}
178
187
run : |
179
188
echo "::group::Check"
180
- COMMAND='${{ inputs.check-command }}'
181
189
for attempt in $(seq 1 "${{ inputs.retries-on-failure}}"); do
182
- $(echo $COMMAND) && break || sleep "${{ inputs.wait-between-retries }}"
190
+ echo "Attempt $attempt/${{ inputs.retries-on-failure }}"
191
+ {
192
+ ${{ inputs.check-command }}
193
+ } && break || sleep "${{ inputs.wait-between-retries }}"
183
194
done
184
195
echo "::endgroup::"
185
196
- name : CodeCov
@@ -216,9 +227,11 @@ runs:
216
227
ORG_GRADLE_PROJECT_npmToken : ${{ inputs.npm-token }}
217
228
run : |
218
229
echo "::group::Deploy"
219
- COMMAND='${{ inputs.deploy-command }}'
220
230
for attempt in $(seq 1 "${{ inputs.retries-on-failure}}"); do
221
- $(echo $COMMAND) && break || sleep "${{ inputs.wait-between-retries }}"
231
+ echo "Attempt $attempt/${{ inputs.retries-on-failure }}"
232
+ {
233
+ ${{ inputs.deploy-command }}
234
+ } && break || sleep "${{ inputs.wait-between-retries }}"
222
235
done
223
236
echo "::endgroup::"
224
237
- name : Cleanup
0 commit comments