Skip to content

Commit fa89ec3

Browse files
authored
feat(ci): enhance Playwright setup with caching and retry logic (#672)
1 parent d5c480d commit fa89ec3

5 files changed

Lines changed: 47 additions & 15 deletions

File tree

.github/workflows/cli.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,25 @@ jobs:
4545
node-version: 24
4646
- name: Install dependencies
4747
run: npm ci
48+
- name: Install backend dependencies
49+
run: npm ci
50+
working-directory: nestjs-boilerplate
4851
- name: Set up env
4952
run: cp example.env.local .env.local
50-
- name: Install Playwright Browsers
53+
- name: Resolve Playwright version
54+
id: pw
55+
run: echo "version=$(node -e "console.log(require('@playwright/test/package.json').version)")" >> "$GITHUB_OUTPUT"
56+
- name: Cache Playwright browsers
57+
id: pw-cache
58+
uses: actions/cache@v4
59+
with:
60+
path: ~/.cache/ms-playwright
61+
key: ${{ runner.os }}-playwright-${{ steps.pw.outputs.version }}
62+
- name: Install Playwright system deps (cache hit)
63+
if: steps.pw-cache.outputs.cache-hit == 'true'
64+
run: npx playwright install-deps chromium
65+
- name: Install Playwright browsers (cache miss)
66+
if: steps.pw-cache.outputs.cache-hit != 'true'
5167
run: npx playwright install --with-deps chromium
5268
- name: Run CRUD generator suite
5369
env:

.github/workflows/e2e.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,20 @@ jobs:
3232
run: npm ci
3333
- name: Run lint
3434
run: npm run lint
35-
- name: Install Playwright Browsers
35+
- name: Resolve Playwright version
36+
id: pw
37+
run: echo "version=$(node -e "console.log(require('@playwright/test/package.json').version)")" >> "$GITHUB_OUTPUT"
38+
- name: Cache Playwright browsers
39+
id: pw-cache
40+
uses: actions/cache@v4
41+
with:
42+
path: ~/.cache/ms-playwright
43+
key: ${{ runner.os }}-playwright-${{ steps.pw.outputs.version }}
44+
- name: Install Playwright system deps (cache hit)
45+
if: steps.pw-cache.outputs.cache-hit == 'true'
46+
run: npx playwright install-deps chromium
47+
- name: Install Playwright browsers (cache miss)
48+
if: steps.pw-cache.outputs.cache-hit != 'true'
3649
run: npx playwright install --with-deps chromium
3750
- name: Run Playwright tests
3851
run: npx playwright test

eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const eslintConfig = defineConfig([
2323
".install-scripts/**",
2424
"*.config.js",
2525
"*.config.mjs",
26+
27+
"backend/**",
28+
"nestjs-boilerplate/**",
2629
]),
2730

2831
// Custom rules and overrides

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@commitlint/config-conventional": "20.5.0",
6767
"@eslint/eslintrc": "3.3.5",
6868
"@eslint/js": "9.39.4",
69-
"@playwright/test": "1.58.2",
69+
"@playwright/test": "1.60.0",
7070
"@release-it/conventional-changelog": "10.0.6",
7171
"@storybook/addon-docs": "10.3.1",
7272
"@storybook/addon-links": "10.3.1",

0 commit comments

Comments
 (0)