@@ -181,27 +181,61 @@ jobs:
181
181
- name : Checkout
182
182
uses : actions/checkout@v4
183
183
184
- # Merge Artifact-A-* from previous jobs
185
- - name : Merge
184
+ # Merge all artifacts from previous jobs
185
+ - name : Merge all artifacts in run
186
186
uses : ./merge/
187
+ with :
188
+ # our matrix produces artifacts with the same file, this prevents "stomping" on each other, also makes it
189
+ # easier to identify each of the merged artifacts
190
+ separate-directories : true
191
+ - name : ' Download merged artifacts'
192
+ uses : actions/download-artifact@v4
187
193
with :
188
194
name : Merged-Artifacts
195
+ path : all-merged-artifacts
196
+ - name : ' Check merged artifact has directories for each artifact'
197
+ run : |
198
+ $artifacts = @(
199
+ "Artifact-A-ubuntu-latest",
200
+ "Artifact-A-macos-latest",
201
+ "Artifact-A-windows-latest",
202
+ "Artifact-Wildcard-ubuntu-latest",
203
+ "Artifact-Wildcard-macos-latest",
204
+ "Artifact-Wildcard-windows-latest",
205
+ "Multi-Path-Artifact-ubuntu-latest",
206
+ "Multi-Path-Artifact-macos-latest",
207
+ "Multi-Path-Artifact-windows-latest"
208
+ )
209
+
210
+ foreach ($artifact in $artifacts) {
211
+ $path = "all-merged-artifacts/$artifact"
212
+ if (!(Test-Path $path)) {
213
+ Write-Error "$path does not exist."
214
+ }
215
+ }
216
+ shell : pwsh
217
+
218
+ # Merge Artifact-A-* from previous jobs
219
+ - name : Merge all Artifact-A
220
+ uses : ./merge/
221
+ with :
222
+ name : Merged-Artifact-As
189
223
pattern : ' Artifact-A-*'
190
224
separate-directories : true
191
225
192
226
# Download merged artifacts and verify the correctness of the content
193
227
- name : ' Download merged artifacts'
194
228
uses : actions/download-artifact@v4
195
229
with :
196
- name : Merged-Artifacts
197
- path : merged-artifacts
230
+ name : Merged-Artifact-As
231
+ path : merged-artifact-a
198
232
199
233
- name : ' Verify merged artifacts'
200
234
run : |
201
235
$files = @(
202
- "merged-artifacts /Artifact-A-ubuntu-latest/file1.txt",
203
- "merged-artifacts /Artifact-A-macos-latest/file1.txt",
204
- "merged-artifacts /Artifact-A-windows-latest/file1.txt"
236
+ "merged-artifact-a /Artifact-A-ubuntu-latest/file1.txt",
237
+ "merged-artifact-a /Artifact-A-macos-latest/file1.txt",
238
+ "merged-artifact-a /Artifact-A-windows-latest/file1.txt"
205
239
)
206
240
207
241
foreach ($file in $files) {
@@ -214,3 +248,4 @@ jobs:
214
248
}
215
249
}
216
250
shell : pwsh
251
+
0 commit comments