yahtzee-engine 0.1.0

Yahtzee rules, scoring, and bots: a fast heuristic and an exact optimal expected-value solver
Documentation
name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  fmt:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v7
    - name: Check formatting
      run: cargo fmt --check

  clippy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v7
    - name: Clippy
      run: cargo clippy --all-targets --all-features -- -D warnings

  doc:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v7
    - name: Build docs
      env:
        RUSTDOCFLAGS: -D warnings
      run: cargo doc --no-deps --all-features

  # Guards against under-declared dependency floors: pins every direct
  # dependency to its lowest allowed version and checks the build still
  # compiles. Catches the "uses a newer API than the `= "1"` bound admits"
  # class of bug. Nightly-only (the `-Z` flag).
  minimal-versions:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v7
    - name: Install nightly
      run: rustup toolchain install nightly --profile minimal && rustup default nightly
    - name: Pin direct deps to their minimal versions
      run: cargo update -Z direct-minimal-versions
    - name: Check (all features, all targets)
      run: cargo check --all-features --all-targets

  test:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        rust: [stable, "1.93"]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v7
    - name: Install Rust ${{ matrix.rust }}
      run: rustup toolchain install ${{ matrix.rust }} --profile minimal && rustup default ${{ matrix.rust }}
    - name: Test (all features)
      run: cargo test --all-features --verbose
    # --all-features turns on `parallel`, so this leg is what still
    # exercises the serial solver path.
    - name: Test (default features)
      run: cargo test --verbose