1.2.7 - TypeDB 3.8.0 Support and Batch Operations Optimization #259
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: [master, develop] | |
| pull_request: | |
| branches: [master, develop] | |
| jobs: | |
| # Code quality: linting and formatting (parallel) | |
| lint: | |
| name: Python ${{ matrix.check }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| check: [ruff-lint, ruff-format] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Run ruff lint check | |
| if: matrix.check == 'ruff-lint' | |
| run: uv run ruff check . | |
| - name: Run ruff format check | |
| if: matrix.check == 'ruff-format' | |
| run: uv run ruff format --check . | |
| # Type checking with pyright (parallel matrix for faster execution) | |
| typecheck: | |
| name: Python Type Check (${{ matrix.target }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: [type_bridge, examples, tests] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Install pyright | |
| run: uv pip install pyright | |
| - name: Run pyright on ${{ matrix.target }} | |
| run: uv run pyright ${{ matrix.target }}/ | |
| # Unit tests (fast, no external dependencies, parallel execution) | |
| test-unit: | |
| name: Python Unit Tests (${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.13"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Install pytest-xdist for parallel execution | |
| run: uv pip install pytest-xdist | |
| - name: Run unit tests in parallel | |
| run: uv run pytest tests/unit/ -v --tb=short -n auto | |
| # Integration tests (require TypeDB server, parallel by test category) | |
| test-integration: | |
| name: Python Integration (${{ matrix.test-group }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| test-group: [crud, queries, schema, expressions] | |
| # Start TypeDB as a service container (runs first, before steps) | |
| services: | |
| typedb: | |
| image: typedb/typedb:3.8.0-rc0 | |
| ports: | |
| - 1729:1729 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --extra dev | |
| - name: Wait for TypeDB server to be ready | |
| run: | | |
| echo "Waiting for TypeDB server to start..." | |
| echo "Container ID: ${{ job.services.typedb.id }}" | |
| # Show initial logs for debugging | |
| echo "=== Initial TypeDB logs ===" | |
| docker logs ${{ job.services.typedb.id }} 2>&1 || echo "Could not fetch logs" | |
| echo "===========================" | |
| # Wait for server to be ready by checking port connectivity | |
| for i in {1..30}; do | |
| if nc -z localhost 1729 2>/dev/null; then | |
| echo "TypeDB server is ready on port 1729!" | |
| docker logs ${{ job.services.typedb.id }} 2>&1 | tail -20 | |
| break | |
| fi | |
| echo "Waiting for port 1729... ($i/30)" | |
| sleep 2 | |
| done | |
| # Final check | |
| if ! nc -z localhost 1729 2>/dev/null; then | |
| echo "ERROR: TypeDB server did not start within 60 seconds" | |
| echo "=== Full TypeDB logs ===" | |
| docker logs ${{ job.services.typedb.id }} 2>&1 | |
| exit 1 | |
| fi | |
| - name: Run integration tests for ${{ matrix.test-group }} | |
| env: | |
| USE_DOCKER: false | |
| TYPEDB_ADDRESS: localhost:1729 | |
| run: uv run pytest tests/integration/${{ matrix.test-group }} -m integration -v --tb=short |