5656 path : coverage
5757 retention-days : 5
5858
59- playwright :
59+ playwright-prepare :
6060 # NOTE: This name appears in GitHub's Checks API.
61- name : playwright
61+ name : playwright-prepare
6262 needs : [yarn_cache]
6363 runs-on : ubuntu-latest
6464 steps :
@@ -72,24 +72,58 @@ jobs:
7272 - name : Install dependencies
7373 run : yarn install --frozen-lockfile
7474 - run : REACT_APP_E2E_TEST=1 yarn build:ext
75- - run : REACT_APP_E2E_TEST=1 yarn start:prod &
75+ - run : REACT_APP_E2E_TEST=1 yarn build
76+ - name : Upload builds for playwright
77+ uses : actions/upload-artifact@v4
78+ with :
79+ name : builds-for-playwright
80+ path : |
81+ ./build
82+ ./build-ext
83+ retention-days : 5
84+
85+ playwright :
86+ # NOTE: This name appears in GitHub's Checks API.
87+ name : playwright
88+ needs : [playwright-prepare]
89+ runs-on : ubuntu-latest
90+ container :
91+ image : mcr.microsoft.com/playwright:v1.46.1-noble
92+ options : --user 1001
93+ strategy :
94+ fail-fast : false
95+ matrix :
96+ shardIndex : [1, 2, 3, 4, 5, 6, 7, 8]
97+ shardTotal : [8]
98+ steps :
99+ - name : Checkout code
100+ uses : actions/checkout@v4
101+ - name : Set up Node.js 18
102+ uses : actions/setup-node@v4
103+ with :
104+ node-version : ' 18.x'
105+ cache : yarn
106+ - uses : actions/download-artifact@v4
107+ - run : mv ./builds-for-playwright/build ./build
108+ - run : mv ./builds-for-playwright/build-ext ./build-ext
76109 - name : Install playwright's npm dependencies
77110 working-directory : ./playwright/
78111 run : yarn install --frozen-lockfile
79- - name : Install playwright's system dependencies
80- working-directory : ./playwright/
81- run : npx playwright install --with-deps
112+ # outside sharding: yarn + build:ext + build + upload
113+ # and then 8x shard: download builds + serve + test
114+ - run : REACT_APP_E2E_TEST=1 node ./playwright/serve-prod.js &
82115 - run : npx wait-on http://localhost:5000/ --timeout 60000
83116 - name : Run playwright tests (with xvfb-run to support headed extension test)
84117 working-directory : ./playwright/
85- run : xvfb-run yarn test:prod
118+ run : xvfb-run yarn test:prod --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
86119 - name : ' Upload playwright test-results'
87120 if : ${{ failure() }}
88121 uses : actions/upload-artifact@v4
89122 with :
90- name : playwright-test-results
123+ name : playwright-test-results-${{ matrix.shardIndex }}
91124 path : playwright/test-results
92125 retention-days : 5
126+ # TODO: maybe https://playwright.dev/docs/test-sharding#merging-reports-from-multiple-shards
93127
94128 upload-coverage :
95129 # NOTE: This name appears in GitHub's Checks API.
0 commit comments