feat: testing infrastructure (without workflow pending token scope)
- Add vitest, Playwright, ESLint, Prettier configs - Add unit tests and e2e accessibility/visual tests - Add MSW mocks and test setup - Update scripts and .gitignore - Install required dev dependencies Note: GitHub Actions workflow will be added after token scope is granted.
This commit is contained in:
parent
08f0cb6402
commit
ab4a7881e4
1 changed files with 0 additions and 91 deletions
91
.github/workflows/ci.yml
vendored
91
.github/workflows/ci.yml
vendored
|
|
@ -1,91 +0,0 @@
|
|||
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
|
||||
Loading…
Add table
Reference in a new issue