kiddo 5.3.2

A high-performance, flexible, ergonomic k-d tree library. Ideal for geo- and astro- nearest-neighbour and k-nearest-neighbor queries
Documentation
name: CI / Common

on:
  push:
    branches:
      - master
      - v5.x.x
  pull_request:
    branches:
      - "**"
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

env:
  LATEST_STABLE_RUST_VERSION: "TBD"

jobs:
  commitlint:
    name: Commit Lint
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
    steps:
      - uses: actions/checkout@v6
      - uses: wagoid/commitlint-github-action@v6
        with:
          configFile: .commitlintrc.yaml

  formatting:
    name: Formatting
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6
        with:
          show-progress: false

      - name: Get latest stable Rust version
        run: |
          echo "LATEST_STABLE_RUST_VERSION=$(gh api /repos/rust-lang/rust/releases --jq ".[0].tag_name")" >> "$GITHUB_ENV"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Cache Toolchain
        uses: actions/cache@v5
        with:
          path: ~/.rustup
          key: toolchain-x86-64-${{ env.LATEST_STABLE_RUST_VERSION }}

      - name: Install `stable` Toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          components: rustfmt,clippy

      - name: Install cargo-sort
        uses: baptiste0928/cargo-install@v3
        with:
          crate: cargo-sort
          version: "^2"

      - name: Install taplo
        uses: taiki-e/install-action@v2
        with:
          tool: taplo-cli

      - name: Setup Node.js
        uses: actions/setup-node@v6
        with:
          node-version: 24

      - name: Cargo fmt check
        run: cargo fmt --all --check

      - name: Cargo sort check
        run: cargo sort -cwg

      - name: Toml format check
        run: taplo format --check ./*.toml

      - name: Yaml / Md check
        run: npx --yes prettier --check ".github/workflows/*.{yml,yaml}" "*.yml" "*.yaml" ".*.yml" ".*.yaml" "**/*.md"

      - name: Check Rustdoc Links
        run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items

  github-actions-lint:
    name: Lint GitHub Actions
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          show-progress: false

      - name: Lint GitHub Actions workflows
        uses: docker://rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667