2727 totalParts : [8]
2828
2929 steps :
30- - uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
30+ - uses : actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
3131 with :
3232 show-progress : ${{ runner.debug == '1' && 'true' || 'false' }}
3333
@@ -53,52 +53,75 @@ jobs:
5353
5454 - name : Archive debug artifacts (screenshots, traces)
5555 uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
56- if : always()
56+ if : ${{ !cancelled() }}
5757 with :
58- name : failures-artifacts
58+ name : failures-artifacts--${{ matrix.part }}
5959 path : artifacts/test-results
6060 if-no-files-found : ignore
6161
6262 - name : Archive flaky tests report
6363 uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
64- if : always()
64+ if : ${{ !cancelled() }}
6565 with :
66- name : flaky-tests-report
66+ name : flaky-tests-report--${{ matrix.part }}
6767 path : flaky-tests
6868 if-no-files-found : ignore
6969
70+ merge-artifacts :
71+ name : Merge Artifacts
72+ if : ${{ !cancelled() }}
73+ needs : [e2e-playwright]
74+ runs-on : ubuntu-latest
75+ outputs :
76+ has-flaky-test-report : ${{ !!steps.merge-flaky-tests-reports.outputs.artifact-id }}
77+ steps :
78+ - name : Merge failures artifacts
79+ uses : actions/upload-artifact/merge@v4
80+ # Don't fail the job if there aren't any artifacts to merge.
81+ continue-on-error : true
82+ with :
83+ name : failures-artifacts
84+ # Retain the merged artifacts in case of a rerun.
85+ pattern : failures-artifacts*
86+ delete-merged : true
87+
88+ - name : Merge flaky tests reports
89+ id : merge-flaky-tests-reports
90+ uses : actions/upload-artifact/merge@v4
91+ continue-on-error : true
92+ with :
93+ name : flaky-tests-report
94+ pattern : flaky-tests-report*
95+ delete-merged : true
96+
7097 report-to-issues :
7198 name : Report to GitHub
72- needs : [e2e-playwright ]
73- if : ${{ always() }}
99+ needs : [merge-artifacts ]
100+ if : ${{ needs.merge-artifacts.outputs.has-flaky-test-report == 'true' }}
74101 runs-on : ubuntu-latest
75102 steps :
76103 # Checkout defaults to using the branch which triggered the event, which
77104 # isn't necessarily `trunk` (e.g. in the case of a merge).
78- - uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
105+ - uses : actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
79106 with :
80107 ref : trunk
81108 show-progress : ${{ runner.debug == '1' && 'true' || 'false' }}
82109
83110 - uses : actions/download-artifact@v4.1.7
84- id : download_artifact
85111 # Don't fail the job if there isn't any flaky tests report.
86112 continue-on-error : true
87113 with :
88114 name : flaky-tests-report
89115 path : flaky-tests
90116
91117 - name : Setup Node.js and install dependencies
92- if : ${{ steps.download_artifact.outcome == 'success' }}
93118 uses : ./.github/setup-node
94119
95120 - name : Npm build
96- if : ${{ steps.download_artifact.outcome == 'success' }}
97121 # TODO: We don't have to build the entire project, just the action itself.
98122 run : npm run build:packages
99123
100124 - name : Report flaky tests
101- if : ${{ steps.download_artifact.outcome == 'success' }}
102125 uses : ./packages/report-flaky-tests
103126 with :
104127 repo-token : ' ${{ secrets.GITHUB_TOKEN }}'
0 commit comments