129 lines
2.8 KiB
YAML
129 lines
2.8 KiB
YAML
name: Frontend Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main, master, develop]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
dashboard-unit-tests:
|
|
name: Dashboard Unit Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run dashboard unit tests
|
|
run: npm --workspace @insforge/dashboard run test:unit
|
|
|
|
dashboard-component-tests:
|
|
name: Dashboard Component Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run dashboard component tests
|
|
run: npm --workspace @insforge/dashboard run test:component
|
|
|
|
ui-unit-tests:
|
|
name: UI Unit Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run UI unit tests
|
|
run: npm --workspace @insforge/ui run test:unit
|
|
|
|
ui-component-tests:
|
|
name: UI Component Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run UI component tests
|
|
run: npm --workspace @insforge/ui run test:component
|
|
|
|
dashboard-e2e-tests:
|
|
name: Dashboard E2E Tests
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- dashboard-unit-tests
|
|
- dashboard-component-tests
|
|
- ui-unit-tests
|
|
- ui-component-tests
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Install Playwright Chromium
|
|
run: npx playwright install --with-deps chromium
|
|
|
|
- name: Run dashboard E2E tests
|
|
run: npm --workspace @insforge/dashboard run test:ui
|
|
|
|
- name: Upload Playwright artifacts
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dashboard-playwright-results
|
|
path: |
|
|
packages/dashboard/playwright-report/
|
|
packages/dashboard/test-results/
|
|
retention-days: 7
|