chess-vector-engine 0.5.1

Open source chess engine with hybrid vector-based position analysis, advanced tactical search, and NNUE neural network evaluation
Documentation
name: ๐Ÿงช Continuous Integration

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

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  test:
    name: ๐Ÿงช Test Suite
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        rust: [stable]
        include:
          # Only test beta on Ubuntu to catch clippy issues early
          - os: ubuntu-latest
            rust: beta

    steps:
    - name: ๐Ÿ“ฅ Checkout code
      uses: actions/checkout@v4

    - name: ๐Ÿฆ€ Setup Rust
      uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.rust }}
        components: rustfmt, clippy

    - name: ๐Ÿ“ฆ Cache dependencies
      uses: actions/cache@v4
      with:
        path: |
          ~/.cargo/bin/
          ~/.cargo/registry/index/
          ~/.cargo/registry/cache/
          ~/.cargo/git/db/
          target/
        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
        restore-keys: |
          ${{ runner.os }}-cargo-

    - name: ๐Ÿ” Check formatting
      run: cargo fmt --all -- --check

    - name: ๐Ÿ“Ž Run Clippy
      shell: bash
      run: |
        if [[ "${{ matrix.rust }}" == "beta" ]]; then
          # More lenient on beta - only fail on errors, not warnings
          cargo clippy --all-targets --all-features
        else
          # Strict on stable
          cargo clippy --all-targets --all-features -- -D warnings
        fi

    - name: ๐Ÿ—๏ธ Build
      run: cargo build --verbose --all-features

    - name: ๐Ÿงช Run tests
      run: cargo test --verbose --all-features

    - name: ๐Ÿ“Š Run benchmarks (smoke test)
      run: cargo run --bin benchmark --release -- --quick

  coverage:
    name: ๐Ÿ“Š Test Coverage
    runs-on: ubuntu-latest
    steps:
    - name: ๐Ÿ“ฅ Checkout code
      uses: actions/checkout@v4

    - name: ๐Ÿฆ€ Setup Rust
      uses: dtolnay/rust-toolchain@stable
      with:
        components: llvm-tools-preview

    - name: ๐Ÿ“ฆ Install cargo-llvm-cov
      uses: taiki-e/install-action@cargo-llvm-cov

    - name: ๐Ÿ“Š Generate coverage
      run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info

    - name: ๐Ÿ“ค Upload coverage to Codecov
      uses: codecov/codecov-action@v4
      with:
        files: lcov.info
        token: ${{ secrets.CODECOV_TOKEN }}
        fail_ci_if_error: false

  security:
    name: ๐Ÿ”’ Security Audit
    runs-on: ubuntu-latest
    steps:
    - name: ๐Ÿ“ฅ Checkout code
      uses: actions/checkout@v4

    - name: ๐Ÿฆ€ Setup Rust
      uses: dtolnay/rust-toolchain@stable

    - name: ๐Ÿ“ฆ Install cargo-audit
      run: cargo install cargo-audit

    - name: ๐Ÿ” Run security audit
      run: cargo audit

  docs:
    name: ๐Ÿ“š Documentation
    runs-on: ubuntu-latest
    steps:
    - name: ๐Ÿ“ฅ Checkout code
      uses: actions/checkout@v4

    - name: ๐Ÿฆ€ Setup Rust
      uses: dtolnay/rust-toolchain@stable

    - name: ๐Ÿ“š Build documentation
      run: cargo doc --all-features --no-deps

    - name: ๐Ÿ“ค Deploy docs to GitHub Pages
      if: github.ref == 'refs/heads/main'
      uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: ./target/doc
        cname: docs.chessvector.ai

  feature-validation:
    name: ๐ŸŽฏ Feature Validation
    runs-on: ubuntu-latest
    steps:
    - name: ๐Ÿ“ฅ Checkout code
      uses: actions/checkout@v4

    - name: ๐Ÿฆ€ Setup Rust
      uses: dtolnay/rust-toolchain@stable

    - name: ๐Ÿ“ฆ Cache dependencies
      uses: actions/cache@v4
      with:
        path: |
          ~/.cargo/bin/
          ~/.cargo/registry/index/
          ~/.cargo/registry/cache/
          ~/.cargo/git/db/
          target/
        key: ubuntu-cargo-${{ hashFiles('**/Cargo.lock') }}

    - name: ๐ŸŽฏ Test open source features
      run: cargo test --no-default-features

    - name: ๐Ÿ” Test feature gating
      run: cargo run --bin feature_demo

    - name: ๐ŸŽฎ Test UCI engine
      run: |
        timeout 10s cargo run --bin uci_engine < /dev/null || true
        echo "uci" | timeout 5s cargo run --bin uci_engine

    - name: ๐Ÿ“Š Test analysis tool
      run: cargo run --bin analyze "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"

  performance:
    name: โšก Performance Testing
    runs-on: ubuntu-latest
    steps:
    - name: ๐Ÿ“ฅ Checkout code
      uses: actions/checkout@v4

    - name: ๐Ÿฆ€ Setup Rust
      uses: dtolnay/rust-toolchain@stable

    - name: ๐Ÿ“Š Run comprehensive benchmarks
      run: cargo run --bin benchmark --release

    - name: ๐Ÿ“ˆ Performance regression check
      run: |
        # Run benchmarks and check for major regressions
        cargo run --bin benchmark --release > benchmark_results.txt
        # Add logic to compare with baseline performance
        cat benchmark_results.txt

  minimum-versions:
    name: ๐Ÿ”ฝ Minimum Supported Rust Version
    runs-on: ubuntu-latest
    steps:
    - name: ๐Ÿ“ฅ Checkout code
      uses: actions/checkout@v4

    - name: ๐Ÿฆ€ Setup Rust 1.81.0 (MSRV)
      uses: dtolnay/rust-toolchain@1.81.0

    - name: ๐Ÿ—๏ธ Build with MSRV
      run: cargo build --verbose

    - name: ๐Ÿงช Test with MSRV
      run: cargo test --verbose