Skip to content

Commit

Permalink
Fix artifacts handling in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed May 2, 2024
1 parent 4b9b7ac commit 038e93e
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
steps:
- name: Merge 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
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
Expand All @@ -81,24 +98,25 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- uses: actions/[email protected]
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 }}'
Expand Down

0 comments on commit 038e93e

Please sign in to comment.