Skip to content

Commit

Permalink
workflows: add Ccache for Fuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon committed Jul 8, 2024
1 parent be388a6 commit 21539a3
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -717,23 +717,40 @@ jobs:
container:
image: gcr.io/oss-fuzz-base/base-builder
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install prerequisites
run: |
apt-get update && apt-get install -y cmake autoconf flex bison
apt-get update && apt-get install -y autoconf bison ccache cmake flex
cd ..
cp -r PcapPlusPlus/ $SRC/PcapPlusPlus
git clone --depth=1 https://github.com/the-tcpdump-group/libpcap.git $SRC/libpcap
cd $SRC/PcapPlusPlus/
- name: Compile fuzzer
- name: Restore Ccache
id: ccache-restore
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ matrix.sanitizer }}-${{ matrix.engine }}-ccache

- name: Compile PcapPlusPlus Fuzzer application
run: |
export FUZZING_LANGUAGE=c
export ARCHITECTURE=x86_64
export FUZZING_ENGINE=${{ matrix.engine }}
export SANITIZER=${{ matrix.sanitizer }}
$SRC/PcapPlusPlus/Tests/Fuzzers/ossfuzz.sh
- name: Check for regressions
run: |
export BINARY="$OUT/FuzzTarget"
export SAMPLES="Tests/Fuzzers/RegressionTests/regression_samples"
Tests/Fuzzers/RegressionTests/run_tests.sh
- name: Save Ccache
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}

0 comments on commit 21539a3

Please sign in to comment.