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
107 changes: 107 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Backend CI

on:
push:
paths:
- "backend/**"
- ".github/workflows/backend.yml"
pull_request:
paths:
- "backend/**"

jobs:
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"

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

- name: Install dependencies
run: uv pip install --system -e ".[dev]"

- name: Ruff lint
run: uv run ruff check .

- name: Ruff format check
run: uv run ruff format --check .

- name: mypy
run: uv run mypy app/

- name: bandit
run: uv run bandit -c pyproject.toml -r app/

test:
name: Tests
runs-on: ubuntu-latest
needs: lint
defaults:
run:
working-directory: backend

services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: devmind
POSTGRES_PASSWORD: devmind
POSTGRES_DB: devmind_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 5

redis:
image: redis:7.4-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"

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

- name: Install dependencies
run: uv pip install --system -e ".[dev]"

- name: Run tests
env:
DATABASE_URL: postgresql+asyncpg://devmind:devmind@localhost:5432/devmind_test
REDIS_URL: redis://localhost:6379/0
ENVIRONMENT: test
run: uv run pytest

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
file: backend/coverage.xml
Empty file added .github/workflows/frontend.yml
Empty file.
Empty file added .github/workflows/release.yml
Empty file.
64 changes: 64 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Python
__pycache__/
*.py[cod]
*.pyo
*.pyd
.Python
*.egg-info/
dist/
build/
*.egg
.eggs/

# Virtual environments
.venv/
venv/
env/

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

# pytest / coverage
.pytest_cache/
.coverage
htmlcov/
coverage.xml

# mypy
.mypy_cache/

# ruff
.ruff_cache/

# Node / Next.js
node_modules/
.next/
out/
dist/

# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# OS
.DS_Store
Thumbs.db

# IDEs
.cursor/
.vscode/
.idea/

# Docker
*.env.docker

# Uploads / temp files
uploads/
tmp/

# Lock files
uv.lock
46 changes: 46 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: ["--maxkb=500"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
- id: ruff
args: [--fix]
files: ^backend/
- id: ruff-format
files: ^backend/

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
files: ^backend/app/
additional_dependencies:
- pydantic>=2.10.4
- pydantic-settings>=2.7.1
- sqlalchemy[asyncio]>=2.0.37
- structlog>=24.4.0
- types-redis>=4.6.0

- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
hooks:
- id: bandit
args: ["-c", "backend/pyproject.toml"]
files: ^backend/app/

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.6.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [feat, fix, chore, test, perf, security, docs, refactor]
10 changes: 10 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
"@semantic-release/git"
]
}
Loading
Loading