🚀 CRADLE v3.0 #346
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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| ruff: | |
| name: Static Analysis - ruff | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.14" | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Run ruff | |
| run: uv run ruff check . | |
| tests: | |
| name: Run Django Tests | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/osgeo/gdal:ubuntu-small-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| services: | |
| postgres: | |
| image: pgrouting/pgrouting:16-3.5-3.7 | |
| env: | |
| POSTGRES_DB: "cradledb" | |
| POSTGRES_USER: "postgres" | |
| POSTGRES_PASSWORD: "postgres" | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7.2 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 3 | |
| minio: | |
| image: bitnamilegacy/minio:2025.7.23-debian-12-r5 | |
| env: | |
| MINIO_ROOT_USER: "admin" | |
| MINIO_ROOT_PASSWORD: "cradle_minio" | |
| options: >- | |
| --health-cmd "curl -fsS http://127.0.0.1:9000/minio/health/live || exit 1" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 12 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| enable-cache: true | |
| - name: Cache APT packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| /var/cache/apt | |
| /var/lib/apt/lists | |
| key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/ci.yml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-apt- | |
| - name: Install system dependencies | |
| run: | | |
| apt update | |
| apt install -y python3-pip libmagic1 | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Settings Copy | |
| run: cp cradle/settings_test.py cradle/settings.py | |
| - name: Apply Migrations | |
| run: | | |
| uv run python3 manage.py migrate | |
| uv run python3 manage.py check | |
| - name: Run Tests with Coverage | |
| run: | | |
| uv run coverage run -m pytest | |
| uv run coverage report |