FastSaas structure #1
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: Tests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| backend-tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:13 | |
| env: | |
| POSTGRES_PASSWORD: changethis | |
| POSTGRES_USER: postgres | |
| POSTGRES_DB: app | |
| 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@v3 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Run database migrations | |
| run: uv run alembic upgrade head | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: changethis | |
| POSTGRES_SERVER: localhost | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_DB: app | |
| - name: Run backend tests | |
| run: uv run pytest app/tests/ -v | |
| env: | |
| SECRET_KEY: test-secret-key-minimum-32-characters-long | |
| FIRST_SUPERUSER_EMAIL: admin@example.com | |
| FIRST_SUPERUSER_PASSWORD: changethis | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: changethis | |
| POSTGRES_SERVER: localhost | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_DB: app | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Run mypy | |
| run: uv run mypy app | |
| - name: Run ruff check | |
| run: uv run ruff check app | |
| - name: Run ruff format check | |
| run: uv run ruff format --check app |