emdb 0.8.0

A lightweight, high-performance embedded database for Rust.
Documentation
name: CI

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

jobs:
  build-test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        features:
          - ""
          - "ttl"
          - "nested"
          - "encrypt"
          - "ttl nested"
          - "ttl nested encrypt"

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Build
        run: cargo build --no-default-features --features "${{ matrix.features }}" --verbose

      - name: Test (unit + integration + doc)
        run: cargo test --no-default-features --features "${{ matrix.features }}" --verbose

  msrv:
    name: MSRV (1.75)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install MSRV toolchain
        uses: dtolnay/rust-toolchain@1.75.0
      # Some transitive dependencies in the encryption stack (notably
      # `base64ct` via `argon2 -> password-hash`) have started shipping
      # with `edition = "2024"` in their newest patch releases, which
      # Rust 1.75 does not understand. The dep tree still has older
      # versions that compile cleanly on 1.75; pin the offenders here
      # so the MSRV job exercises code that *we* control without
      # tripping over RustCrypto's MSRV churn. Add new lines to this
      # block whenever a future patch release tightens MSRV upstream.
      - name: Pin transitive deps to MSRV-compatible versions
        run: |
          cargo update -p base64ct --precise 1.6.0
      - name: Build with MSRV (default features)
        run: cargo build --verbose
      - name: Build with MSRV (all features)
        run: cargo build --features ttl,nested,encrypt --verbose

  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - name: Check formatting
        run: cargo fmt --all -- --check
      - name: Clippy
        run: cargo clippy --all-targets --features ttl,nested,encrypt -- -D warnings

  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      - name: Check documentation
        env:
          RUSTDOCFLAGS: -D warnings
        run: cargo doc --no-deps --features ttl,nested,encrypt

  audit:
    name: Security audit (cargo-audit)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install cargo-audit
        # 0.22+ is required to parse CVSS 4.0 entries in the RustSec
        # advisory database (e.g. RUSTSEC-2026-0073). 0.21 errors out
        # on those files with `unsupported CVSS version: 4.0` and
        # never gets to the actual scan.
        run: cargo install cargo-audit --locked --version "^0.22"
      # The two `--ignore` advisories are dev-only paths via the
      # bench-compare feature (sled -> fxhash, sled -> parking_lot
      # -> instant). Both are unmaintained-status notices, not
      # exploitable vulnerabilities, and neither has a
      # semver-compatible upgrade. The same two advisories are
      # documented in `deny.toml` with the same justification.
      - name: Run audit
        run: cargo audit --deny warnings --ignore RUSTSEC-2025-0057 --ignore RUSTSEC-2024-0384

  deny:
    name: Dependency policy (cargo-deny)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: EmbarkStudios/cargo-deny-action@v2
        with:
          command: check