Spaces:
Configuration error
Configuration error
| name: Backend CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend-ci.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend-ci.yml' | |
| jobs: | |
| lint-and-test: | |
| name: Lint & Verify Backend | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| 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: backend/requirements.txt | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends build-essential libpq-dev | |
| - name: Install Python Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install ruff | |
| - name: Generate Prisma Client | |
| run: | | |
| python -m prisma generate | |
| - name: Run Ruff Linter | |
| run: | | |
| ruff check app/ main.py | |
| docker-build: | |
| name: Verify Docker Build | |
| runs-on: ubuntu-latest | |
| needs: lint-and-test | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: backend | |
| file: backend/Dockerfile | |
| push: false | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |