Skip to content

Commit 53ef698

Browse files
committed
add additional integration test for merge all behavior
1 parent 90b0f8e commit 53ef698

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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+

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ The release of upload-artifact@v4 and download-artifact@v4 are major changes to
4141

4242
For more information, see the [`@actions/artifact`](https://github.com/actions/toolkit/tree/main/packages/artifact) documentation.
4343

44+
There is also a new sub-action, `actions/upload-artifact/merge`. For more info, check out that action's [README](./merge/README.md).
45+
4446
### Improvements
4547

4648
1. Uploads are significantly faster, upwards of 90% improvement in worst case scenarios.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy