Skip to content

Initial commit

Initial commit #21

Workflow file for this run

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Rohan R
# Author: Rohan R
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint & Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install lint deps
run: pip install black flake8 isort
- name: black check
run: black --check src/ tests/
- name: flake8
run: flake8 src/ tests/ --max-line-length=100 --extend-ignore=E203,W503
- name: isort check
run: isort --check-only src/ tests/
test:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install core deps (no torch)
run: |
pip install --upgrade pip
pip install -e ".[dev]"
- name: Run tests
env:
# Real keys are NOT used in CI — tests run with simulation/mocks
NOTION_API_KEY: test_notion_key
ANTHROPIC_API_KEY: test_anthropic_key
AI_MODEL_PROVIDER: anthropic
run: pytest tests/ -v --cov=src --cov-report=xml --cov-report=term-missing
- name: Upload coverage
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.11'
with:
files: coverage.xml
fail_ci_if_error: false
api-smoke:
name: API Smoke Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install deps
run: pip install -e ".[dev]"
- name: Start API server and check /api/status
env:
NOTION_API_KEY: test_key
ANTHROPIC_API_KEY: test_key
run: |
uvicorn notion_health_ai.api:app --host 127.0.0.1 --port 8000 &
sleep 3
curl -f http://127.0.0.1:8000/api/status || exit 1
kill %1
docker:
name: Docker Build (slim)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build slim image (no push)
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: false
tags: notion-health-ai:ci
cache-from: type=gha
cache-to: type=gha,mode=max