Add cursor rules #179
Workflow file for this run
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: CI Pipeline Template | |
| 'on': | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| lint-and-format: | |
| name: Run Linters & Formatters | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.13 | |
| - name: Install dependencies | |
| run: | | |
| pip install uv | |
| uv sync --frozen --no-cache --no-install-project --all-groups | |
| - name: Install pre-commit | |
| run: pip install pre-commit | |
| - name: Run linters and formatters | |
| run: pre-commit run --all-files | |
| tests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: lint-and-format | |
| timeout-minutes: 15 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: dev | |
| POSTGRES_PASSWORD: dev | |
| POSTGRES_DB: test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U dev -d test" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| PROJECT_NAME: python-template | |
| ASYNC_DATABASE_URL: postgresql+asyncpg://dev:dev@localhost:5432/test | |
| DATABASE_POOL_PRE_PING: True | |
| DATABASE_POOL_SIZE: 5 | |
| DATABASE_POOL_RECYCLE: 3600 | |
| DATABASE_MAX_OVERFLOW: 10 | |
| LOG_LEVEL: DEBUG | |
| SERVER_URL: example.com | |
| ACCESS_TOKEN_EXPIRE_MINUTES: 15 | |
| JWT_SIGNING_KEY: your-signing-key | |
| CELERY_BROKER_URL: amqp://guest:guest@rabbitmq:5672 | |
| CELERY_RESULT_BACKEND: redis://redis:6379/0 | |
| OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4317 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.13 | |
| - name: Install dependencies | |
| run: | | |
| pip install uv | |
| uv sync --frozen --no-cache --no-install-project --group dev --no-group types | |
| - name: Run tests with coverage | |
| run: | | |
| uv run coverage run -m pytest | |
| uv run coverage report -m --fail-under=80 | |
| docker-build: | |
| name: Build Docker Image | |
| runs-on: ubuntu-latest | |
| needs: tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-docker-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-docker- | |
| - name: Build image with cache | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: false | |
| tags: python-template:latest | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache,mode=max |