Update docs/diagrams/use_cases.md #119
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Backend CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "src/backend/**" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| - ".github/workflows/backend.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "src/backend/**" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --frozen | |
| - name: Run ruff linter | |
| run: uv run ruff check src/backend | |
| - name: Run ruff formatter check | |
| run: uv run ruff format --check src/backend | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| # Set working directory to root to follow pyproject.toml logic | |
| services: | |
| postgres: | |
| image: postgres:15-alpine | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: interpres_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --frozen | |
| - name: Run tests | |
| env: | |
| DATABASE_URL: postgresql://test:test@localhost:5432/interpres_test | |
| LANCEDB_PATH: ./lancedb_data | |
| run: uv run pytest --cov=src/backend --cov-report=xml --junitxml=junit.xml | |
| # Use Railway so no need to activate this step | |
| # build-push: | |
| # name: Build & Push Container | |
| # runs-on: ubuntu-latest | |
| # needs: test | |
| # permissions: | |
| # contents: read | |
| # packages: write | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - name: Set up Docker Buildx | |
| # uses: docker/setup-buildx-action@v3 | |
| # - name: Log in to GitHub Container Registry | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # registry: ghcr.io | |
| # username: ${{ github.actor }} | |
| # password: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Lowercase REPO | |
| # run: | | |
| # echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
| # - name: Build and push Docker image | |
| # uses: docker/build-push-action@v5 | |
| # with: | |
| # context: . | |
| # file: src/backend/Dockerfile | |
| # push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| # tags: | | |
| # ghcr.io/${{ env.REPO }}/backend:latest | |
| # ghcr.io/${{ env.REPO }}/backend:${{ github.sha }} |