@@ -181,27 +181,61 @@ jobs:
181181 - name : Checkout
182182 uses : actions/checkout@v4
183183
184- # Merge Artifact-A-* from previous jobs
185- - name : Merge
184+ # Merge all artifacts from previous jobs
185+ - name : Merge all artifacts in run
186186 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
187193 with :
188194 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
189223 pattern : ' Artifact-A-*'
190224 separate-directories : true
191225
192226 # Download merged artifacts and verify the correctness of the content
193227 - name : ' Download merged artifacts'
194228 uses : actions/download-artifact@v4
195229 with :
196- name : Merged-Artifacts
197- path : merged-artifacts
230+ name : Merged-Artifact-As
231+ path : merged-artifact-a
198232
199233 - name : ' Verify merged artifacts'
200234 run : |
201235 $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"
205239 )
206240
207241 foreach ($file in $files) {
@@ -214,3 +248,4 @@ jobs:
214248 }
215249 }
216250 shell : pwsh
251+
0 commit comments