Skip to content

Commit 1f25800

Browse files
committed
fix/ci/playwright-browser-cache
1 parent aa43e59 commit 1f25800

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ jobs:
6868
~/.local/pipx
6969
~/.cache/pypoetry
7070
~/.cache/pip
71-
~/.cache/ms-playwright
7271
key: setup-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }}
7372
restore-keys: |
7473
setup-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
@@ -149,7 +148,6 @@ jobs:
149148
~/.local/pipx
150149
~/.cache/pypoetry
151150
~/.cache/pip
152-
~/.cache/ms-playwright
153151
key: setup-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }}
154152
restore-keys: |
155153
setup-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
@@ -183,10 +181,18 @@ jobs:
183181
- name: Run API tests
184182
run: poetry run pytest -rfsxE --capture=no --log-cli-level=DEBUG --maxfail=1 ./test/test__server__api.py
185183

184+
- name: Cache Playwright browsers
185+
id: cache-playwright
186+
uses: actions/cache@v4
187+
with:
188+
path: ~/.cache/ms-playwright
189+
key: playwright-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
186190

187191
- name: Install Playwright browser
192+
if: steps.cache-playwright.outputs.cache-hit != 'true'
188193
run: |
189-
poetry run playwright install --with-deps chromium
194+
source .venv/bin/activate
195+
poetry run playwright install chromium
190196
191197
- name: Run Web UI tests
192198
run: poetry run pytest -rfsxE --capture=no --log-cli-level=DEBUG --maxfail=1 --tracing=retain-on-failure ./test/test__server__web_ui.py

0 commit comments

Comments
 (0)