|
|
@@ -8,6 +8,7 @@ on:
|
|
|
- 'requirements*.txt'
|
|
|
- 'pyproject.toml'
|
|
|
- 'tests/**'
|
|
|
+ - 'frontend/**'
|
|
|
- '.github/workflows/test.yml'
|
|
|
pull_request:
|
|
|
branches: [ "main" ]
|
|
|
@@ -16,11 +17,13 @@ on:
|
|
|
- 'requirements*.txt'
|
|
|
- 'pyproject.toml'
|
|
|
- 'tests/**'
|
|
|
+ - 'frontend/**'
|
|
|
- '.github/workflows/test.yml'
|
|
|
# Allow manual trigger
|
|
|
workflow_dispatch:
|
|
|
|
|
|
jobs:
|
|
|
+ # Backend tests
|
|
|
test:
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
@@ -78,3 +81,71 @@ jobs:
|
|
|
run: |
|
|
|
ruff check --output-format=github .
|
|
|
continue-on-error: true
|
|
|
+
|
|
|
+ # Frontend unit/integration tests
|
|
|
+ frontend-test:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+
|
|
|
+ defaults:
|
|
|
+ run:
|
|
|
+ working-directory: frontend
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - name: Checkout repository
|
|
|
+ uses: actions/checkout@v4
|
|
|
+
|
|
|
+ - name: Set up Node.js
|
|
|
+ uses: actions/setup-node@v4
|
|
|
+ with:
|
|
|
+ node-version: '20'
|
|
|
+ cache: 'npm'
|
|
|
+ cache-dependency-path: frontend/package-lock.json
|
|
|
+
|
|
|
+ - name: Install dependencies
|
|
|
+ run: npm ci
|
|
|
+
|
|
|
+ - name: Run Vitest tests
|
|
|
+ run: npm test
|
|
|
+
|
|
|
+ - name: Run Vitest with coverage
|
|
|
+ run: npm run test:coverage
|
|
|
+ continue-on-error: true
|
|
|
+
|
|
|
+ # Frontend E2E tests
|
|
|
+ frontend-e2e:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ timeout-minutes: 10
|
|
|
+
|
|
|
+ defaults:
|
|
|
+ run:
|
|
|
+ working-directory: frontend
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - name: Checkout repository
|
|
|
+ uses: actions/checkout@v4
|
|
|
+
|
|
|
+ - name: Set up Node.js
|
|
|
+ uses: actions/setup-node@v4
|
|
|
+ with:
|
|
|
+ node-version: '20'
|
|
|
+ cache: 'npm'
|
|
|
+ cache-dependency-path: frontend/package-lock.json
|
|
|
+
|
|
|
+ - name: Install dependencies
|
|
|
+ run: npm ci
|
|
|
+
|
|
|
+ - name: Install Playwright browsers
|
|
|
+ run: npx playwright install --with-deps chromium
|
|
|
+
|
|
|
+ - name: Run Playwright tests
|
|
|
+ run: npm run test:e2e
|
|
|
+ env:
|
|
|
+ CI: true
|
|
|
+
|
|
|
+ - name: Upload Playwright report
|
|
|
+ uses: actions/upload-artifact@v4
|
|
|
+ if: failure()
|
|
|
+ with:
|
|
|
+ name: playwright-report
|
|
|
+ path: frontend/playwright-report/
|
|
|
+ retention-days: 7
|