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

on:
pull_request:
branches:
- dev

jobs:
test:
name: Run Tests and Check FastAPI
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: test_db
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U test_user"
--health-interval=10s
--health-timeout=5s
--health-retries=5

redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.12'

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

- name: Check FastAPI Server
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
run: |
uvicorn app.main:app --host 0.0.0.0 --port 8000 --log-level warning &
sleep 5
curl -f http://localhost:8000/docs
Binary file modified requirements.txt
Binary file not shown.