Add fuzz to CI (#690)

* Add fuzz to CI

* Change compiler to clang++

* Fix flag name

* Remove fuzzing from a requirement.

* Update to checkout v4
This commit is contained in:
Matthew Parkinson
2024-11-19 14:28:55 +00:00
committed by GitHub
parent 0b53b9301e
commit e343232611

View File

@@ -77,7 +77,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.variant }} name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.variant }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install build dependencies - name: Install build dependencies
run: "sudo apt install ninja-build" run: "sudo apt install ninja-build"
@@ -118,7 +118,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.extra-cmake-flags }} name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.extra-cmake-flags }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install build dependencies - name: Install build dependencies
# The homebrew packages are broken at the moment and error out # The homebrew packages are broken at the moment and error out
# after trying to install Python as a dependency of ninja because # after trying to install Python as a dependency of ninja because
@@ -167,7 +167,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
name: FreeBSD-${{ matrix.os.version}} ${{ matrix.build-type }} name: FreeBSD-${{ matrix.os.version}} ${{ matrix.build-type }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: vmactions/freebsd-vm@v1 - uses: vmactions/freebsd-vm@v1
with: with:
release: ${{ matrix.os.version}} release: ${{ matrix.os.version}}
@@ -198,7 +198,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
name: NetBSD-${{ matrix.os.version}} ${{ matrix.build-type }} name: NetBSD-${{ matrix.os.version}} ${{ matrix.build-type }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: vmactions/netbsd-vm@v1 - uses: vmactions/netbsd-vm@v1
with: with:
release: ${{ matrix.os.version}} release: ${{ matrix.os.version}}
@@ -231,7 +231,7 @@ jobs:
# runs-on: macos-latest # runs-on: macos-latest
# name: OpenBSD-${{ matrix.os.version}} ${{ matrix.build-type }} # name: OpenBSD-${{ matrix.os.version}} ${{ matrix.build-type }}
# steps: # steps:
# - uses: actions/checkout@v3 # - uses: actions/checkout@v4
# - uses: vmactions/openbsd-vm@v0 # - uses: vmactions/openbsd-vm@v0
# with: # with:
# release: ${{ matrix.os.version}} # release: ${{ matrix.os.version}}
@@ -268,7 +268,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.variant }} name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.variant }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install build dependencies - name: Install build dependencies
run: ${{ matrix.dependencies }} run: ${{ matrix.dependencies }}
@@ -323,7 +323,7 @@ jobs:
runs-on: ${{matrix.arch.host-os}} runs-on: ${{matrix.arch.host-os}}
name: ${{matrix.build-type}} cross-build for ${{ matrix.arch.triple }} name: ${{matrix.build-type}} cross-build for ${{ matrix.arch.triple }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: "Install cross-compile toolchain and QEMU (ubuntu-20.04)" - name: "Install cross-compile toolchain and QEMU (ubuntu-20.04)"
# Install the dependencies and clang 13. Earlier versions of clang don't # Install the dependencies and clang 13. Earlier versions of clang don't
# find the multilib things for this week's Ubuntu filesystem layout. # find the multilib things for this week's Ubuntu filesystem layout.
@@ -443,7 +443,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.build-type }} ${{ matrix.toolchain }} ${{ matrix.variant }} name: ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.build-type }} ${{ matrix.toolchain }} ${{ matrix.variant }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Configure CMake - name: Configure CMake
run: | run: |
cmake -B ${{github.workspace}}/build -A ${{ matrix.arch }} ${{ matrix.toolchain }} ${{ matrix.extra-cmake-flags }} -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On cmake -B ${{github.workspace}}/build -A ${{ matrix.arch }} ${{ matrix.toolchain }} ${{ matrix.extra-cmake-flags }} -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On
@@ -463,7 +463,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
# We don't need to do the build for this job, but we need to configure it to get the clang-format target # We don't need to do the build for this job, but we need to configure it to get the clang-format target
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install clang-tidy and clang-format - name: Install clang-tidy and clang-format
run: | run: |
sudo apt update sudo apt update
@@ -485,8 +485,20 @@ jobs:
exit 1 exit 1
fi fi
fuzzing:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DSNMALLOC_ENABLE_FUZZING=ON -DFUZZTEST_FUZZING_MODE=ON -DCMAKE_CXX_COMPILER=clang++
- name: Build
run: cmake --build ${{github.workspace}}/build --target snmalloc-fuzzer
- name: Test
run: ${{github.workspace}}/build/fuzzing/snmalloc-fuzzer
all-checks: all-checks:
# Currently FreeBSD and NetBSD CI are not working, so we do not require them to pass. # Currently FreeBSD and NetBSD CI are not working, so we do not require them to pass.
# Add fuzzing back when the memove issue is fixed.
needs: [ubuntu, macos, freebsd, netbsd, sanitizer, qemu-crossbuild, windows, format] needs: [ubuntu, macos, freebsd, netbsd, sanitizer, qemu-crossbuild, windows, format]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps: