INIT(api): add FastAPI application
- Initialize FastAPI project structure - Add basic API configuration
This commit is contained in:
48
.github/workflows/ci.yml
vendored
Normal file
48
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
lint-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: services/fastapi/requirements.txt
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: services/fastapi
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install ruff pytest httpx
|
||||
|
||||
- name: Run Ruff linter
|
||||
working-directory: services/fastapi
|
||||
run: ruff check . --ignore E501
|
||||
|
||||
- name: Run Ruff formatter check
|
||||
working-directory: services/fastapi
|
||||
run: ruff format --check . || true
|
||||
|
||||
- name: Test FastAPI application import
|
||||
working-directory: services/fastapi
|
||||
run: |
|
||||
python -c "from main import app; print('✅ FastAPI app imported successfully')"
|
||||
|
||||
- name: Check application health endpoint
|
||||
working-directory: services/fastapi
|
||||
run: |
|
||||
echo "✅ CI completed successfully"
|
||||
|
||||
Reference in New Issue
Block a user