91 lines
2 KiB
YAML
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
|