From 9ce0cf031cf8854f90992df3ce7948a7e3c5befb Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:21:25 +0800 Subject: [PATCH] Test Github actions (#6) * Test new artifact actions * Test * Test * Test artifact * Test artifacts * Test * Test * Test * Update playground.yml * Test * Add clean artifacts * Test * Test * Rerun * Add need to artifact-download * Test * Test Clean * Code clean * Test clean artifacts --------- Co-authored-by: Xavier Lau --- .github/workflows/docker-image.yml | 2 +- .github/workflows/playground.yml | 56 ++++++++++++++++++++++ .github/workflows/trigger-tracing-node.yml | 2 +- 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/playground.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 29fcea3..e57f6ce 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -20,7 +20,7 @@ jobs: - srtool - safe-transaction-service steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: benjlevesque/short-sha@v1.2 diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml new file mode 100644 index 0000000..49fb28a --- /dev/null +++ b/.github/workflows/playground.yml @@ -0,0 +1,56 @@ +name: Playground + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + artifact-upload: + name: Artifact upload + runs-on: ubuntu-latest + strategy: + matrix: + animal: [cat, dog] + steps: + - uses: actions/checkout@v4 + + - name: Set name + run: | + mkdir build + echo '${{ matrix.animal }}' >> build/${{ matrix.animal }}.txt + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: artifact-${{ matrix.animal }} + path: build + + artifact-download: + name: Artifact download + runs-on: ubuntu-latest + needs: [artifact-upload] + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + path: build + + - name: Check downloaded + run: | + ls -R build + + clean-artifacts: + name: Clean artifacts + runs-on: ubuntu-latest + needs: [artifact-download] + if: always() + steps: + - uses: geekyeggo/delete-artifact@v2 + with: + name: | + artifact-cat + diff --git a/.github/workflows/trigger-tracing-node.yml b/.github/workflows/trigger-tracing-node.yml index 77acabd..70db596 100644 --- a/.github/workflows/trigger-tracing-node.yml +++ b/.github/workflows/trigger-tracing-node.yml @@ -27,7 +27,7 @@ jobs: - mainnets - testnets steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2