feat: enhance user role management and dashboard features #21
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
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| # ===== Web (Next.js) ===== | |
| web: | |
| name: Web · Lint / Format / Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install root + workspaces | |
| run: npm install | |
| - name: Format check | |
| run: npm run format:check | |
| - name: ESLint | |
| run: npm run lint | |
| - name: TypeScript build | |
| run: npm run build:web | |
| # ===== API (FastAPI) — Lint ===== | |
| api-lint: | |
| name: API · Lint (Ruff + Black) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| cache-dependency-path: apps/api/requirements.txt | |
| - working-directory: apps/api | |
| run: | | |
| pip install -r requirements.txt | |
| ruff check . | |
| black --check . | |
| # ===== API — Migrate + Test ===== | |
| api-test: | |
| name: API · Migrate + Pytest (Unit + E2E) | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg16 | |
| env: | |
| POSTGRES_USER: campuson | |
| POSTGRES_PASSWORD: campuson_dev_pw | |
| POSTGRES_DB: campuson_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_URL: postgresql+asyncpg://campuson:campuson_dev_pw@localhost:5432/campuson_test | |
| DATABASE_URL_SYNC: postgresql+psycopg2://campuson:campuson_dev_pw@localhost:5432/campuson_test | |
| REDIS_URL: redis://localhost:6379/0 | |
| LLM_PROVIDER: mock | |
| JWT_SECRET_KEY: ci-secret-do-not-use-in-prod | |
| AUDIT_LOG_ENABLED: 'false' | |
| ENV: development | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| cache-dependency-path: apps/api/requirements.txt | |
| - working-directory: apps/api | |
| run: pip install -r requirements.txt | |
| - name: Enable pgvector + uuid-ossp | |
| run: | | |
| PGPASSWORD=campuson_dev_pw psql -h localhost -U campuson -d campuson_test -c "CREATE EXTENSION IF NOT EXISTS vector;" | |
| PGPASSWORD=campuson_dev_pw psql -h localhost -U campuson -d campuson_test -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' | |
| PGPASSWORD=campuson_dev_pw psql -h localhost -U campuson -d campuson_test -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;" | |
| - name: Alembic migrate (sanity check on fresh DB) | |
| working-directory: apps/api | |
| run: alembic upgrade head | |
| - name: Run pytest (unit + e2e) | |
| working-directory: apps/api | |
| run: pytest -q |