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 :
5663 repository : element-hq/element-web
5764 persist-credentials : false
5865
59- - uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
60- - uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
66+ - uses : pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
67+ - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
6168 with :
6269 cache : " pnpm"
6370 node-version : " lts/*"
7683 env :
7784 CI_PACKAGE : true
7885 working-directory : apps/web
79- run : VERSION=$(scripts/get-version-from-git.sh) pnpm build
86+ run : VERSION=$(scripts/get-version-from-git.sh) pnpm run build
8087
8188 - name : Upload Artifact
8289 uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
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
@@ -133,13 +140,13 @@ jobs:
133140 repository : element-hq/element-web
134141
135142 - name : 📥 Download artifact
136- uses : actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8
143+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
137144 with :
138145 name : webapp
139146 path : apps/web/webapp
140147
141- - uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
142- - uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
148+ - uses : pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
149+ - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
143150 with :
144151 cache : " pnpm"
145152 cache-dependency-path : pnpm-lock.yaml
@@ -150,10 +157,10 @@ jobs:
150157
151158 - name : Get installed Playwright version
152159 id : playwright
153- run : echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[].devDependencies["@playwright/test"].version ')" >> $GITHUB_OUTPUT
160+ run : echo "version=$(pnpm --silent -- playwright --version | awk '{print $2} ')" >> $GITHUB_OUTPUT
154161
155162 - name : Cache playwright binaries
156- uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
163+ uses : actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
157164 id : playwright-cache
158165 with :
159166 path : ~/.cache/ms-playwright
@@ -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 :
@@ -211,9 +274,9 @@ jobs:
211274 persist-credentials : false
212275 repository : element-hq/element-web
213276
214- - uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
277+ - uses : pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
215278 if : inputs.skip != true
216- - uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
279+ - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
217280 if : inputs.skip != true
218281 with :
219282 cache : " pnpm"
@@ -225,27 +288,30 @@ jobs:
225288
226289 - name : Download blob reports from GitHub Actions Artifacts
227290 if : inputs.skip != true
228- uses : actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8
291+ 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 || '' }}
306+ PLAYWRIGHT_HTML_TITLE : ${{ case(github.event_name == 'pull_request', format('Playwright Report PR-{0}', env.PR_NUMBER), 'Playwright Report') }}
241307
242308 # Upload the HTML report even if one of our reporters fails, this can happen when stale screenshots are detected
243309 - name : Upload HTML report
244310 if : always() && inputs.skip != true
245311 uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
246312 with :
247313 name : html-report
248- path : apps/web/ playwright-report
314+ path : playwright-report
249315 retention-days : 14
250316 if-no-files-found : error
251317
0 commit comments