56
56
path : coverage
57
57
retention-days : 5
58
58
59
- playwright :
59
+ playwright-prepare :
60
60
# NOTE: This name appears in GitHub's Checks API.
61
- name : playwright
61
+ name : playwright-prepare
62
62
needs : [yarn_cache]
63
63
runs-on : ubuntu-latest
64
64
steps :
@@ -72,24 +72,58 @@ jobs:
72
72
- name : Install dependencies
73
73
run : yarn install --frozen-lockfile
74
74
- 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
76
109
- name : Install playwright's npm dependencies
77
110
working-directory : ./playwright/
78
111
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 &
82
115
- run : npx wait-on http://localhost:5000/ --timeout 60000
83
116
- name : Run playwright tests (with xvfb-run to support headed extension test)
84
117
working-directory : ./playwright/
85
- run : xvfb-run yarn test:prod
118
+ run : xvfb-run yarn test:prod --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
86
119
- name : ' Upload playwright test-results'
87
120
if : ${{ failure() }}
88
121
uses : actions/upload-artifact@v4
89
122
with :
90
- name : playwright-test-results
123
+ name : playwright-test-results-${{ matrix.shardIndex }}
91
124
path : playwright/test-results
92
125
retention-days : 5
126
+ # TODO: maybe https://playwright.dev/docs/test-sharding#merging-reports-from-multiple-shards
93
127
94
128
upload-coverage :
95
129
# NOTE: This name appears in GitHub's Checks API.
0 commit comments