code2graph 0.0.0-beta.3

Purpose-neutral code-graph extraction: source files → symbols, references, and cross-file edges. Tree-sitter based, no storage opinion.
Documentation
name: Test

# Reusable test suite. Called by ci.yml (PR gate) and release.yml (pre-publish gate)
# so both run the exact same checks.
on:
  workflow_call:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  lint:
    name: Lint, format & docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
        with:
          prefix-key: lint
      - name: Check formatting
        run: cargo fmt --all --check
      - name: Clippy
        run: cargo clippy --workspace --all-targets --all-features -- -D warnings
      - name: Build docs
        env:
          RUSTDOCFLAGS: -D warnings
        run: cargo doc --no-deps --all-features
      - name: Doctests
        run: cargo test --doc --all-features

  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v6
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
        with:
          prefix-key: test
      # The pyo3/napi cdylib crates are extension modules that cannot be linked
      # as cargo test binaries; they are built via maturin/napi in the `bindings`
      # job below. Everything else is tested across all three OSes.
      - name: Run tests
        run: cargo test --workspace --all-features --exclude code2graph-py --exclude code2graph-node

  bindings:
    name: Build bindings
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
        with:
          prefix-key: bindings
      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.12"
      - name: Build Python wheel (maturin)
        run: |
          pip install maturin
          maturin build --release -m bindings/python/Cargo.toml
      - name: Set up Node
        uses: actions/setup-node@v5
        with:
          node-version: "22"
      - name: Build Node addon (napi)
        working-directory: bindings/node
        run: |
          npm ci
          npx napi build --release --platform