bbtree 0.1.2

Blessed B-tree.
Documentation
# Named for its README badge.
name: miri

# Tests under Miri, which reports undefined behavior in the unsafe code.
# Only the tests .config/nextest.toml names run, so that this runs on every
# change in minutes; normal test runs run them all.
on:
  push:
    branches: [main]
  pull_request:
  workflow_dispatch:

# Cancel a pull request's superseded runs. Every commit on main finishes its
# run, so the README badge reports it.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  miri:
    name: miri (tree borrows, strict provenance)
    runs-on: ubuntu-latest
    # The most a job may run on GitHub's runners.
    timeout-minutes: 360
    # Tree borrows rather than Miri's default, stacked borrows; and strict
    # provenance: no integer becomes a pointer.
    env:
      MIRIFLAGS: -Zmiri-tree-borrows -Zmiri-strict-provenance
    steps:
      - uses: actions/checkout@v4

      # Keep this exact nightly aligned with flake.nix.
      - name: Install Rust (nightly-2026-10-07)
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: nightly-2026-10-07
          components: miri, rust-src

      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: Swatinem/rust-cache@v2

      # A name that matches no test, say after a rename, would drop that
      # test from Miri without a word.
      - name: Check that every named test exists
        run: |
          named=$(grep -c 'test(=' .config/nextest.toml)
          found=$(cargo miri nextest list --message-format oneline | wc -l)
          if [ "$named" -ne "$found" ]; then
            echo "::error::.config/nextest.toml names $named tests; $found exist"
            exit 1
          fi

      # Miri interprets on one core. Nextest runs each test in a process of
      # its own, so as many tests run at once as the runner has cores.
      - name: Miri
        run: cargo miri nextest run --test-threads "$(nproc)"