Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# .dockerignore

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
*.egg-info/
dist/
build/
.venv/
venv/
.env

# Node
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# IDE
.vscode/
.idea/
*.swp
*.swo
.DS_Store

# Git
.git/
.gitignore

# Logs
logs/
*.log

# Runtime
audio/
transcript.txt
dialogue.html

# Docker
Dockerfile*
docker-compose*.yml
.dockerignore

# CI/CD
.github/
137 changes: 137 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: CI/CD Pipeline

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]

jobs:
lint-and-test:
name: Lint & Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install ruff black isort
pip install -r requirements.txt

- name: Lint Python code (Ruff)
run: ruff check . --fix
continue-on-error: true

- name: Format Python code (Black)
run: black --check .
continue-on-error: true

- name: Check import sorting (isort)
run: isort --check-only .
continue-on-error: true

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install frontend dependencies
working-directory: ./frontend
run: npm ci

- name: Lint frontend code (ESLint)
working-directory: ./frontend
run: npm run lint
continue-on-error: true

- name: Type check frontend (TypeScript)
working-directory: ./frontend
run: npx tsc --noEmit
continue-on-error: true

build-backend:
name: Build Backend Docker Image
runs-on: ubuntu-latest
needs: lint-and-test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build backend image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.backend
push: false
tags: ai-stream-backend:latest
cache-from: type=gha
cache-to: type=gha,mode=max

build-frontend:
name: Build Frontend Docker Image
runs-on: ubuntu-latest
needs: lint-and-test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build frontend image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.frontend
push: false
tags: ai-stream-frontend:latest
cache-from: type=gha
cache-to: type=gha,mode=max

docker-compose-test:
name: Test Docker Compose
runs-on: ubuntu-latest
needs: [build-backend, build-frontend]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create .env file
run: |
echo "GROQ_API_KEY=test_key" >> .env
echo "ELEVENLABS_API_KEY=test_key" >> .env

- name: Build services
run: docker compose build

- name: Start services
run: docker compose up -d

- name: Wait for services to be healthy
run: |
timeout 60 bash -c 'until docker compose ps | grep healthy; do sleep 2; done'

- name: Test backend health
run: |
curl -f http://localhost:8000/health || exit 1

- name: Test frontend
run: |
curl -f http://localhost:80 || exit 1

- name: Stop services
run: docker compose down
8 changes: 8 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
profile = black
line_length = 100
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
ensure_newline_before_comments = True
9 changes: 9 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
line-length = 100
target-version = "py312"

[lint]
select = ["E", "F", "I", "N", "W"]
ignore = ["E501"] # Line too long (handled by black)

[lint.per-file-ignores]
"__init__.py" = ["F401"] # Unused imports in __init__.py
Loading
Loading