88
99jobs :
1010 e2e_tests :
11- name : Playwright Tests
11+ name : Playwright Tests (${{ matrix.shard }})
1212 runs-on : ubuntu-latest
1313 permissions :
1414 contents : read
15+ strategy :
16+ fail-fast : false
17+ matrix :
18+ shard : [1, 2, 3, 4]
1519
1620 services :
1721 backend :
4044
4145 - name : Run Playwright tests
4246 id : run_tests
43- run : npm run test:e2e
47+ run : npx playwright test --shard ${{ matrix.shard }}/4
4448 env :
4549 CI : true
4650 PLAYWRIGHT_VIDEO : ' on'
4953 if : always()
5054 uses : actions/upload-artifact@v3
5155 with :
52- name : playwright-artifacts
56+ name : playwright-artifacts-${{ matrix.shard }}
5357 path : playwright-artifacts
5458 retention-days : 5
5559
9094 echo "flaky=$flaky" >> $GITHUB_OUTPUT
9195 echo "skipped=$skipped" >> $GITHUB_OUTPUT
9296
97+ merge_reports :
98+ name : Merge Test Reports
99+ if : always()
100+ needs : [e2e_tests]
101+ runs-on : ubuntu-latest
102+ steps :
103+ - uses : actions/checkout@v4
104+
105+ - name : Download all artifacts
106+ uses : actions/download-artifact@v3
107+ with :
108+ path : all-artifacts
109+
110+ - name : Merge reports
111+ run : |
112+ mkdir -p merged-artifacts/playwright-report
113+ # Merge HTML reports (just copy the last one as they can't be properly merged)
114+ cp -r all-artifacts/playwright-artifacts-*/playwright-report/* merged-artifacts/playwright-report/
115+
116+ # Create directory for merged results
117+ mkdir -p merged-artifacts
118+
119+ - name : Upload merged artifacts
120+ uses : actions/upload-artifact@v3
121+ with :
122+ name : playwright-artifacts
123+ path : merged-artifacts
124+ retention-days : 5
125+
93126 bundle_size :
94127 name : Check Bundle Size
95128 runs-on : ubuntu-latest
@@ -155,7 +188,7 @@ jobs:
155188
156189 deploy_report :
157190 name : Deploy Test Report
158- needs : [e2e_tests ]
191+ needs : [merge_reports ]
159192 if : always() && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository))
160193 runs-on : ubuntu-latest
161194 permissions :
@@ -173,7 +206,7 @@ jobs:
173206 mkdir gh-pages
174207 git --work-tree=gh-pages checkout gh-pages -- .
175208
176- - name : Download Playwright artifacts
209+ - name : Download merged artifacts
177210 uses : actions/download-artifact@v3
178211 with :
179212 name : playwright-artifacts
@@ -215,7 +248,7 @@ jobs:
215248 with :
216249 fetch-depth : 0
217250
218- - name : Download Playwright artifacts
251+ - name : Download merged artifacts
219252 uses : actions/download-artifact@v3
220253 with :
221254 name : playwright-artifacts
0 commit comments