mirror of
https://code.forgejo.org/actions/upload-artifact
synced 2024-11-21 17:50:39 +00:00
add explicit relative and absolute symlinks to workflow
This commit is contained in:
parent
d50e66084c
commit
b1d4642b69
1 changed files with 17 additions and 5 deletions
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
|
@ -56,7 +56,8 @@ jobs:
|
||||||
echo "Lorem ipsum dolor sit amet" > path/to/dir-1/file1.txt
|
echo "Lorem ipsum dolor sit amet" > path/to/dir-1/file1.txt
|
||||||
echo "Hello world from file #2" > path/to/dir-2/file2.txt
|
echo "Hello world from file #2" > path/to/dir-2/file2.txt
|
||||||
echo "Hello from a symlinked file" > symlink/original.txt
|
echo "Hello from a symlinked file" > symlink/original.txt
|
||||||
ln -s $(pwd)/symlink/original.txt symlink/file.txt
|
ln -s $(pwd)/symlink/original.txt symlink/abs.txt
|
||||||
|
ln -s original.txt symlink/rel.txt
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
# Upload a single file artifact
|
# Upload a single file artifact
|
||||||
|
@ -87,7 +88,9 @@ jobs:
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
name: 'Symlinked-Artifact-${{ matrix.runs-on }}'
|
name: 'Symlinked-Artifact-${{ matrix.runs-on }}'
|
||||||
path: symlink/file.txt
|
path: |
|
||||||
|
symlink/abs.txt
|
||||||
|
symlink/rel.txt
|
||||||
|
|
||||||
# Download Artifact #1 and verify the correctness of the content
|
# Download Artifact #1 and verify the correctness of the content
|
||||||
- name: 'Download artifact #1'
|
- name: 'Download artifact #1'
|
||||||
|
@ -159,12 +162,21 @@ jobs:
|
||||||
|
|
||||||
- name: 'Verify symlinked artifact'
|
- name: 'Verify symlinked artifact'
|
||||||
run: |
|
run: |
|
||||||
$file = "from/symlink/file.txt"
|
$abs = "from/symlink/abs.txt"
|
||||||
if(!(Test-Path -path $file))
|
if(!(Test-Path -path $abs))
|
||||||
{
|
{
|
||||||
Write-Error "Expected file does not exist"
|
Write-Error "Expected file does not exist"
|
||||||
}
|
}
|
||||||
if(!((Get-Content $file) -ceq "Hello from a symlinked file"))
|
if(!((Get-Content $abs) -ceq "Hello from a symlinked file"))
|
||||||
|
{
|
||||||
|
Write-Error "File contents of downloaded artifact are incorrect"
|
||||||
|
}
|
||||||
|
$rel = "from/symlink/rel.txt"
|
||||||
|
if(!(Test-Path -path $rel))
|
||||||
|
{
|
||||||
|
Write-Error "Expected file does not exist"
|
||||||
|
}
|
||||||
|
if(!((Get-Content $rel) -ceq "Hello from a symlinked file"))
|
||||||
{
|
{
|
||||||
Write-Error "File contents of downloaded artifact are incorrect"
|
Write-Error "File contents of downloaded artifact are incorrect"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue