@@ -310,12 +310,21 @@ jobs:
310310 run : pnpm test:native
311311
312312 # ---------------------------------------------------------------------------
313- # Optional / manual jobs
313+ # Required end-to-end correctness
314314 # ---------------------------------------------------------------------------
315- playwright :
316- name : Playwright (Manual)
317- if : github.event_name == 'workflow_dispatch'
318- runs-on : ubuntu-latest
315+ e2e :
316+ name : E2E ${{ matrix.name }}
317+ strategy :
318+ fail-fast : false
319+ matrix :
320+ include :
321+ - name : Visual
322+ project : visual
323+ runner : macos-latest
324+ - name : GPU
325+ project : gpu
326+ runner : macos-latest
327+ runs-on : ${{ matrix.runner }}
319328 permissions :
320329 contents : read
321330 steps :
@@ -332,12 +341,7 @@ jobs:
332341 - name : Install toolchain
333342 run : rustup show
334343
335- - uses : Swatinem/rust-cache@v2
336- with :
337- shared-key : shift-rust
338-
339344 - name : Cache node_modules
340- id : modules-cache
341345 uses : actions/cache@v6
342346 with :
343347 path : |
@@ -350,38 +354,38 @@ jobs:
350354 - name : Install dependencies
351355 run : pnpm install --frozen-lockfile --prefer-offline
352356
353- - name : Cache Playwright browsers
354- id : playwright-cache
355- uses : actions/cache@v6
356- with :
357- path : ~/.cache/ms-playwright
358- key : playwright-${{ runner.os }}-${{ hashFiles('apps/desktop/node_modules/@playwright/test/package.json') }}
359-
360- - name : Install Playwright browsers
361- if : steps.playwright-cache.outputs.cache-hit != 'true'
362- run : pnpm --filter @shift/desktop exec playwright install
363-
364357 - name : Cache native module binary
365358 id : native-cache
366359 uses : actions/cache@v6
367360 with :
368361 path : crates/shift-bridge/*.node
369362 key : native-module-${{ runner.os }}-${{ hashFiles('crates/**', 'Cargo.lock') }}
370363
364+ - uses : Swatinem/rust-cache@v2
365+ if : steps.native-cache.outputs.cache-hit != 'true'
366+ with :
367+ shared-key : shift-rust-${{ runner.os }}
368+
371369 - name : Build native module
372370 if : steps.native-cache.outputs.cache-hit != 'true'
373371 run : pnpm build:native
374372
375- - name : Run Playwright tests
376- run : xvfb-run pnpm test:playwright
377- env :
378- LIBGL_ALWAYS_SOFTWARE : " true"
373+ - name : Build E2E app
374+ run : pnpm --filter @shift/desktop build:e2e
375+
376+ - name : Run visual E2E tests
377+ if : matrix.project == 'visual'
378+ run : pnpm --filter @shift/desktop exec playwright test --project=visual
379+
380+ - name : Run GPU E2E tests
381+ if : matrix.project == 'gpu'
382+ run : pnpm --filter @shift/desktop exec playwright test --project=gpu
379383
380- - name : Upload snapshots on failure
384+ - name : Upload Playwright failures
381385 if : failure()
382386 uses : actions/upload-artifact@v7
383387 with :
384- name : playwright-results
388+ name : playwright-${{ matrix.project }}- results
385389 path : apps/desktop/e2e/test-results/
386390 retention-days : 7
387391
@@ -400,6 +404,7 @@ jobs:
400404 - rust-fmt
401405 - rust-check
402406 - integration
407+ - e2e
403408 runs-on : ubuntu-latest
404409 permissions : {}
405410 steps :
0 commit comments