From c8613a24175c59282fd1e735b72cd68777e28f4d Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 29 May 2023 12:48:35 +0200 Subject: [PATCH] Add fuzz test to CI --- .github/workflows/rust.yml | 17 ++++++++++++----- Makefile | 7 +++++++ fuzz/Makefile | 15 ++++++++++++--- 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d89106e13..860b27143 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,13 +11,20 @@ env: jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - - name: Setup - run: sudo apt install llvm libclang-dev + - name: Setup Ubuntu + run: make setup-ubuntu - name: Run tests - run: cargo test --verbose + run: make ci + fuzz: + runs-on: ubuntu-latest + steps: + - name: Setup fuzz + run: make -C fuzz setup-ubuntu + - name: Setup fuzz 2 + run: make -C fuzz setup + - name: Run tests + run: make -C fuzz ci diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..b6b5cc0c8 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: ci setup-ubuntu + +ci: + cargo test --verbose + +setup-ubuntu: + sudo apt install llvm libclang-dev make \ No newline at end of file diff --git a/fuzz/Makefile b/fuzz/Makefile index ae8c685e6..a586b6375 100644 --- a/fuzz/Makefile +++ b/fuzz/Makefile @@ -33,13 +33,22 @@ fuzz-cov-show: > fuzz_coverage.html .PHONY: ci -ci: check +ci: + $(MAKE) fuzz FUZZ_DURATION=10 FUZZ_JOBS=1 .PHONY: setup setup: rustup component add clippy rustfmt && rustup toolchain install nightly rustup component add llvm-tools-preview - cargo install cargo-tarpaulin cargo-fuzz --profile release - python3 -m pip install reuse + cargo install cargo-fuzz --profile release + #cargo install cargo-tarpaulin --profile release # for coverage + # python3 -m pip install reuse # Fedora 37 # sudo ln -s libclang.so.15 libclang.so + +.PHONY: setup-ubuntu +setup-ubuntu: + sudo apt install llvm libclang-dev make curl clang pkg-config libssl-dev python3-pip git + # rust + # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + # source "$HOME/.cargo/env"