Skip to content

Commit

Permalink
Add fuzz test to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
szszszsz committed May 29, 2023
1 parent 1ca7336 commit c8613a2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: ci setup-ubuntu

ci:
cargo test --verbose

setup-ubuntu:
sudo apt install llvm libclang-dev make
15 changes: 12 additions & 3 deletions fuzz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit c8613a2

Please sign in to comment.