CI #395
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: {} | |
| schedule: | |
| - cron: "0 3 * * *" # nightly integration run (real backends via Docker) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - run: uv sync --all-extras --no-extra pii --group dev | |
| - run: uv run ruff check src/ tests/ | |
| - run: uv run ruff format --check src/ tests/ | |
| typecheck: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - run: uv sync --all-extras --no-extra pii --group dev | |
| - run: uv run mypy src/pyfly --strict | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: uv sync --all-extras --no-extra pii --group dev | |
| - name: Run tests | |
| run: > | |
| uv run pytest tests/ | |
| --ignore=tests/data/document | |
| --ignore=tests/data/test_mongo_batch_operations.py | |
| --ignore=tests/data/test_mongo_document.py | |
| --ignore=tests/data/test_mongo_filter.py | |
| --ignore=tests/data/test_mongo_post_processor.py | |
| --ignore=tests/data/test_mongo_query_decorator.py | |
| --ignore=tests/data/test_mongo_projection_query.py | |
| --ignore=tests/data/test_mongo_query_compiler.py | |
| --ignore=tests/data/test_mongo_repository.py | |
| --ignore=tests/data/test_mongo_repository_parity.py | |
| --ignore=tests/data/test_mongo_specification.py | |
| --ignore=tests/data/test_mongo_wiring.py | |
| -q --tb=short | |
| --cov=src/pyfly --cov-report=term-missing --cov-report=xml | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.13' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-report | |
| path: coverage.xml | |
| integration: | |
| name: Integration (Docker) | |
| # Not a PR merge gate (per project decision): runs on manual dispatch + nightly only. | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - run: uv sync --all-extras --no-extra pii --group dev | |
| - name: Run integration tests (Docker required — fail, don't skip) | |
| env: | |
| PYFLY_INTEGRATION_REQUIRE_DOCKER: "1" | |
| run: uv run pytest -m integration tests/integration -q --tb=short | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [lint, typecheck, test] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - run: uv build | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: dist/ |