Fuzzer #491
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Microsoft Corporation | |
# SPDX-License-Identifier: MIT | |
# Linux only. | |
name: Fuzzer | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '00 21 * * *' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
env: | |
BUILD_TYPE: Debug | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: 'recursive' | |
- name: Configure CMake | |
run: | | |
cmake \ | |
-B ${{github.workspace}}/build \ | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | |
-DBTF_ENABLE_FUZZING=TRUE | |
- name: Build only libbtf_fuzzer | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/build | |
- name: Tests | |
working-directory: ${{github.workspace}} | |
run: | | |
mkdir -p Artifacts | |
build/libfuzzer/libbtf_fuzzer build/libfuzzer/corpus -use_value_profile=1 -max_total_time=300 -artifact_prefix=Artifacts/ | |
- name: Check for generated artifacts | |
# Check for artifacts even if the workflow failed. | |
if: success() || failure() | |
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 | |
id: check_artifacts | |
with: | |
files: ${{github.workspace}}/Artifacts/* | |
- name: Upload generated artifacts | |
# Upload artifacts even if the workflow failed. | |
if: success() || failure() | |
id: upload_artifacts | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 | |
with: | |
name: Libfuzzer artifacts | |
path: ${{github.workspace}}/Artifacts/ | |
retention-days: 5 |