1818 push :
1919 # We do not build on push to develop as the merge_group check handles that
2020 branches : [staging, master]
21- repository_dispatch :
22- types : [element-web-notify]
2321
2422 # support triggering from other workflows
2523 workflow_call :
5654 outputs :
5755 num-runners : ${{ env.NUM_RUNNERS }}
5856 runners-matrix : ${{ steps.runner-vars.outputs.matrix }}
57+ # Skip pull_request runs on renovate PRs to speed up CI time, delegating to the full run in merge queue
58+ skip : ${{ inputs.skip || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
5959 steps :
6060 - name : Checkout code
6161 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6464 persist-credentials : false
6565
6666 - uses : pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
67- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
67+ - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
6868 with :
6969 cache : " pnpm"
7070 node-version : " lts/*"
@@ -86,15 +86,15 @@ jobs:
8686 run : VERSION=$(scripts/get-version-from-git.sh) pnpm run build
8787
8888 - name : Upload Artifact
89- uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
89+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
9090 with :
9191 name : webapp
9292 path : apps/web/webapp
9393 retention-days : 1
9494
9595 - name : Calculate runner variables
9696 id : runner-vars
97- uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
97+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
9898 with :
9999 script : |
100100 const numRunners = parseInt(process.env.NUM_RUNNERS, 10);
@@ -104,7 +104,7 @@ jobs:
104104 playwright_ew :
105105 name : " Run Tests [${{ matrix.project }}] ${{ matrix.runner }}/${{ needs.build_ew.outputs.num-runners }}"
106106 needs : build_ew
107- if : inputs. skip != true
107+ if : needs.build_ew.outputs. skip == 'false'
108108 runs-on : ubuntu-24.04
109109 permissions :
110110 actions : read
@@ -146,7 +146,7 @@ jobs:
146146 path : apps/web/webapp
147147
148148 - uses : pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
149- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
149+ - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
150150 with :
151151 cache : " pnpm"
152152 cache-dependency-path : pnpm-lock.yaml
@@ -155,33 +155,17 @@ jobs:
155155 - name : Install dependencies
156156 run : pnpm install --frozen-lockfile
157157
158- - name : Get installed Playwright version
159- id : playwright
160- run : echo "version=$(pnpm --silent -- playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT
161-
162- - name : Cache playwright binaries
163- uses : actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
164- id : playwright-cache
158+ - name : Setup playwright
159+ uses : ./.github/actions/setup-playwright
165160 with :
166- path : ~/.cache/ms-playwright
167- key : ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright.outputs.version }}
168-
169- - name : Install Playwright browsers
170- if : steps.playwright-cache.outputs.cache-hit != 'true'
171- working-directory : apps/web
172- run : pnpm playwright install --with-deps --no-shell
173-
174- - name : Install system dependencies for WebKit
175- # Some WebKit dependencies seem to lay outside the cache and will need to be installed separately
176- if : matrix.project == 'WebKit' && steps.playwright-cache.outputs.cache-hit == 'true'
177- working-directory : apps/web
178- run : pnpm playwright install-deps webkit
161+ needs-webkit : ${{ matrix.project == 'WebKit' }}
162+ write-cache : ${{ github.event_name != 'merge_group' }}
179163
180164 # We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
181165 - name : Run Playwright tests
182166 working-directory : apps/web
183167 run : |
184- pnpm playwright test \
168+ pnpm test:playwright \
185169 --shard "$SHARD" \
186170 --project="${{ matrix.project }}" \
187171 ${{ (github.event_name == 'pull_request' && matrix.runAllTests == false ) && '--grep-invert @mergequeue' || '' }}
@@ -190,7 +174,7 @@ jobs:
190174
191175 - name : Upload blob report to GitHub Actions Artifacts
192176 if : always()
193- uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
177+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
194178 with :
195179 name : blob-report-${{ matrix.project }}-${{ matrix.runner }}
196180 path : apps/web/blob-report
@@ -200,28 +184,30 @@ jobs:
200184 downstream-modules :
201185 name : Downstream Playwright tests [element-modules]
202186 needs : build_ew
203- if : inputs. skip != true && github.event_name == 'merge_group'
187+ if : needs.build_ew.outputs. skip == 'false' && github.event_name == 'merge_group'
204188 uses : element-hq/element-modules/.github/workflows/reusable-playwright-tests.yml@main # zizmor: ignore[unpinned-uses]
205189 with :
206190 webapp-artifact : webapp
191+ reporter : blob
207192
208193 prepare_ed :
209194 name : " Prepare Element Desktop"
210195 uses : ./.github/workflows/build_desktop_prepare.yaml
211196 needs : build_ew
212- if : inputs. skip != true
197+ if : needs.build_ew.outputs. skip == 'false'
213198 permissions :
214199 contents : read
215200 with :
216201 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' || '' }}
202+ version : ${{ case(( github.event.pull_request.base.ref || github.ref_name) == 'develop' || github.event_name == 'merge_group', ' develop', '') }}
218203 webapp-artifact : webapp
219204
220205 build_ed_windows :
221206 needs : prepare_ed
222207 name : " Desktop Windows"
223208 uses : ./.github/workflows/build_desktop_windows.yaml
224- if : inputs.skip != true
209+ # Skip Windows builds on PRs, as the Linux amd64 build is enough of a smoke test and includes the screenshot tests
210+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests')
225211 strategy :
226212 matrix :
227213 arch : [x64, ia32, arm64]
@@ -233,17 +219,19 @@ jobs:
233219 needs : prepare_ed
234220 name : " Desktop Linux"
235221 uses : ./.github/workflows/build_desktop_linux.yaml
236- if : inputs.skip != true
237222 strategy :
238223 matrix :
239224 sqlcipher : [system, static]
240225 arch : [amd64, arm64]
241226 runAllTests :
242227 - ${{ 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
244228 exclude :
229+ # We ship static sqlcipher builds, so delegate testing the system builds to the merge queue
245230 - runAllTests : false
246231 sqlcipher : system
232+ # Additionally skip arm64 system builds on PRs, as the amd64 test is enough for a smoke test and includes the screenshot tests
233+ - runAllTests : false
234+ arch : arm64
247235 with :
248236 sqlcipher : ${{ matrix.sqlcipher }}
249237 arch : ${{ matrix.arch }}
@@ -253,49 +241,53 @@ jobs:
253241 needs : prepare_ed
254242 name : " Desktop macOS"
255243 uses : ./.github/workflows/build_desktop_macos.yaml
256- if : inputs.skip != true
244+ # Skip macOS builds on PRs, as the Linux amd64 build is enough of a smoke test and includes the screenshot tests
245+ # and we have a very low limit of concurrent macos runners (5) across the Github org.
246+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests')
257247 with :
258248 blob_report : true
259249
260250 complete :
261251 name : end-to-end-tests
262252 needs :
253+ - build_ew
263254 - playwright_ew
264255 - downstream-modules
256+ - prepare_ed
265257 - build_ed_windows
266258 - build_ed_linux
267259 - build_ed_macos
268260 if : always()
269261 runs-on : ubuntu-24.04
270262 steps :
271263 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
272- if : inputs. skip != true
264+ if : needs.build_ew.outputs. skip == 'false'
273265 with :
274266 persist-credentials : false
275267 repository : element-hq/element-web
276268
277269 - uses : pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
278- if : inputs. skip != true
279- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
280- if : inputs. skip != true
270+ if : needs.build_ew.outputs. skip == 'false'
271+ - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
272+ if : needs.build_ew.outputs. skip == 'false'
281273 with :
282274 cache : " pnpm"
283275 node-version : " lts/*"
284276
285277 - name : Install dependencies
286- if : inputs. skip != true
278+ if : needs.build_ew.outputs. skip == 'false'
287279 run : pnpm install --frozen-lockfile
288280
289281 - name : Download blob reports from GitHub Actions Artifacts
290- if : inputs. skip != true
282+ if : needs.build_ew.outputs. skip == 'false'
291283 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
292284 with :
293285 pattern : blob-report-*
294286 path : all-blob-reports
295287 merge-multiple : true
296288
297289 - name : Merge into HTML Report
298- if : inputs. skip != true
290+ if : needs.build_ew.outputs. skip == 'false'
299291 run : |
300292 pnpm playwright merge-reports \
301293 --config=playwright-merge.config.ts \
@@ -307,8 +299,8 @@ jobs:
307299
308300 # Upload the HTML report even if one of our reporters fails, this can happen when stale screenshots are detected
309301 - name : Upload HTML report
310- if : always() && inputs. skip != true
311- uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
302+ if : always() && needs.build_ew.outputs. skip == 'false'
303+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
312304 with :
313305 name : html-report
314306 path : playwright-report
0 commit comments