mirror of
https://github.com/actions/download-artifact.git
synced 2025-08-22 00:20:17 +00:00
Adding tests for gz
This commit is contained in:
parent
55042b3b87
commit
07705729e6
50
.github/workflows/test.yml
vendored
50
.github/workflows/test.yml
vendored
@ -109,4 +109,54 @@ jobs:
|
|||||||
}
|
}
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
|
# Test downloading both artifacts at once
|
||||||
|
- name: Download all Artifacts and not ungzipping
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
path: some/other/pathgz
|
||||||
|
extract: False
|
||||||
|
|
||||||
|
- name: Verify successful download
|
||||||
|
run: |
|
||||||
|
$fileA = "some/other/pathgz/Artifact-A.gz"
|
||||||
|
$fileB = "some/other/pathgz/Artifact-B.gz"
|
||||||
|
if(!(Test-Path -path $fileA) -or !(Test-Path -path $fileB))
|
||||||
|
{
|
||||||
|
Write-Error "Expected files do not exist"
|
||||||
|
}
|
||||||
|
if(!((Get-Content $fileA) -ceq "Lorem ipsum dolor sit amet") -or !((Get-Content $fileB) -ceq "Hello world from file B"))
|
||||||
|
{
|
||||||
|
Write-Error "File contents of downloaded artifacts are incorrect"
|
||||||
|
}
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
|
||||||
|
# Test downloading a single artifact
|
||||||
|
- name: Download artifact A
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: 'Artifact-A'
|
||||||
|
path: some/new/pathgz
|
||||||
|
extract: False
|
||||||
|
|
||||||
|
# Test downloading an artifact using tilde expansion
|
||||||
|
- name: Download artifact A
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: 'Artifact-A'
|
||||||
|
path: ~/some/path/with/a/tildegz
|
||||||
|
extract: False
|
||||||
|
|
||||||
|
- name: Verify successful download
|
||||||
|
run: |
|
||||||
|
$file1 = "some/new/pathgz/file-A.gz"
|
||||||
|
$file2 = "~/some/path/with/a/tildegz/file-A.gz"
|
||||||
|
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 "Lorem ipsum dolor sit amet"))
|
||||||
|
{
|
||||||
|
Write-Error "File contents of downloaded artifacts are incorrect"
|
||||||
|
}
|
||||||
|
shell: pwsh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user