# Nightly fuzzing (cargo-fuzz, libFuzzer) of the code that reads what # reaches the app from outside: what people paste and type, uploaded # images and PDFs, the drawn signature (src/fuzzing.rs, fuzz/). Only on # runner02 on cnx01 (label cnx01, cnx-network-clan docs/src/ci-runner.md), # at 03:00 in Chiang Mai and at the lowest CPU priority, so the services # there keep first call. The corpus each run grows is kept in the cache # for the next. A crash fails the job and leaves its input as the artifact # fuzz-findings; it goes into tests/fuzz_cases// with the fix, # which every push then replays. Never releases anything. name: Fuzz on: schedule: - cron: "0 20 * * *" workflow_dispatch: inputs: seconds: description: Seconds per target default: "600" concurrency: group: fuzz cancel-in-progress: false env: CARGO_TERM_COLOR: always CARGO_INCREMENTAL: "0" jobs: fuzz: name: fuzz runs-on: cnx01 timeout-minutes: 120 env: FUZZ_SECONDS: ${{ inputs.seconds || '600' }} steps: - uses: actions/checkout@v4 - name: Nightly Rust and cargo-fuzz run: bash .gitea/scripts/fuzz.sh setup - uses: actions/cache@v4 with: path: | ~/.cargo/bin/cargo-fuzz ~/.cargo/registry/index ~/.cargo/registry/cache fuzz/target fuzz/corpus # a new key each run, so the grown corpus is saved every night key: fuzz-${{ github.run_id }} restore-keys: fuzz- - name: Fuzz run: bash .gitea/scripts/fuzz.sh run - name: Keep the findings if: failure() uses: https://github.com/christopherHX/gitea-upload-artifact@v4 with: name: fuzz-findings path: fuzz/artifacts/ retention-days: 30