fix(p0): resolve all 6 production blockers from issue #3 #85
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --------------------------------------------------------------------------- | |
| # Test Suite — Health Dataspace v2 | |
| # --------------------------------------------------------------------------- | |
| # Runs unit tests, API integration tests, lint, and E2E tests for the | |
| # Next.js UI and the Neo4j Query Proxy service. | |
| # | |
| # Unit/API tests use vi.mock() — NO live Neo4j, EDC-V, or Keycloak needed. | |
| # E2E tests (Playwright) build the Next.js app and run against it. | |
| # | |
| # Triggers: | |
| # - Push to any branch | |
| # - Pull request to main | |
| # - Manual dispatch | |
| # --------------------------------------------------------------------------- | |
| name: Test Suite | |
| on: | |
| push: | |
| branches: ["*"] | |
| paths: | |
| - "ui/**" | |
| - "services/neo4j-proxy/**" | |
| - ".github/workflows/test.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "ui/**" | |
| - "services/neo4j-proxy/**" | |
| workflow_dispatch: | |
| env: | |
| NODE_VERSION: "20" | |
| jobs: | |
| # ----------------------------------------------------------------------- | |
| # UI Unit + API Integration Tests (Vitest) | |
| # ----------------------------------------------------------------------- | |
| ui-tests: | |
| name: UI Tests (Vitest) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./ui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| cache-dependency-path: ./ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests with coverage | |
| run: npx vitest run --coverage --reporter=verbose --reporter=json --outputFile=test-results.json | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: ui-coverage | |
| path: | | |
| ui/coverage/ | |
| ui/test-results.json | |
| retention-days: 30 | |
| - name: Coverage summary | |
| if: always() | |
| run: | | |
| echo "## UI Test Coverage" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| npx vitest run --coverage 2>&1 | grep -A 50 "^-.*-$" | head -60 >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| # ----------------------------------------------------------------------- | |
| # Neo4j Query Proxy Tests (Vitest) | |
| # ----------------------------------------------------------------------- | |
| proxy-tests: | |
| name: Neo4j Proxy Tests (Vitest) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./services/neo4j-proxy | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| cache-dependency-path: ./services/neo4j-proxy/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests with coverage | |
| run: npx vitest run --coverage --reporter=verbose --reporter=json --outputFile=test-results.json | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: proxy-coverage | |
| path: | | |
| services/neo4j-proxy/coverage/ | |
| services/neo4j-proxy/test-results.json | |
| retention-days: 30 | |
| - name: Coverage summary | |
| if: always() | |
| run: | | |
| echo "## Neo4j Proxy Test Coverage" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| npx vitest run --coverage 2>&1 | grep -A 10 "^-.*-$" | head -20 >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| # ----------------------------------------------------------------------- | |
| # Lint Check | |
| # ----------------------------------------------------------------------- | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./ui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| cache-dependency-path: ./ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run ESLint | |
| run: npm run lint | |
| # ----------------------------------------------------------------------- | |
| # E2E Tests (Playwright) — only on main / manual dispatch | |
| # ----------------------------------------------------------------------- | |
| e2e-tests: | |
| name: E2E Tests (Playwright) | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' | |
| defaults: | |
| run: | |
| working-directory: ./ui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| cache-dependency-path: ./ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build application | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_STATIC_EXPORT: "false" | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright tests | |
| run: npx playwright test --project=chromium | |
| env: | |
| CI: true | |
| NEXT_PUBLIC_STATIC_EXPORT: "false" | |
| NEXTAUTH_SECRET: ci-test-secret-not-for-production | |
| NEXTAUTH_URL: http://localhost:3000 | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: ui/playwright-report/ | |
| retention-days: 30 |