From 538ec2514e4002c1b53ebf54c6b2cba400024871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Tremblay?= <1619947+marctrem@users.noreply.github.com> Date: Thu, 14 Dec 2023 21:36:50 +0000 Subject: [PATCH] fuzz: add rust fuzz targets to highend fuzz artifact --- .github/workflows/_publish_to_clusterfuzz.yml | 6 ++++++ .../scripts/build_rust_fuzz_highend.sh | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 .github/workflows/scripts/build_rust_fuzz_highend.sh diff --git a/.github/workflows/_publish_to_clusterfuzz.yml b/.github/workflows/_publish_to_clusterfuzz.yml index 74035ca953..2755bded52 100644 --- a/.github/workflows/_publish_to_clusterfuzz.yml +++ b/.github/workflows/_publish_to_clusterfuzz.yml @@ -26,6 +26,12 @@ jobs: with: command: make -j -Otarget fuzz-test + - uses: firedancer-io/fuzzbot-builder@main + name: Build rust fuzz tests + with: + command: ./.github/workflows/scripts/build_rust_fuzz_highend.sh + if: ${{ matrix.feature_set == 'highend' }} + - name: List Artifacts run: | ls build/linux/clang/combi/${{ matrix.feature_set }}/fuzz-test diff --git a/.github/workflows/scripts/build_rust_fuzz_highend.sh b/.github/workflows/scripts/build_rust_fuzz_highend.sh new file mode 100755 index 0000000000..307516103b --- /dev/null +++ b/.github/workflows/scripts/build_rust_fuzz_highend.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -eux + +if [[ -d ffi/rust/firedancer-diff/fuzz ]]; then + # mix the fuzz targets with the highend fuzz + TARGET_DIR=./build/linux/clang/combi/highend/fuzz-test + RUST_FUZZ_OUT_DIR=./ffi/rust/firedancer-diff/fuzz/target/release + pushd ffi/rust/firedancer-diff/fuzz + cargo build --release + popd + + ARTIFACTS=$(find ./ffi/rust/firedancer-diff/fuzz/target/release -maxdepth 1 -executable -type f) + for ARTIFACT in $ARTIFACTS; do + mkdir -p "${TARGET_DIR}/$(basename $ARTIFACT)" + cp $ARTIFACT "${TARGET_DIR}/$(basename $ARTIFACT)/" + done +else + echo "ignoring rust fuzz since directory does not exist" +fi