diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 7f1bba1..021effc 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -31,6 +31,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Python 3.11 uses: actions/setup-python@v5 @@ -47,6 +49,7 @@ jobs: - name: Run pylint on backend run: | + git fetch origin main changed_files=$(git diff --name-only origin/main...HEAD | grep '\.py$' || true) if [ -n "$changed_files" ]; then pylint $changed_files --exit-zero | tee pylint.log @@ -60,7 +63,7 @@ jobs: - name: Start backend server (background) run: | - uvicorn main:app --host 0.0.0.0 --port 8000 & + uvicorn main:app --host 0.0.0.0 --port 8000 || exit 1 & sleep 5 # Wait for server to start - name: Run pytest on backend (HTTP API tests)