diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index c919e733360ffe..00e57829ff6b05 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -53,24 +53,41 @@ jobs: - name: Archive debug artifacts (screenshots, traces) uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: always() + if: ${{ !cancelled() }} with: - name: failures-artifacts + name: failures-artifacts--${{ matrix.part }} path: artifacts/test-results if-no-files-found: ignore - name: Archive flaky tests report uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: always() + if: ${{ !cancelled() }} with: - name: flaky-tests-report + name: flaky-tests-report--${{ matrix.part }} path: flaky-tests if-no-files-found: ignore + merge-artifacts: + # Merges all artifacts from all shards into a single zip and + # deletes the parts. In case of a rerun, artifacts from the + # previous run will be retained by merging them with the new ones. + name: Merge Artifacts + if: ${{ !cancelled() }} + needs: [e2e-playwright] + runs-on: ubuntu-latest + # Don't fail the job if there aren't any artifacts to merge. + continue-on-error: true + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: failures-artifacts + delete-merged: true + report-to-issues: name: Report to GitHub needs: [e2e-playwright] - if: ${{ always() }} + if: ${{ !cancelled() }} runs-on: ubuntu-latest steps: # Checkout defaults to using the branch which triggered the event, which @@ -81,24 +98,25 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - uses: actions/download-artifact@v4.1.7 - id: download_artifact + id: download-artifact # Don't fail the job if there isn't any flaky tests report. continue-on-error: true with: - name: flaky-tests-report + pattern: flaky-tests-report--* path: flaky-tests + marge-multiple: true - name: Setup Node.js and install dependencies - if: ${{ steps.download_artifact.outcome == 'success' }} + if: ${{ steps.download-artifact.outcome == 'success' }} uses: ./.github/setup-node - name: Npm build - if: ${{ steps.download_artifact.outcome == 'success' }} + if: ${{ steps.download-artifact.outcome == 'success' }} # TODO: We don't have to build the entire project, just the action itself. run: npm run build:packages - name: Report flaky tests - if: ${{ steps.download_artifact.outcome == 'success' }} + if: ${{ steps.download-artifact.outcome == 'success' }} uses: ./packages/report-flaky-tests with: repo-token: '${{ secrets.GITHUB_TOKEN }}'