mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 18:42:34 +01:00
Add Vitest 4 with happy-dom, @vue/test-utils, and a single test/storybook.test.ts that auto-discovers every story under src/v2/lib and runs its play() via composeStories — no Playwright, just composition-based interaction tests. 89 stories now smoke-pass in CI. Scripts: lint:fix (auto-fix), lint (now scoped to ./src/v2; v1 is frozen), lint:all (legacy sweep), test, test:watch, test:ui, storybook:test. eslint.config.js gets argsIgnorePattern: "^_" so unused-by-design parameters can use the underscore convention. CI: new frontend.yml runs lint, test, build in parallel on frontend/** changes; typecheck.yml bumped to Node 22 with cached npm ci. Existing typecheck job preserved for branch protection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
78 lines
1.7 KiB
YAML
78 lines
1.7 KiB
YAML
name: Frontend Checks
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "frontend/**"
|
|
push:
|
|
branches:
|
|
- "master"
|
|
paths:
|
|
- "frontend/**"
|
|
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4.3.0
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v5.0.0
|
|
with:
|
|
node-version: "22"
|
|
cache: "npm"
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
working-directory: frontend
|
|
|
|
- name: Run lint
|
|
run: npm run lint
|
|
working-directory: frontend
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4.3.0
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v5.0.0
|
|
with:
|
|
node-version: "22"
|
|
cache: "npm"
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
working-directory: frontend
|
|
|
|
- name: Run tests (vitest, includes Storybook play() tests)
|
|
run: npm test
|
|
working-directory: frontend
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4.3.0
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v5.0.0
|
|
with:
|
|
node-version: "22"
|
|
cache: "npm"
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
working-directory: frontend
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
working-directory: frontend
|