Support for multi path upload

This commit is contained in:
Konrad Pabjan 2020-07-09 11:43:31 +02:00
commit 5db5708164
4 changed files with 231 additions and 11 deletions

View file

@ -75,6 +75,16 @@ jobs:
name: 'GZip-Artifact'
path: path/to/dir-3/
# Upload a directory that contains a file that will be uploaded with GZip
- name: 'Upload artifact #4'
uses: ./
with:
name: 'Multi-Path-Artifact'
path: |
path/to/dir-1/*
path/to/dir-[23]/*
!path/to/dir-3/*.txt
# Verify artifacts. Switch to download-artifact@v2 once it's out of preview
# Download Artifact #1 and verify the correctness of the content
@ -138,3 +148,23 @@ jobs:
Write-Error "File contents of downloaded artifact is incorrect"
}
shell: pwsh
- name: 'Download artifact #4'
uses: actions/download-artifact@v1
with:
name: 'Multi-Path-Artifact'
path: multi/artifact/path
- name: 'Verify Artifact #4'
run: |
$file1 = "multi/artifact/path/to/dir-1/file1.txt"
$file2 = "multi/artifact/path/to/dir-2/file2.txt"
if(!(Test-Path -path $file1) -or !(Test-Path -path $file2))
{
Write-Error "Expected files do not exist"
}
if(!((Get-Content $file1) -ceq "Lorem ipsum dolor sit amet") -or !((Get-Content $file2) -ceq "Hello world from file #2"))
{
Write-Error "File contents of downloaded artifacts are incorrect"
}
shell: pwsh