safegraph 0.1.0

A type-safe, scope-aware graph library that leverages Rust's type system to prevent common graph-related bugs at compile time
Documentation
name: CI

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

env:
  CARGO_TERM_COLOR: always

jobs:
  # Verify the core crate still builds on the declared MSRV (rust-version in
  # Cargo.toml). The default `matrix` backend (sprs/ndarray) and the dev-deps
  # require a newer rustc, so the MSRV covers `--no-default-features`: drop the
  # dev-deps and let a recent cargo pick MSRV-compatible dependency versions for
  # the old toolchain to build with `--locked`.
  msrv:
    name: MSRV check
    runs-on: ubuntu-latest
    env:
      CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@1.56.0
      - uses: dtolnay/rust-toolchain@stable
      - name: Check core crate on MSRV (1.56)
        run: |
          sed -i '/^\[dev-dependencies\]/,$d' Cargo.toml
          cargo +stable generate-lockfile
          cargo +1.56.0 check --no-default-features --locked

  test:
    name: Test
    runs-on: ubuntu-latest
    needs: msrv
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo test

  fmt:
    name: Rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all --check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - run: cargo clippy --all-targets -- -D warnings

  rustdoc:
    name: Rustdoc
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Build docs (warnings are errors)
        run: cargo doc --no-deps
        env:
          RUSTDOCFLAGS: -D warnings
      - name: Doc tests (warnings are errors)
        run: cargo test --doc
        env:
          RUSTDOCFLAGS: -D warnings