clock-hash 1.0.0

ClockHash-256: Consensus hash function for ClockinChain
Documentation
name: Scheduled Fuzzing

on:
  schedule:
    # Run weekly on Sundays at 2 AM UTC
    - cron: '0 2 * * 0'
  workflow_dispatch: # Allow manual triggering

env:
  CARGO_TERM_COLOR: always

jobs:
  scheduled-fuzz:
    name: Scheduled Fuzzing
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Install Rust toolchain
      uses: dtolnay/rust-toolchain@nightly

    - name: Cache dependencies
      uses: Swatinem/rust-cache@v2

    - name: Install cargo-fuzz
      run: cargo install cargo-fuzz

    - name: Build fuzz targets
      run: |
        cd fuzz
        cargo fuzz build

    - name: Run extended fuzz tests
      run: |
        cd fuzz
        # Run for 30 minutes with comprehensive coverage
        timeout 1800 cargo fuzz run clockhash256_fuzz -- -max_total_time=1740 -dict=fuzz.dict
      continue-on-error: true

    - name: Generate coverage report
      run: |
        cd fuzz
        # Generate coverage data if possible
        if command -v grcov &> /dev/null; then
          cargo fuzz run clockhash256_fuzz -- -max_total_time=60 -coverage
        fi
      continue-on-error: true

    - name: Archive fuzz artifacts
      uses: actions/upload-artifact@v4
      if: always()
      with:
        name: fuzz-artifacts-${{ github.run_number }}
        path: |
          fuzz/corpus/
          fuzz/crashes/
        retention-days: 30