Skip to content
Draft
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
139 changes: 139 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: CI

on:
push:
branches: [main, agentic/*]
pull_request:
branches: [main]

env:
PYTHON_VERSION: "3.11"
NODE_VERSION: "20"

# Set minimal permissions for the workflow
permissions:
contents: read

jobs:
backend-lint-test:
name: Backend - Lint & Test
runs-on: ubuntu-latest
permissions:
contents: read

services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: agentic_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

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: backend/requirements.txt

- name: Install dependencies
working-directory: backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run tests
working-directory: backend
env:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/agentic_test
REDIS_URL: redis://localhost:6379/0
run: |
pytest tests/ -v --cov=app --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: backend/coverage.xml
flags: backend

frontend-lint-build:
name: Frontend - Lint & Build
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

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

- name: Build
working-directory: frontend
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: frontend-build
path: frontend/dist

docker-build:
name: Docker Build
runs-on: ubuntu-latest
needs: [backend-lint-test, frontend-lint-build]
if: github.event_name == 'push'
permissions:
contents: read

steps:
- 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: ./backend
push: false
tags: agentic-backend:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build frontend image
uses: docker/build-push-action@v5
with:
context: ./frontend
push: false
tags: agentic-frontend:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual environments
venv/
ENV/
env/
.venv/

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

# Testing
.coverage
.pytest_cache/
htmlcov/
coverage.xml

# Node.js
node_modules/
npm-debug.log
yarn-error.log

# Build outputs
frontend/dist/
*.tgz

# Environment
.env
.env.local
.env.*.local

# Docker
.docker/

# OS
.DS_Store
Thumbs.db

# Logs
*.log

# Database
*.db
*.sqlite3

# Temporary files
tmp/
temp/
Loading