nxtgauge-admin-solid/.github/workflows/ci.yml
Ashwin Kumar 08f0cb6402 feat: comprehensive testing infrastructure
- Add vitest with solid plugin, coverage, jsdom environment
- Create MSW mocks for API responses in test setup
- Add unit test for ProfessionAdminListPage
- Add Playwright accessibility and visual regression configs
- Add sample accessibility and visual tests
- Add ESLint + Prettier configs with SolidJS rules
- Update scripts: test, test:coverage, test:accessibility, test:visual
- Add .gitignore entries for coverage, test-results, playwright-report, .vitest
- Install required dev dependencies: vitest, @solidjs/testing-library, msw, eslint, prettier, typescript, @axe-core/playwright, etc.
- Create .github/workflows/ci.yml with lint, test, coverage, e2e, accessibility, visual checks

This sets up full testing pipeline for admin frontend.
2026-04-08 02:38:17 +02:00

91 lines
2 KiB
YAML

name: Admin Frontend CI
on:
pull_request:
branches: [high-performance]
push:
branches: [high-performance]
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npx eslint . --ext .ts,.tsx
- name: Check Prettier formatting
run: npx prettier --check .
- name: TypeScript type check
run: npx tsc --noEmit
- name: Run Vitest unit tests
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage/lcov.info
fail_ci_if_error: false
- name: Build application
run: npm run build
env:
NODE_ENV: production
e2e-tests:
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build app for E2E
run: npm run build
env:
NODE_ENV: production
- name: Start server (preview)
run: npm run start:3000 &
env:
HOST: 0.0.0.0
PORT: 3000
- name: Wait for server
run: npx wait-on http://localhost:3000
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright accessibility tests
run: npm run test:accessibility
- name: Run Playwright visual regression
run: npm run test:visual
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-admin
path: playwright-report/
retention-days: 14