actions / upload-artifact

MIT License
3.26k stars 739 forks source link

[bug] upload-artifact/merge@v4 exclude files from different run attempt #526

Open ktrzcinx opened 9 months ago

ktrzcinx commented 9 months ago

What happened?

I've got a bunch of CI test, running in parallel tests jobs. Every of then stores some report as an artifact, tests are cope with upload-artifact/merge@v4. Because problems with concurrency described here https://github.com/orgs/community/discussions/12835 I need to rerun some skipped tests. After rerun only artifacts from the last run attempt (and matching pattern) are merged to a common output artifacts. Reports from eg. run attempt #1 do not contribute to the final upload-artifact/merge@v4 output.

What did you expect to happen?

upload-artifact/merge@v4 should merge artifacts from every run attempt

How can we reproduce it?

jobs:

# Mock tests
  test1:
    runs-on: [Ubuntu]
    concurrency: exclusive-test
    steps:
      - run: sleep 60 && cat "1" > report.json
      - uses: actions/upload-artifact@v4
         with: { path: *, name: report-test1 }
  test2:
    runs-on: [Ubuntu]
    concurrency: exclusive-test
    steps:
      - run: sleep 60 && cat "2" > report.json
      - uses: actions/upload-artifact@v4
         with: { path: *, name: report-test2 }
  test3:
    runs-on: [Ubuntu]
    concurrency: exclusive-test
    steps:
      - run: sleep 60 && cat "3" > report.json
      - uses: actions/upload-artifact@v4
         with: { path: *, name: report-test3 }
  test4:
    runs-on: [Ubuntu]
    concurrency: exclusive-test
    steps:
      - run: sleep 60 && cat "4" > report.json
      - uses: actions/upload-artifact@v4
         with: { path: *, name: report-test4 }

# Merge results
merge:
    runs-on: [Ubuntu]
    needs: [test1, test2, test3, test4]
    steps:
      - name: Merge Artifacts
        uses: actions/upload-artifact/merge@v4
        with:
          name: test-reports
          pattern: report-*
          delete-merged: true

Anything else we need to know?

No response

What version of the action are you using?

v4 (v4.3.1)

What are your runner environments?

self-hosted, linux

Are you on GitHub Enterprise Server? If so, what version?

No response