1- # Produce a build of element-web with this version of react-sdk
2- # and any matching branches of element-web and js-sdk, output it
3- # as an artifact and run end-to-end tests.
4- name : End to End Tests
1+ # builds Element Web
2+ # runs Playwright tests against the built Element Web
3+ # builds Element Desktop using the built Element Web
4+ #
5+ # Tries to use a matching js-sdk branch for the build.
6+ #
7+ # Produces a `webapp` artifact
8+ # Produces multiple Desktop artifacts
9+ # Produces multiple Playwright report artifacts
10+ name : Build & Test
511on :
612 # CRON to run all Projects at 6am UTC
713 schedule :
1016 merge_group :
1117 types : [checks_requested]
1218 push :
13- branches : [develop, master]
19+ # We do not build on push to develop as the merge_group check handles that
20+ branches : [staging, master]
1421 repository_dispatch :
1522 types : [element-web-notify]
1623
@@ -35,15 +42,15 @@ concurrency:
3542env :
3643 # fetchdep.sh needs to know our PR number
3744 PR_NUMBER : ${{ github.event.pull_request.number }}
38- # Use 6 runners in the default case, but 4 when running on a schedule where we run all 5 projects (20 runners total)
39- NUM_RUNNERS : ${{ github.event_name == 'schedule' && 4 || 6 }}
45+ # Use 4 runners in the default case, but only 1 when running on a schedule where we run all 5 projects
46+ NUM_RUNNERS : ${{ github.event_name == 'schedule' && 1 || 4 }}
4047 NX_DEFAULT_OUTPUT_STYLE : stream-without-prefixes
4148
4249permissions : {} # No permissions required
4350
4451jobs :
45- build :
46- name : " Build Element- Web"
52+ build_ew :
53+ name : " Build Element Web"
4754 runs-on : ubuntu-24.04
4855 if : inputs.skip != true
4956 outputs :
94101 const matrix = Array.from({ length: numRunners }, (_, i) => i + 1);
95102 core.setOutput("matrix", JSON.stringify(matrix));
96103
97- playwright :
98- name : " Run Tests [${{ matrix.project }}] ${{ matrix.runner }}/${{ needs.build .outputs.num-runners }}"
99- needs : build
104+ playwright_ew :
105+ name : " Run Tests [${{ matrix.project }}] ${{ matrix.runner }}/${{ needs.build_ew .outputs.num-runners }}"
106+ needs : build_ew
100107 if : inputs.skip != true
101108 runs-on : ubuntu-24.04
102109 permissions :
@@ -107,7 +114,7 @@ jobs:
107114 fail-fast : false
108115 matrix :
109116 # Run multiple instances in parallel to speed up the tests
110- runner : ${{ fromJSON(needs.build .outputs.runners-matrix) }}
117+ runner : ${{ fromJSON(needs.build_ew .outputs.runners-matrix) }}
111118 project :
112119 - Chrome
113120 - Firefox
@@ -179,29 +186,85 @@ jobs:
179186 --project="${{ matrix.project }}" \
180187 ${{ (github.event_name == 'pull_request' && matrix.runAllTests == false ) && '--grep-invert @mergequeue' || '' }}
181188 env :
182- SHARD : ${{ format('{0}/{1}', matrix.runner, needs.build .outputs.num-runners) }}
189+ SHARD : ${{ format('{0}/{1}', matrix.runner, needs.build_ew .outputs.num-runners) }}
183190
184191 - name : Upload blob report to GitHub Actions Artifacts
185192 if : always()
186193 uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
187194 with :
188- name : all- blob-reports -${{ matrix.project }}-${{ matrix.runner }}
195+ name : blob-report -${{ matrix.project }}-${{ matrix.runner }}
189196 path : apps/web/blob-report
190197 retention-days : 1
198+ if-no-files-found : error
191199
192200 downstream-modules :
193201 name : Downstream Playwright tests [element-modules]
194- needs : build
202+ needs : build_ew
195203 if : inputs.skip != true && github.event_name == 'merge_group'
196204 uses : element-hq/element-modules/.github/workflows/reusable-playwright-tests.yml@main # zizmor: ignore[unpinned-uses]
197205 with :
198206 webapp-artifact : webapp
199207
208+ prepare_ed :
209+ name : " Prepare Element Desktop"
210+ uses : ./.github/workflows/build_desktop_prepare.yaml
211+ needs : build_ew
212+ if : inputs.skip != true
213+ permissions :
214+ contents : read
215+ with :
216+ config : ${{ (github.event.pull_request.base.ref || github.ref_name) == 'develop' && 'element.io/nightly' || 'element.io/release' }}
217+ version : ${{ (github.event.pull_request.base.ref || github.ref_name) == 'develop' && 'develop' || '' }}
218+ webapp-artifact : webapp
219+
220+ build_ed_windows :
221+ needs : prepare_ed
222+ name : " Desktop Windows"
223+ uses : ./.github/workflows/build_desktop_windows.yaml
224+ if : inputs.skip != true
225+ strategy :
226+ matrix :
227+ arch : [x64, ia32, arm64]
228+ with :
229+ arch : ${{ matrix.arch }}
230+ blob_report : true
231+
232+ build_ed_linux :
233+ needs : prepare_ed
234+ name : " Desktop Linux"
235+ uses : ./.github/workflows/build_desktop_linux.yaml
236+ if : inputs.skip != true
237+ strategy :
238+ matrix :
239+ sqlcipher : [system, static]
240+ arch : [amd64, arm64]
241+ runAllTests :
242+ - ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests') }}
243+ # We ship static sqlcipher builds, so delegate testing the system builds to the merge queue
244+ exclude :
245+ - runAllTests : false
246+ sqlcipher : system
247+ with :
248+ sqlcipher : ${{ matrix.sqlcipher }}
249+ arch : ${{ matrix.arch }}
250+ blob_report : true
251+
252+ build_ed_macos :
253+ needs : prepare_ed
254+ name : " Desktop macOS"
255+ uses : ./.github/workflows/build_desktop_macos.yaml
256+ if : inputs.skip != true
257+ with :
258+ blob_report : true
259+
200260 complete :
201261 name : end-to-end-tests
202262 needs :
203- - playwright
263+ - playwright_ew
204264 - downstream-modules
265+ - build_ed_windows
266+ - build_ed_linux
267+ - build_ed_macos
205268 if : always()
206269 runs-on : ubuntu-24.04
207270 steps :
@@ -227,26 +290,28 @@ jobs:
227290 if : inputs.skip != true
228291 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
229292 with :
230- pattern : all- blob-reports -*
231- path : apps/web/ all-blob-reports
293+ pattern : blob-report -*
294+ path : all-blob-reports
232295 merge-multiple : true
233296
234297 - name : Merge into HTML Report
235298 if : inputs.skip != true
236- working-directory : apps/web
237- run : pnpm playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts,@element-hq/element-web-playwright-common/lib/stale-screenshot-reporter.js ./all-blob-reports
299+ run : |
300+ pnpm playwright merge-reports \
301+ --config=playwright-merge.config.ts \
302+ ./all-blob-reports
238303 env :
239304 # Only pass creds to the flaky-reporter on main branch runs
240305 GITHUB_TOKEN : ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}
241- PLAYWRIGHT_HTML_TITLE : ${{ case(github.event_name == 'pull_request', format('EW Playwright Report PR-{0}', env.PR_NUMBER), 'EW Playwright Report') }}
306+ PLAYWRIGHT_HTML_TITLE : ${{ case(github.event_name == 'pull_request', format('Playwright Report PR-{0}', env.PR_NUMBER), 'Playwright Report') }}
242307
243308 # Upload the HTML report even if one of our reporters fails, this can happen when stale screenshots are detected
244309 - name : Upload HTML report
245310 if : always() && inputs.skip != true
246311 uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
247312 with :
248313 name : html-report
249- path : apps/web/ playwright-report
314+ path : playwright-report
250315 retention-days : 14
251316 if-no-files-found : error
252317
0 commit comments