@@ -607,3 +607,57 @@ jobs:
607607 CIRRUS_PR_FLAG="-e CIRRUS_PR=1"
608608 fi
609609 docker run --rm $CIRRUS_PR_FLAG -v "$(pwd)":/bitcoin "$CONTAINER_NAME"
610+
611+ fuzz-centipede :
612+ name : ' Centipede fuzzer'
613+ needs : runners
614+ runs-on : ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg' || 'ubuntu-24.04' }}
615+ timeout-minutes : 60
616+ env :
617+ FILE_ENV : ' ./ci/test/00_setup_env_native_fuzz.sh'
618+ DANGER_CI_ON_HOST_FOLDERS : 1
619+ steps :
620+ - *CHECKOUT
621+ - name : Configure environment
622+ uses : ./.github/actions/configure-environment
623+ - name : Restore caches
624+ uses : ./.github/actions/restore-caches
625+ - name : Configure Docker
626+ uses : ./.github/actions/configure-docker
627+ with :
628+ cache-provider : ${{ needs.runners.outputs.provider }}
629+ - name : Install Centipede deps
630+ run : |
631+ sudo apt-get update
632+ sudo apt-get install -y curl gnupg
633+ curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > /usr/share/keyrings/bazel.gpg
634+ echo "deb [signed-by=/usr/share/keyrings/bazel.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
635+ sudo apt-get update
636+ sudo apt-get install -y bazel clang-18 libc++-18-dev libc++abi-18-dev
637+ - name : Build libFuzzer targets
638+ run : |
639+ cmake --preset=libfuzzer -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18
640+ cmake --build build_fuzz --parallel
641+ - name : Clone & build Centipede
642+ run : |
643+ git clone https://github.com/google/fuzztest.git "$RUNNER_TEMP/fuzztest"
644+ cd "$RUNNER_TEMP/fuzztest"
645+ bazel build //centipede:centipede
646+ - name : Download corpus
647+ run : |
648+ git clone --depth=1 https://github.com/bitcoin-core/qa-assets "$RUNNER_TEMP/qa-assets"
649+ - name : Run Centipede
650+ run : |
651+ "$RUNNER_TEMP/fuzztest/bazel-bin/centipede/centipede" \
652+ -artifact_prefix=artifacts/ \
653+ -corpus_dir="$RUNNER_TEMP/qa-assets/fuzz_corpora" \
654+ build_fuzz/bin/fuzz_* \
655+ -jobs=8 -max_total_time=1800
656+ - name : Upload artifacts
657+ if : always()
658+ uses : actions/upload-artifact@v4
659+ with :
660+ name : centipede-artifacts
661+ path : artifacts/
662+ - name : Save caches
663+ uses : ./.github/actions/save-caches
0 commit comments