silk-graph 0.2.4

Merkle-CRDT graph engine for distributed, conflict-free knowledge graphs
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

env:
  CARGO_TERM_COLOR: always

jobs:
  rust:
    name: Rust tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt
      - uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --check

      - name: Clippy (no Python)
        run: cargo clippy --no-default-features -- -D warnings

      - name: Run Rust tests
        run: cargo test --no-default-features

  python:
    name: Python tests (${{ matrix.python-version }})
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.11", "3.12", "3.13"]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Build and install
        run: |
          pip install maturin pytest
          maturin build --release --features python --out dist
          pip install dist/*.whl

      - name: Run Python tests
        run: pytest pytests/ -v

      - name: Run examples
        if: matrix.python-version == '3.12'
        run: |
          python examples/offline_first.py
          python examples/partition_heal.py
          python examples/concurrent_writes.py
          python examples/ring_topology.py