From 1a5b1f1dce6a18206dbeb3944dd953c7a3fe34fd Mon Sep 17 00:00:00 2001 From: Nathaniel Brough Date: Mon, 23 Sep 2024 10:32:19 +1000 Subject: [PATCH] Add basic build checks for fuzz tests Co-authored-by: Spencer Wilson Signed-off-by: Nathaniel Brough --- .github/workflows/basic.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 49063219d..69061e21d 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -85,3 +85,37 @@ jobs: - name: Build documentation run: ninja gen_docs working-directory: build + + + fuzzbuildcheck: + name: Check that code passes a basic fuzzing build + needs: [ workflowcheck, stylecheck, upstreamcheck ] + runs-on: ubuntu-latest + container: openquantumsafe/ci-ubuntu-latest:latest + env: + SIG_NAME: dilithium_2 + CC: clang + CXX: clang++ + CFLAGS: -fsanitize=fuzzer-no-link,address + LDFLAGS: -fsanitize=address + steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 + - name: Configure + run: | + mkdir build && \ + cd build && \ + cmake -GNinja -DOQS_STRICT_WARNINGS=ON \ + -DOQS_BUILD_FUZZ_TESTS=ON \ + -DOQS_MINIMAL_BUILD="SIG_$SIG_NAME" \ + --warn-uninitialized .. > config.log 2>&1 && \ + cat config.log && \ + cmake -LA -N .. && \ + ! (grep -i "uninitialized variable" config.log) + - name: Build code + run: ninja + working-directory: build + + - name: Short fuzz check (30s) + run: ./tests/fuzz_test_dilithium2 -max_total_time=30 + working-directory: build