svccat 1.1.2

Detect drift between your declared service catalog and what actually lives in the repo.
Documentation
name: Continuous Fuzzing

on:
  schedule:
    - cron: '0 2 * * *'  # Daily at 2 AM UTC
  workflow_dispatch:  # Allow manual triggers

jobs:
  fuzz:
    runs-on: ubuntu-latest
    timeout-minutes: 120
    strategy:
      matrix:
        target: [fuzz_manifest, fuzz_url, fuzz_glob]
    steps:
      - uses: actions/checkout@v4.1.7

      - uses: dtolnay/rust-toolchain@nightly

      - uses: Swatinem/rust-cache@v2.7.3

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

      - name: Run fuzzer (${{ matrix.target }})
        run: cargo fuzz run ${{ matrix.target }} -- -max_total_time=600 -timeout=5 -rss_limit_mb=512
        continue-on-error: true

      - name: Check for crashes
        if: always()
        run: |
          target_name="${{ matrix.target }}"
          if [ -d "fuzz/artifacts/$target_name" ]; then
            crash_count=$(find fuzz/artifacts/$target_name -name "crash-*" | wc -l)
            if [ $crash_count -gt 0 ]; then
              echo "❌ Found $crash_count crash(es) in $target_name"
              exit 1
            fi
          fi

      - name: Upload artifacts on crash
        if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: fuzz-artifacts-${{ matrix.target }}
          path: fuzz/artifacts/${{ matrix.target }}/
          retention-days: 30

  report:
    runs-on: ubuntu-latest
    needs: fuzz
    if: always()
    steps:
      - uses: actions/checkout@v4.1.7

      - name: Fuzzing Summary
        run: |
          echo "## Fuzzing Summary" >> $GITHUB_STEP_SUMMARY
          echo "" >> $GITHUB_STEP_SUMMARY
          echo "Fuzz targets executed:" >> $GITHUB_STEP_SUMMARY
          echo "- fuzz_manifest: Manifest YAML parsing" >> $GITHUB_STEP_SUMMARY
          echo "- fuzz_url: URL validation" >> $GITHUB_STEP_SUMMARY
          echo "- fuzz_glob: Glob pattern processing" >> $GITHUB_STEP_SUMMARY
          echo "" >> $GITHUB_STEP_SUMMARY
          if [ "${{ needs.fuzz.result }}" == "success" ]; then
            echo "✅ All fuzz targets completed without crashes" >> $GITHUB_STEP_SUMMARY
          else
            echo "⚠️ Fuzzing found potential issues - check artifacts" >> $GITHUB_STEP_SUMMARY
          fi