hessboost 0.1.0

A faithful, fast, pure-Rust reimplementation of XGBoost gradient boosting
Documentation
name: CI

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

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

permissions:
  contents: read

env:
  CARGO_INCREMENTAL: 0
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"

# Toolchain and tool versions (rust, mbx, uv) come from mise.toml. mise-action
# runs before mr-boxington-action so the cache key sees the pinned rustc, and
# the cache action reuses the mbx that mise put on PATH. mise's own cache is
# off: it would restore the rust install symlink without rustup's toolchain.

jobs:
  fmt:
    name: rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - uses: jdx/mise-action@v4
        with:
          cache: false
      - run: cargo fmt --all --check

  clippy:
    name: clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - uses: jdx/mise-action@v4
        with:
          cache: false
      - uses: jdx/mr-boxington-action@v1
        with:
          cache-generation: clippy
      # Lint levels (pedantic) live in Cargo.toml's [lints] table.
      - run: mbx clippy --all-targets --all-features -- -D warnings

  test:
    name: test (${{ matrix.name }})
    runs-on: ${{ matrix.runner }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - { name: x86_64-linux, runner: ubuntu-26.04 }
          - { name: aarch64-linux, runner: ubuntu-26.04-arm }
          - { name: aarch64-darwin, runner: macos-latest }
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - uses: jdx/mise-action@v4
        with:
          cache: false
      - uses: jdx/mr-boxington-action@v1
        with:
          cache-generation: test
      - run: mbx test --all-features

  docs:
    name: docs
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: "-D warnings"
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - uses: jdx/mise-action@v4
        with:
          cache: false
      - uses: jdx/mr-boxington-action@v1
        with:
          cache-generation: docs
      - run: mbx doc --no-deps --all-features

  msrv:
    name: MSRV (1.93.0)
    runs-on: ubuntu-latest
    env:
      # Overrides the rust version from mise.toml for every mise step.
      MISE_RUST_VERSION: 1.93.0
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - uses: jdx/mise-action@v4
        with:
          cache: false
      - uses: jdx/mr-boxington-action@v1
        with:
          cache-generation: msrv
      - run: mbx build --all-features

  parity:
    name: XGBoost parity
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - uses: jdx/mise-action@v4
        with:
          cache: false
      - uses: jdx/mr-boxington-action@v1
        with:
          cache-generation: parity
      - name: Generate fixtures from XGBoost 3.4.1
        run: uv run --with xgboost==3.4.1 --with numpy python scripts/gen_fixtures.py
      - name: Train, import and cut parity
        run: mbx test --test parity --release -- --ignored --nocapture
      - name: Export parity (reload in XGBoost)
        run: uv run --with xgboost==3.4.1 --with numpy python scripts/check_exports.py

  all-checks-passed:
    permissions: {}
    needs: [fmt, clippy, test, docs, msrv, parity]
    runs-on: ubuntu-latest
    timeout-minutes: 1
    # Run on upstream failure too (so branch protection sees a failure), but
    # not on cancellation.
    if: ${{ !cancelled() }}
    steps:
      - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
        run: exit 1
      - run: echo "All checks passed"