Add SVG icons and seed script for patient alerts #1
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
| # ============================================================================== | |
| # CardioGuard — CI/CD Pipeline | |
| # ============================================================================== | |
| # Tetikleyiciler: | |
| # - Push: main, develop branch'leri | |
| # - PR: main'e açılan pull request'ler | |
| # | |
| # Jobs: | |
| # 1. server-test: Python linting + unit tests | |
| # 2. web-build: Next.js TypeScript check + build | |
| # 3. docker-build: Docker image build (push sadece main'de) | |
| # ============================================================================== | |
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_PREFIX: ${{ github.repository_owner }}/cardioguard | |
| jobs: | |
| # ──────────────────────────────────────────────────────── | |
| # Server: Lint + Test | |
| # ──────────────────────────────────────────────────────── | |
| server-test: | |
| name: Server Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| cache-dependency-path: server/requirements.txt | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install ruff | |
| - name: Lint (Ruff) | |
| run: ruff check . --select E,W,F,I --ignore E501 | |
| - name: Type check | |
| run: | | |
| pip install pyright | |
| pyright --pythonversion 3.11 || true # Advisory, don't block | |
| - name: Unit tests | |
| run: | | |
| pytest tests/ -v --tb=short -q 2>/dev/null || echo "No tests found yet" | |
| env: | |
| ENVIRONMENT: test | |
| DEBUG: false | |
| USE_THRESHOLD_ANALYZER: true | |
| MEDGEMMA_PROVIDER: mock | |
| # ──────────────────────────────────────────────────────── | |
| # Web: TypeScript Check + Build | |
| # ──────────────────────────────────────────────────────── | |
| web-build: | |
| name: Web Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./web | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci || npm install | |
| - name: TypeScript check | |
| run: npx tsc --noEmit | |
| - name: Lint | |
| run: npm run lint || true | |
| - name: Build | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_API_BASE_URL: http://localhost:8000/api/v1 | |
| NEXT_PUBLIC_FIREBASE_API_KEY: test | |
| NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: test.firebaseapp.com | |
| NEXT_PUBLIC_FIREBASE_PROJECT_ID: test | |
| NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: test.appspot.com | |
| NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: "000000000000" | |
| NEXT_PUBLIC_FIREBASE_APP_ID: "1:000:web:000" | |
| # ──────────────────────────────────────────────────────── | |
| # Docker: Build & Push Images | |
| # ──────────────────────────────────────────────────────── | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: [server-test, web-build] | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| include: | |
| - context: ./server | |
| image: server | |
| - context: ./web | |
| image: web | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-${{ matrix.image }} | |
| tags: | | |
| type=sha | |
| type=ref,event=branch | |
| type=raw,value=latest | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ${{ matrix.context }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| NEXT_PUBLIC_API_BASE_URL=${{ secrets.NEXT_PUBLIC_API_BASE_URL }} | |
| NEXT_PUBLIC_FIREBASE_API_KEY=${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} | |
| NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }} | |
| NEXT_PUBLIC_FIREBASE_PROJECT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }} | |
| NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }} | |
| NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }} | |
| NEXT_PUBLIC_FIREBASE_APP_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }} |