Skip to content

Commit c58a705

Browse files
feat: add global Playwright installation and caching for future migration
- Install Playwright globally in setup-matrix and cache jobs - Cache Playwright browsers in ~/.cache/ms-playwright - Prepare for future migration from Cypress to Playwright across all projects - Install only Chromium browser to minimize cache size
1 parent 161c054 commit c58a705

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/on-pull-request.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,23 @@ jobs:
138138
restore-keys: |
139139
cypress-${{ runner.os }}-
140140
141+
- name: Cache Playwright browsers
142+
uses: actions/cache@v4
143+
with:
144+
path: ~/.cache/ms-playwright
145+
key: playwright-${{ runner.os }}-${{ hashFiles('**/package.json') }}
146+
restore-keys: |
147+
playwright-${{ runner.os }}-
141148
142149
- name: Install dependencies
143150
run: |
144151
echo "Installing all dependencies to populate cache..."
145152
pnpm install --frozen-lockfile --prefer-offline
146153
npx cypress install
154+
155+
# Install Playwright globally for future migration
156+
npm install -g [email protected]
157+
npx playwright install --with-deps chromium
147158
148159
- name: Create matrix
149160
id: set-matrix

.github/workflows/on-push.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ jobs:
9494
restore-keys: |
9595
cypress-${{ runner.os }}-
9696
97+
- name: Cache Playwright browsers
98+
uses: actions/cache@v4
99+
with:
100+
path: ~/.cache/ms-playwright
101+
key: playwright-${{ runner.os }}-${{ hashFiles('**/package.json') }}
102+
restore-keys: |
103+
playwright-${{ runner.os }}-
97104
98105
- name: Install deps
99106
env:
@@ -108,3 +115,7 @@ jobs:
108115
echo "Installing Cypress binary..."
109116
npx cypress install
110117
fi
118+
119+
# Install Playwright globally for future migration
120+
npm install -g [email protected]
121+
npx playwright install --with-deps chromium

0 commit comments

Comments
 (0)