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
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Summary

Provide a brief overview of the changes in this PR.

## Type of Change

- [ ] New Feature
- [ ] Bug Fix
- [ ] Refactor
- [ ] Chore (dependencies, documentation, etc.)
- [ ] Test Addition/Update

## Key Changes

- [ ] List major architectural or logic changes.
- [ ] Mention new database models or schema updates.
- [ ] Describe any new API endpoints or services.

## Database Migrations

- [ ] This PR includes database migrations (`alembic/versions/`).
- [ ] Migrations have been tested locally.

## Testing Strategy

- [ ] Unit tests added/updated.
- [ ] Integration tests added/updated.
- [ ] Manual testing performed.

## Checklist

- [ ] Code follows the project's style guidelines.
- [ ] `uv.lock` and `pyproject.toml` are updated.
- [ ] Documentation (in `docs/`) has been updated if necessary.
- [ ] I have verified the changes in a local environment.

## Screenshots / Console Logs

(Optional: Add any relevant visual evidence of the change)
30 changes: 30 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CD

on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]

jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Deploy to EC2
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
port: ${{ secrets.EC2_PORT }}
script: |
cd /var/www/flint/backend
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" > .env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env
git pull origin main
docker-compose down
docker-compose up -d --build
docker system prune -f
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

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

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: uv sync --frozen

- name: Run ruff check
run: uv run ruff check .

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

- name: Run tests
run: uv run pytest
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ dependencies = [
"asyncpg>=0.31.0",
"fastapi[standard]>=0.136.3",
"gunicorn>=26.0.0",
"httpx2>=2.3.0",
"pydantic-settings>=2.14.1",
"pytest>=9.0.3",
"sqlalchemy[asyncio]>=2.0.50",
]

Expand All @@ -23,3 +25,10 @@ select = [ "E", "F", "I", "B", "UP" ]
quote-style = "double"
indent-style = "space"
line-ending = "auto"

[dependency-groups]
dev = [
"httpx>=0.28.1",
"httpx2>=2.3.0",
"ruff>=0.15.16",
]
Empty file added tests/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions tests/test_health.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from fastapi.testclient import TestClient

from app.main import app

client = TestClient(app)


def test_health():
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
114 changes: 114 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading