Skip to content

Commit 5e36493

Browse files
committed
chore: Update Playwright version and refine unit test workflow
- Added Playwright version 1.52.0 to dependencies in package.json and pnpm-lock.yaml. - Updated GitHub Actions workflow to use Playwright container image for unit tests. - Simplified unit test steps by removing unnecessary commands and ensuring proper dependency installation.
1 parent e3b9c2c commit 5e36493

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

.github/workflows/unit-test.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: 'Tests: Unit'
2-
32
on:
43
push:
54
branches: [main]
@@ -9,31 +8,27 @@ on:
98

109
jobs:
1110
unit_tests:
12-
name: Run unit tests for Package
11+
name: Run unit tests
1312
runs-on: ubuntu-latest
13+
container:
14+
image: mcr.microsoft.com/playwright:v1.52.0-noble
15+
options: --user 1001
1416

1517
steps:
1618
- uses: actions/checkout@v4
19+
- uses: pnpm/[email protected]
20+
with:
21+
version: 8.12.1
1722
- uses: actions/setup-node@v4
1823
with:
1924
node-version: 22.x
20-
- uses: actions/cache@v4
21-
with:
22-
path: ~/.pnpm-store
23-
# prettier-ignore
24-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
25-
restore-keys: ${{ runner.os }}-pnpm-
26-
- uses: pnpm/[email protected]
27-
with:
28-
version: '^8.0.0'
25+
cache: 'pnpm'
2926
- name: Install dependencies
30-
run: pnpm recursive install
31-
- name: Install Playwright browsers
32-
run: pnpm exec playwright install chromium --with-deps
33-
working-directory: packages/sveltekit-embed
34-
- name: Run unit tests
35-
run: pnpm run test:ci
36-
working-directory: packages/sveltekit-embed
27+
run: pnpm install
28+
- name: Build
29+
run: pnpm run build
3730
env:
3831
PUBLIC_FATHOM_ID: ${{ secrets.PUBLIC_FATHOM_ID }}
3932
PUBLIC_FATHOM_URL: ${{ secrets.PUBLIC_FATHOM_URL }}
33+
- name: Test
34+
run: pnpm run test:ci

packages/sveltekit-embed/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"fathom-client": "^3.7.2",
9494
"globals": "^16.1.0",
9595
"jsdom": "^26.1.0",
96+
"playwright": "^1.52.0",
9697
"prettier": "^3.5.3",
9798
"prettier-plugin-svelte": "^3.4.0",
9899
"prettier-plugin-tailwindcss": "^0.6.11",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)