From 4c574be714fc465c2b7683008f4dfa642438586b Mon Sep 17 00:00:00 2001 From: Flouse Date: Thu, 30 Sep 2021 11:58:56 +0800 Subject: [PATCH] fuzz: Set diff MAX_FUZZ_TIME for diff branches --- .github/workflows/fuzz.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 3abed588..cf876aa5 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -55,6 +55,16 @@ jobs: working-directory: ./polyjuice-tests/fuzz run: make build/test_contracts && ./build/test_contracts + - name: Set MAX_FUZZ_TIME for different branches + run: | + if [[ ${{ github.event_name == 'pull_request' }} ]]; then + echo "MAX_FUZZ_TIME=6" >> $GITHUB_ENV + elif [[ ${{ startsWith(github.base_ref, 'fuzz') }} ]]; then + echo "MAX_FUZZ_TIME=3600" >> $GITHUB_ENV + else + echo "MAX_FUZZ_TIME=60" >> $GITHUB_ENV + fi + - name: Fuzzing Polyjuice Generator 1 hour working-directory: polyjuice-tests/fuzz run: | @@ -62,7 +72,7 @@ jobs: ls corpus-cache make build/polyjuice_generator_fuzzer && \ ./build/polyjuice_generator_fuzzer corpus corpus-cache \ - -max_total_time=3600 -timeout=120 \ + -max_total_time=$MAX_FUZZ_TIME -timeout=120 \ -max_len=25000 -rss_limit_mb=0 # Max data buffer size: 24KB < 25000 bytes