example-artifacts must run in a single workflow

otherwise the status will be success before all status are actually
complete and create confusion
This commit is contained in:
Earl Warren 2023-10-04 19:48:47 +02:00
parent 15a46373fb
commit 713a5d019d
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 47 additions and 46 deletions

View file

@ -1,22 +0,0 @@
on: [push]
jobs:
upload:
runs-on: docker
steps:
- run: mkdir -p artifacts
- run: touch artifacts/ONE artifacts/TWO
- uses: actions/upload-artifact@v3
with:
name: many-artifacts
path: artifacts/
download:
runs-on: docker
steps:
- uses: actions/download-artifact@v3
- run: |
test -f many-artifacts/ONE
test -f many-artifacts/TWO

View file

@ -1,24 +0,0 @@
on: [push]
jobs:
upload:
runs-on: docker
steps:
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v3
with:
name: my-artifact
path: path/to/artifact/world.txt
download:
runs-on: docker
steps:
- run: "! test -f world.txt"
- uses: actions/download-artifact@v3
with:
name: my-artifact
- run: "test -f world.txt"

View file

@ -0,0 +1,47 @@
on: [push]
jobs:
upload-many:
runs-on: docker
steps:
- run: mkdir -p artifacts
- run: touch artifacts/ONE artifacts/TWO
- uses: actions/upload-artifact@v3
with:
name: many-artifacts
path: artifacts/
download-many:
needs: [upload-many]
runs-on: docker
steps:
- uses: actions/download-artifact@v3
- run: |
test -f many-artifacts/ONE
test -f many-artifacts/TWO
upload-one:
runs-on: docker
steps:
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v3
with:
name: my-artifact
path: path/to/artifact/world.txt
download-one:
needs: [upload-one]
runs-on: docker
steps:
- run: "! test -f world.txt"
- uses: actions/download-artifact@v3
with:
name: my-artifact
- run: "test -f world.txt"