12
12
runs-on : ubuntu-latest
13
13
outputs :
14
14
cache-key : ${{ steps.cache-key.outputs.key }}
15
+ playwright-version : ${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
15
16
steps :
16
17
- name : Checkout ComfyUI
17
18
uses : actions/checkout@v4
66
67
id : cache-key
67
68
run : echo "key=$(date +%s)" >> $GITHUB_OUTPUT
68
69
70
+ - name : Playwright Version
71
+ id : playwright-version
72
+ run : |
73
+ PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --raw-output '.[0].devDependencies["@playwright/test"].version')
74
+ echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
75
+ working-directory : ComfyUI_frontend
76
+
69
77
- name : Save cache
70
78
uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
71
79
with :
@@ -116,16 +124,30 @@ jobs:
116
124
pip install wait-for-it
117
125
working-directory : ComfyUI
118
126
127
+
128
+ - name : Cache Playwright Browsers
129
+ uses : actions/cache@v4
130
+ id : cache-playwright-browsers
131
+ with :
132
+ path : ' ~/.cache/ms-playwright'
133
+ key : ' ${{ runner.os }}-playwright-browsers-${{ needs.setup.outputs.playwright-version }}'
134
+
135
+ - name : Install Playwright Browsers
136
+ if : steps.cache-playwright-browsers.outputs.cache-hit != 'true'
137
+ run : pnpm exec playwright install chromium --with-deps
138
+ working-directory : ComfyUI_frontend
139
+
140
+ - name : Install Playwright Browsers (operating system dependencies)
141
+ if : steps.cache-playwright-browsers.outputs.cache-hit == 'true'
142
+ run : pnpm exec playwright install-deps
143
+ working-directory : ComfyUI_frontend
144
+
119
145
- name : Start ComfyUI server
120
146
run : |
121
147
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
122
148
wait-for-it --service 127.0.0.1:8188 -t 600
123
149
working-directory : ComfyUI
124
150
125
- - name : Install Playwright Browsers
126
- run : npx playwright install chromium --with-deps
127
- working-directory : ComfyUI_frontend
128
-
129
151
- name : Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
130
152
id : playwright
131
153
run : npx playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
@@ -141,7 +163,7 @@ jobs:
141
163
retention-days : 1
142
164
143
165
playwright-tests :
144
- # Ideally, each shard runs test in 6 minutes, but allow up to 15 minutes
166
+ # Ideally, each shard runs test in 6 minutes, but allow up to 15 minutes
145
167
timeout-minutes : 15
146
168
needs : setup
147
169
runs-on : ubuntu-latest
@@ -182,16 +204,29 @@ jobs:
182
204
pip install wait-for-it
183
205
working-directory : ComfyUI
184
206
207
+ - name : Cache Playwright Browsers
208
+ uses : actions/cache@v4
209
+ id : cache-playwright-browsers
210
+ with :
211
+ path : ' ~/.cache/ms-playwright'
212
+ key : ' ${{ runner.os }}-playwright-browsers-${{ needs.setup.outputs.playwright-version }}'
213
+
214
+ - name : Install Playwright Browsers
215
+ if : steps.cache-playwright-browsers.outputs.cache-hit != 'true'
216
+ run : pnpm exec playwright install chromium --with-deps
217
+ working-directory : ComfyUI_frontend
218
+
219
+ - name : Install Playwright Browsers (operating system dependencies)
220
+ if : steps.cache-playwright-browsers.outputs.cache-hit == 'true'
221
+ run : pnpm exec playwright install-deps
222
+ working-directory : ComfyUI_frontend
223
+
185
224
- name : Start ComfyUI server
186
225
run : |
187
226
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
188
227
wait-for-it --service 127.0.0.1:8188 -t 600
189
228
working-directory : ComfyUI
190
229
191
- - name : Install Playwright Browsers
192
- run : npx playwright install chromium --with-deps
193
- working-directory : ComfyUI_frontend
194
-
195
230
- name : Run Playwright tests (${{ matrix.browser }})
196
231
id : playwright
197
232
run : npx playwright test --project=${{ matrix.browser }} --reporter=html
@@ -248,4 +283,4 @@ jobs:
248
283
with :
249
284
name : playwright-report-chromium
250
285
path : ComfyUI_frontend/playwright-report/
251
- retention-days : 30
286
+ retention-days : 30
0 commit comments