Skip to content

Commit edb74d8

Browse files
rochdevclaude
andauthored
ci: add upload/download artifact actions with retry (#7126)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c6b6b3b commit edb74d8

8 files changed

Lines changed: 139 additions & 13 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Download artifact (with retry)"
2+
description: "Download artifact with automatic retry on failure"
3+
inputs:
4+
name:
5+
description: "Artifact name to download (empty = all artifacts)"
6+
required: false
7+
default: ''
8+
path:
9+
description: "Destination path"
10+
required: false
11+
default: ''
12+
pattern:
13+
description: "Glob pattern to match artifact names"
14+
required: false
15+
default: ''
16+
merge-multiple:
17+
description: "Merge multiple artifacts into a single directory"
18+
required: false
19+
default: 'false'
20+
21+
runs:
22+
using: composite
23+
steps:
24+
- name: Download artifact (attempt 1)
25+
id: download1
26+
continue-on-error: true
27+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
28+
with:
29+
name: ${{ inputs.name }}
30+
path: ${{ inputs.path }}
31+
pattern: ${{ inputs.pattern }}
32+
merge-multiple: ${{ inputs.merge-multiple }}
33+
- name: Wait before retry (attempt 2)
34+
if: steps.download1.outcome == 'failure'
35+
shell: bash
36+
run: sleep 5
37+
- name: Download artifact (attempt 2)
38+
id: download2
39+
if: steps.download1.outcome == 'failure'
40+
continue-on-error: true
41+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
42+
with:
43+
name: ${{ inputs.name }}
44+
path: ${{ inputs.path }}
45+
pattern: ${{ inputs.pattern }}
46+
merge-multiple: ${{ inputs.merge-multiple }}
47+
- name: Wait before retry (attempt 3)
48+
if: steps.download2.outcome == 'failure'
49+
shell: bash
50+
run: sleep 10
51+
- name: Download artifact (attempt 3)
52+
if: steps.download2.outcome == 'failure'
53+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
54+
with:
55+
name: ${{ inputs.name }}
56+
path: ${{ inputs.path }}
57+
pattern: ${{ inputs.pattern }}
58+
merge-multiple: ${{ inputs.merge-multiple }}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: "Upload artifact (with retry)"
2+
description: "Upload artifact with automatic retry on failure"
3+
inputs:
4+
name:
5+
description: "Artifact name"
6+
required: true
7+
path:
8+
description: "Path(s) to upload"
9+
required: true
10+
retention-days:
11+
description: "Number of days to retain the artifact (empty = repo default)"
12+
required: false
13+
default: ''
14+
if-no-files-found:
15+
description: "Behavior when no files are found: warn, error, or ignore"
16+
required: false
17+
default: 'warn'
18+
include-hidden-files:
19+
description: "Whether to include hidden files in the artifact"
20+
required: false
21+
default: 'false'
22+
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Upload artifact (attempt 1)
27+
id: upload1
28+
continue-on-error: true
29+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
30+
with:
31+
name: ${{ inputs.name }}
32+
path: ${{ inputs.path }}
33+
retention-days: ${{ inputs.retention-days }}
34+
if-no-files-found: ${{ inputs.if-no-files-found }}
35+
include-hidden-files: ${{ inputs.include-hidden-files }}
36+
- name: Wait before retry (attempt 2)
37+
if: steps.upload1.outcome == 'failure'
38+
shell: bash
39+
run: sleep 5
40+
- name: Upload artifact (attempt 2)
41+
id: upload2
42+
if: steps.upload1.outcome == 'failure'
43+
continue-on-error: true
44+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
45+
with:
46+
name: ${{ inputs.name }}
47+
path: ${{ inputs.path }}
48+
retention-days: ${{ inputs.retention-days }}
49+
if-no-files-found: ${{ inputs.if-no-files-found }}
50+
include-hidden-files: ${{ inputs.include-hidden-files }}
51+
- name: Wait before retry (attempt 3)
52+
if: steps.upload2.outcome == 'failure'
53+
shell: bash
54+
run: sleep 10
55+
- name: Upload artifact (attempt 3)
56+
if: steps.upload2.outcome == 'failure'
57+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
58+
with:
59+
name: ${{ inputs.name }}
60+
path: ${{ inputs.path }}
61+
retention-days: ${{ inputs.retention-days }}
62+
if-no-files-found: ${{ inputs.if-no-files-found }}
63+
include-hidden-files: ${{ inputs.include-hidden-files }}

.github/workflows/compute-workflow-parameters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190

191191
- name: Upload artifact
192192
if: ${{ inputs._system_tests_dev_mode }}
193-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
193+
uses: ./.github/actions/upload_artifact
194194
with:
195195
name: binaries_dev_${{ inputs.library }}
196196
path: binaries/

.github/workflows/debug-harness.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
echo "Token file not found — nothing to clean up"
7979
fi
8080
- name: Upload artifact
81-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
81+
uses: ./.github/actions/upload_artifact
8282
with:
8383
name: weblog
8484
path: binaries/
@@ -98,7 +98,7 @@ jobs:
9898
uses: ./.github/actions/install_runner
9999

100100
- name: Get binaries artifact
101-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
101+
uses: ./.github/actions/download_artifact
102102
with:
103103
name: weblog
104104
path: binaries/
@@ -116,7 +116,7 @@ jobs:
116116
117117
- name: Upload artifact
118118
if: steps.build.outcome == 'success' && !cancelled()
119-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
119+
uses: ./.github/actions/upload_artifact
120120
with:
121121
name: logs_${{ matrix.n }}
122122
path: logs_*

.github/workflows/nightly.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ jobs:
5656
- nightly
5757
runs-on: ubuntu-latest
5858
steps:
59+
- name: Checkout
60+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
61+
with:
62+
sparse-checkout: .github/actions
63+
sparse-checkout-cone-mode: false
5964
- name: Download logs artifact
60-
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
65+
uses: ./.github/actions/download_artifact
6166
with:
6267
merge-multiple: false
6368
pattern: logs_*
@@ -69,7 +74,7 @@ jobs:
6974
fi
7075
done
7176
- name: Upload test report
72-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
77+
uses: ./.github/actions/upload_artifact
7378
with:
7479
name: test-report
7580
path: |
@@ -154,7 +159,7 @@ jobs:
154159
fetch-depth: 0
155160
persist-credentials: false
156161

157-
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
162+
- uses: ./.github/actions/download_artifact
158163
with:
159164
name: test-report
160165
path: data

.github/workflows/run-end-to-end.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
uses: ./.github/actions/install_runner
133133
- name: Get binaries artifact
134134
if : ${{ inputs.binaries_artifact != '' }}
135-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
135+
uses: ./.github/actions/download_artifact
136136
with:
137137
name: ${{ inputs.binaries_artifact }}
138138
path: binaries/
@@ -532,7 +532,7 @@ jobs:
532532
fi
533533
- name: Upload artifact
534534
if: steps.compress_logs.outcome == 'success' && !cancelled()
535-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
535+
uses: ./.github/actions/upload_artifact
536536
with:
537537
# log name convention to respect : logs_$SCENARIO-FAMILY_$LIBRARY_$WEBLOG_$CI-ENVIRONMENT
538538
name: ${{ inputs.logs_artifact_name }}

.github/workflows/run-parametric.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
uses: ./.github/actions/install_runner
112112
- name: Get binaries artifact
113113
if : ${{ inputs.binaries_artifact != '' }}
114-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
114+
uses: ./.github/actions/download_artifact
115115
with:
116116
name: ${{ inputs.binaries_artifact }}
117117
path: binaries/
@@ -149,7 +149,7 @@ jobs:
149149
fi
150150
- name: Upload artifact
151151
if: steps.compress_logs.outcome == 'success' && !cancelled()
152-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
152+
uses: ./.github/actions/upload_artifact
153153
with:
154154
name: logs_parametric_${{ inputs.library}}_parametric_${{ inputs.ci_environment }}_${{ matrix.job_instance }}_${{ inputs.unique_id }}
155155
path: artifact.tar.gz

.github/workflows/system-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ jobs:
220220
ref: ${{ steps.compute_ref.outputs.ref }}
221221
- name: Get binaries artifact
222222
if : ${{ needs.compute_parameters.outputs.binaries_artifact != '' }}
223-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
223+
uses: ./.github/actions/download_artifact
224224
with:
225225
name: ${{ needs.compute_parameters.outputs.binaries_artifact }}
226226
path: binaries/
@@ -255,7 +255,7 @@ jobs:
255255
echo "Token file not found — nothing to clean up"
256256
fi
257257
- name: Upload artifact
258-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
258+
uses: ./.github/actions/upload_artifact
259259
with:
260260
name: ${{ matrix.weblog.artifact_name }}
261261
path: binaries/

0 commit comments

Comments
 (0)