From 2ead2c398ed932fe6caa0bd13e49dbeb6027f7ba Mon Sep 17 00:00:00 2001 From: syheliel <45957390+syheliel@users.noreply.github.com> Date: Mon, 16 May 2022 03:25:29 +0800 Subject: [PATCH] Speed up CI (#630) * Add ccache * Update codecov.yml * Update build_and_test.yml * Update build_and_test.yml * Update test_all_fuzzers.sh Add fuzzer timer * Fix `./test_all_fuzzers.sh` on macos * Fix CI * Fix CI * Update build_and_test.yml * Fix typo * Set mold linker as default linker * Fix CI * Update build_and_test.yml * Add profile arguments * Fix CI * Update test_all_fuzzers.sh Co-authored-by: syheliel --- .github/workflows/build_and_test.yml | 5 +++++ scripts/test_all_fuzzers.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 30af84c296..da5a7cd60d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -48,6 +48,8 @@ jobs: profile: minimal toolchain: stable - uses: Swatinem/rust-cache@v1 + - name: set mold linker as default linker + uses: rui314/setup-mold@v1 - name: Install deps run: sudo apt-get install -y llvm llvm-dev clang ninja-build - name: get clang version @@ -107,6 +109,9 @@ jobs: with: profile: minimal toolchain: stable + - name: set mold linker as default linker + if: runner.os == 'Linux' # mold only support linux until now + uses: rui314/setup-mold@v1 - name: add ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/scripts/test_all_fuzzers.sh b/scripts/test_all_fuzzers.sh index 8475964d6c..4c7fa2c0a3 100755 --- a/scripts/test_all_fuzzers.sh +++ b/scripts/test_all_fuzzers.sh @@ -12,8 +12,20 @@ libafl=$(pwd) git submodule init && git submodule update +# override default profile settings for speed +# export RUSTFLAGS="-C prefer-dynamic" +for profile in DEV RELEASE; # loop for all profiles +do + export CARGO_PROFILE_"$profile"_OPT_LEVEL=z # optimize for size + export CARGO_PROFILE_"$profile"_SPLIT_DEBUGINFO=unpacked # minimize debug info + # export CARGO_PROFILE_"$profile"_PANIC=abort + export CARGO_PROFILE_"$profile"_INCREMENTAL=true +done + # record time of each fuzzer declare -A time_record || (echo "declare -A not avaliable, please update your bash version to 4";exit 1) + + for fuzzer in $(echo $fuzzers $backtrace_fuzzers); do cd $fuzzer