diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 4f294eb..1bb7dcf 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,7 +13,7 @@ permissions: contents: read jobs: - test: + build: runs-on: ubuntu-latest services: @@ -51,13 +51,25 @@ jobs: pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Run migrations - run: | - alembic upgrade head # или другой инструмент миграции, если используете + # - name: Run migrations + # run: | + # alembic upgrade head # или другой инструмент миграции, если используете - name: Run tests env: # Устанавливаем URL базы для тестов DATABASE_URL: postgresql://user:password@localhost:5432/test_db run: | - pytest \ No newline at end of file + pytest + + - name: Run app + run: | + nohup uvicorn main:app --host 0.0.0.0 --port 8000 & + + - name: Wait for FastAPI + run: | + until curl -s http://localhost:8000/docs; do + echo "Waiting for FastAPI..." + sleep 2 + done + echo "FastAPI is up and running" \ No newline at end of file