From cf5947398ca8c2b83db16d09e1fc735871b7fed3 Mon Sep 17 00:00:00 2001 From: allee Date: Tue, 17 Dec 2024 15:54:08 -0500 Subject: [PATCH] Update (ci): github action's artifact upgrade v4 --- .github/actions/job-dump/action.yml | 2 +- .github/workflows/ci_compatible.yml | 43 +++++++++++++++-------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/actions/job-dump/action.yml b/.github/actions/job-dump/action.yml index 3db0dca8..ad9174c7 100644 --- a/.github/actions/job-dump/action.yml +++ b/.github/actions/job-dump/action.yml @@ -31,7 +31,7 @@ runs: shell: bash - name: Upload pytest test results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ inputs.artifact-name }} path: meta.json diff --git a/.github/workflows/ci_compatible.yml b/.github/workflows/ci_compatible.yml index 69d075b7..ed790efe 100644 --- a/.github/workflows/ci_compatible.yml +++ b/.github/workflows/ci_compatible.yml @@ -42,13 +42,6 @@ jobs: echo $pr_runtimes echo "runtimes={include: $pr_runtimes}" >> $GITHUB_OUTPUT - - run: echo "[]" > projects.json - - name: Upload placeholder - uses: actions/upload-artifact@v3 - with: - name: compatibility-${{ github.sha }} - path: projects.json - pytester: needs: generator runs-on: ${{ matrix.os }} @@ -70,25 +63,16 @@ jobs: if: always() uses: ./.github/actions/job-dump with: - artifact-name: project-${{ github.sha }}-${{ strategy.job-index }} + artifact-name: project-${{ github.sha }}-${{ strategy.job-index }}-pytester collector: runs-on: ubuntu-latest needs: [generator, pytester] if: always() strategy: - max-parallel: 1 # run sequential to prevent download/upload collisions matrix: ${{ fromJSON(needs.generator.outputs.matrix) }} steps: - - name: Download 📥 summary - uses: actions/download-artifact@v3 - with: - name: compatibility-${{ github.sha }} - - name: Download 📥 project - uses: actions/download-artifact@v3 - with: - name: project-${{ github.sha }}-${{ strategy.job-index }} - + - run: echo "[]" > projects.json - run: ls -l - name: append result run: | @@ -101,8 +85,14 @@ jobs: json.dump(data, fp) shell: python + - name: Upload 📥 project + uses: actions/upload-artifact@v4 + with: + name: project-${{ github.sha }}-${{ strategy.job-index }}-collector + path: project-${{ github.sha }}-* + - name: Upload pytest test results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: compatibility-${{ github.sha }} path: projects.json @@ -129,7 +119,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Download 📥 summary - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: compatibility-${{ github.sha }} - run: cat projects.json @@ -170,7 +160,7 @@ jobs: git config user.email github-actions@github.com git merge origin/main - name: Download 📥 summary - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: compatibility-${{ github.sha }} - name: Update results @@ -182,3 +172,14 @@ jobs: - name: Kick if: contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) run: git push + + merge-artifacts: + needs: archiver + runs-on: ubuntu-latest + steps: + - name: Download 📥 + uses: actions/upload-artifact/merge@v4 + with: + name: project-${{ github.sha }}-${{ strategy.job-index }} + pattern: project-${{ github.sha }}-* + delete-merged: true