From 713a5d019d63c8d483773bc3bf77aeae420df079 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 4 Oct 2023 19:48:47 +0200 Subject: [PATCH] example-artifacts must run in a single workflow otherwise the status will be success before all status are actually complete and create confusion --- .../.forgejo/workflows/many.yml | 22 --------- .../.forgejo/workflows/one.yml | 24 ---------- .../.forgejo/workflows/test.yml | 47 +++++++++++++++++++ 3 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 testdata/example-artifacts/.forgejo/workflows/many.yml delete mode 100644 testdata/example-artifacts/.forgejo/workflows/one.yml create mode 100644 testdata/example-artifacts/.forgejo/workflows/test.yml diff --git a/testdata/example-artifacts/.forgejo/workflows/many.yml b/testdata/example-artifacts/.forgejo/workflows/many.yml deleted file mode 100644 index 52b0d9a..0000000 --- a/testdata/example-artifacts/.forgejo/workflows/many.yml +++ /dev/null @@ -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 diff --git a/testdata/example-artifacts/.forgejo/workflows/one.yml b/testdata/example-artifacts/.forgejo/workflows/one.yml deleted file mode 100644 index 3d61853..0000000 --- a/testdata/example-artifacts/.forgejo/workflows/one.yml +++ /dev/null @@ -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" diff --git a/testdata/example-artifacts/.forgejo/workflows/test.yml b/testdata/example-artifacts/.forgejo/workflows/test.yml new file mode 100644 index 0000000..0a8e3b8 --- /dev/null +++ b/testdata/example-artifacts/.forgejo/workflows/test.yml @@ -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"