Create matrix for fuzzing (#457)
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
diff --git a/.github/workflows/fuzzing.yml b/.github/workflows/fuzzing.yml
index 2008c54..a4a5718 100644
--- a/.github/workflows/fuzzing.yml
+++ b/.github/workflows/fuzzing.yml
@@ -11,14 +11,16 @@
- cron: '00 21 * * *'
workflow_dispatch: # Run manually
-
jobs:
build:
- env:
- platform: ubuntu-latest
- arch: x86_64
+ strategy:
+ matrix:
+ platform:
+ - ubuntu-latest
+ arch:
+ - x86_64
- runs-on: ${{ env.platform }}
+ runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
@@ -27,7 +29,7 @@
- name: Generate the cache key
id: cache_key
- run: echo "VALUE=platform-${{ env.platform }}_arch=${{ env.arch }}_type=fuzzing" >> $GITHUB_OUTPUT
+ run: echo "VALUE=platform-${{ matrix.platform }}_arch=${{ matrix.arch }}_type=fuzzing" >> $GITHUB_OUTPUT
- name: Update the cache (ccache)
uses: actions/cache@v4.0.2
@@ -41,7 +43,7 @@
ccache
- name: Install system dependencies (Linux)
- if: env.platform == 'ubuntu-latest'
+ if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
@@ -55,12 +57,7 @@
libboost-filesystem-dev \
libelf-dev
- if [[ "${{ env.scan_build }}" == "true" ]] ; then
- sudo apt-get install -y \
- clang-tools
- fi
-
- if [[ "${{ env.arch }}" == "arm64" ]] ; then
+ if [[ "${{ matrix.arch }}" == "arm64" ]] ; then
sudo apt install -y \
g++-aarch64-linux-gnu \
gcc-aarch64-linux-gnu \
@@ -68,12 +65,12 @@
fi
- name: Build/install libbpf From Source
- if: env.platform == 'ubuntu-latest'
+ if: matrix.platform == 'ubuntu-latest'
run: ./.github/scripts/build-libbpf.sh
shell: bash
- name: Install system dependencies (macOS)
- if: env.platform == 'macos-11'
+ if: matrix.platform == 'macos-11'
run: |
brew install \
cmake \
@@ -90,7 +87,7 @@
-G Ninja \
-S . \
-B build \
- -DCMAKE_BUILD_TYPE=${{ env.build_type }} \
+ -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DUBPF_ENABLE_LIBFUZZER=1 \
@@ -101,10 +98,6 @@
run: |
export CCACHE_DIR="$(pwd)/ccache"
- if [[ "${{ env.scan_build }}" == "true" ]] ; then
- command_prefix="scan-build -o scan_build_report"
- fi
-
${command_prefix} cmake \
--build build