sat-solvers 0.1.1

Unified interface to multiple SAT solvers (CaDiCaL, MiniSat, Glucose, Lingeling, Kissat) with automatic source compilation
Documentation
name: CI

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

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      
      - name: Install build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y build-essential cmake
      
      - name: Run cargo check (default features)
        run: cargo check

  test:
    name: Test Suite
    runs-on: ubuntu-latest
    strategy:
      matrix:
        features:
          - "cadical"
          - "minisat"
          - "glucose"
          - "lingeling"
          - "kissat"
          - "cadical,minisat"
          - "cadical,minisat,glucose,lingeling,kissat"
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      
      - name: Install build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y build-essential cmake
      
      - name: Sanitize feature name for cache key
        id: cache-key
        run: echo "features=$(echo '${{ matrix.features }}' | tr ',' '_')" >> $GITHUB_OUTPUT

      - name: Cache solver builds
        uses: actions/cache@v4
        with:
          path: |
            target/debug/build
          key: ${{ runner.os }}-solver-${{ steps.cache-key.outputs.features }}-${{ hashFiles('lib/**') }}
          restore-keys: |
            ${{ runner.os }}-solver-${{ steps.cache-key.outputs.features }}-
            ${{ runner.os }}-solver-
      
      - name: Run tests
        run: cargo test --no-default-features --features "${{ matrix.features }}"

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      
      - name: Install build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y build-essential cmake
      
      - name: Run clippy
        run: cargo clippy --all-features -- -D warnings

  fmt:
    name: Rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      
      - name: Check formatting
        run: cargo fmt --all -- --check

  docs:
    name: Documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      
      - name: Install build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y build-essential cmake
      
      - name: Build documentation
        run: cargo doc --all-features --no-deps
        env:
          RUSTDOCFLAGS: -D warnings

  # Cross-platform build test
  build-ubuntu:
    name: Build (Ubuntu)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      
      - name: Install build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y build-essential cmake
      
      - name: Build with all features
        run: cargo build --release --all-features

  build-macos:
    name: Build (macOS)
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      
      - name: Install build dependencies
        run: brew install cmake
      
      # Note: MiniSat has compatibility issues with macOS clang/libc++
      # We test the other solvers which work correctly
      - name: Build (cadical + kissat + glucose + lingeling)
        run: cargo build --release --no-default-features --features "cadical,kissat,glucose,lingeling"