mirror of
https://github.com/rajnandan1/kener.git
synced 2026-08-07 07:14:56 +00:00
ci: add test workflow with Playwright browser caching
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Get Playwright version
|
||||
id: playwright-version
|
||||
run: echo "version=$(node -p "require('./package-lock.json').packages['node_modules/playwright'].version")" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache Playwright browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
|
||||
|
||||
- name: Install Playwright Chromium
|
||||
run: npx playwright install --with-deps chromium
|
||||
|
||||
- name: Type check
|
||||
run: npm run check
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
@@ -72,6 +72,11 @@ export default defineConfig(({ mode }) => {
|
||||
},
|
||||
{
|
||||
extends: "./vite.config.ts",
|
||||
// Pre-bundle the component-test dependency graph: on a cold Vite cache
|
||||
// (every CI runner) a mid-run dep-optimization reload can flake the suite.
|
||||
optimizeDeps: {
|
||||
include: ["layerchart", "mode-watcher", "bits-ui", "d3-scale", "d3-shape"],
|
||||
},
|
||||
test: {
|
||||
name: "client",
|
||||
browser: {
|
||||
|
||||
Reference in New Issue
Block a user