diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index f1aaaff59..1468472c2 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -130,9 +130,47 @@ jobs: npm run test:e2e - - name: Retain failed test results + - name: Archive debug artifacts (screenshots, traces) uses: actions/upload-artifact@v4 - if: failure() + if: ${{ ! cancelled() }} with: - name: test-results-${{ matrix.php }} + name: failures-artifacts--${{ matrix.php }} path: artifacts/test-results/ + if-no-files-found: ignore + + + - name: Archive flaky tests report + uses: actions/upload-artifact@v4 + if: ${{ ! cancelled() }} + with: + name: flaky-tests-report--${{ matrix.php }} + path: flaky-tests + if-no-files-found: ignore + + + merge-artifacts: + name: Merge Artifacts + if: ${{ ! cancelled() }} + needs: [e2e-tests] + runs-on: ubuntu-latest + outputs: + has-flaky-test-report: ${{ !!steps.merge-flaky-tests-reports.outputs.artifact-id }} + steps: + - name: Merge failures artifacts + uses: actions/upload-artifact/merge@v4 + # Don't fail the job if there aren't any artifacts to merge. + continue-on-error: true + with: + name: failures-artifacts + # Retain the merged artifacts in case of a rerun. + pattern: failures-artifacts* + delete-merged: true + + - name: Merge flaky tests reports + id: merge-flaky-tests-reports + uses: actions/upload-artifact/merge@v4 + continue-on-error: true + with: + name: flaky-tests-report + pattern: flaky-tests-report* + delete-merged: true \ No newline at end of file