Files
medassist-ng/.github/workflows/test.yml
T
Daniel Volz f45e904f2f docs: add GitHub issue templates
- Bug report template with deployment type, browser info, logs
- Feature request template with affected area, priority
- Config with link to discussions and README
- Optimize test.yml to skip tests for non-code changes
2025-12-30 14:07:51 +01:00

85 lines
2.0 KiB
YAML

name: Test
on:
pull_request:
branches: [main]
paths:
- 'backend/**'
- 'frontend/**'
- 'package*.json'
- '.github/workflows/test.yml'
# Minimal permissions for security
permissions:
contents: read
jobs:
# =============================================================================
# Backend Tests
# =============================================================================
backend-test:
name: Backend Tests
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: backend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm ci
- name: TypeScript type check
run: npx tsc --noEmit
- name: Run tests with coverage
run: npm run test:coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: backend-coverage
path: backend/coverage/
retention-days: 7
# =============================================================================
# Frontend Build Validation
# =============================================================================
frontend-build:
name: Frontend Build
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: frontend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: TypeScript type check & build
run: npm run build