Skip to content

Commit

Permalink
ci: update test dependencies and remove playwright caching
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede committed Jul 25, 2024
1 parent 2c9497b commit 1b4819d
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 172 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,26 +164,8 @@ jobs:
- name: Install dependencies
run: pnpm install --no-frozen-lockfile

# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
# Install playwright's binary under custom directory to cache
- name: Set Playwright path
if: runner.os != 'Windows'
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
- name: Set Playwright path (windows)
if: runner.os == 'Windows'
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV

- name: Cache Playwright's binary
uses: actions/cache@v4
with:
# Playwright removes unused browsers automatically
# So does not need to add playwright version to key
key: ${{ runner.os }}-playwright-bin-v1
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}

- name: Install Playwright
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
run: pnpm playwright install chromium
run: pnpm playwright-core install chromium

- name: Restore dist cache
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion e2e/helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { JSDOM } from 'jsdom'

import type { Page } from 'playwright'
import type { Page } from 'playwright-core'

export function sleep(delay: number) {
return new Promise(resolve => setTimeout(resolve, delay))
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"opener": "^1.5.2",
"pathe": "^1.1.2",
"picocolors": "^1.0.0",
"playwright": "^1.34.0",
"playwright-core": "^1.45.3",
"prettier": "^3.2.5",
"rc": "^1.2.8",
"rimraf": "^6.0.0",
Expand Down Expand Up @@ -145,7 +145,7 @@
"typescript": "^5.3.3",
"typescript-eslint": "^7.5.0",
"vitepress": "1.3.1",
"vitest": "^2.0.0",
"vitest": "^2.0.4",
"vue": "3.4.31",
"vue-i18n": "workspace:*"
},
Expand Down
Loading

0 comments on commit 1b4819d

Please sign in to comment.