ci: add test workflow with Playwright browser caching

This commit is contained in:
Florian Kostenzer
2026-07-14 05:59:27 +02:00
parent ae1586cde7
commit a7b5c2c171
2 changed files with 47 additions and 0 deletions
+42
View File
@@ -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
+5
View File
@@ -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: {