Visitar URL original
gh-107652: Set up CIFuzz to run fuzz targets continuously by illia-v · Pull Request #107653 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,50 @@ jobs:
- name: Tests
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"

# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
cifuzz:
name: CIFuzz
runs-on: ubuntu-latest
timeout-minutes: 60
needs: check_source
# oss-fuzz maintains a configuration for fuzzing the main branch of
# CPython, so the tests should be run only for code that has been or is
# likely to be merged into the main branch.
# Compatibility with older branches may be broken.
if: (github.ref_name == 'main' || github.base_ref == 'main') && needs.check_source.outputs.run_tests == 'true'
permissions:
security-events: write
strategy:
fail-fast: false
matrix:
sanitizer: [address, undefined, memory]
steps:
- name: Build Fuzzers (${{ matrix.sanitizer }})
Comment thread
illia-v marked this conversation as resolved.
Outdated
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: cpython3
sanitizer: ${{ matrix.sanitizer }}
- name: Run Fuzzers (${{ matrix.sanitizer }})
Comment thread
illia-v marked this conversation as resolved.
Outdated
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
fuzz-seconds: 600
oss-fuzz-project-name: cpython3
output-sarif: true
sanitizer: ${{ matrix.sanitizer }}
- name: Upload Crash
Comment thread
illia-v marked this conversation as resolved.
Outdated
uses: actions/upload-artifact@v3
if: failure() && steps.build.outcome == 'success'
with:
name: ${{ matrix.sanitizer }}-artifacts
path: ./out/artifacts
- name: Upload SARIF
if: always() && steps.build.outcome == 'success'
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: cifuzz-sarif/results.sarif
checkout_path: cifuzz-sarif

all-required-green: # This job does nothing and is only used for the branch protection
name: All required checks pass
if: always()
Expand All @@ -535,6 +579,7 @@ jobs:
- build_ubuntu_ssltests
- test_hypothesis
- build_asan
- cifuzz
Comment thread
hugovk marked this conversation as resolved.

runs-on: ubuntu-latest

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Set up CIFuzz to run fuzz targets in GitHub Actions. Patch by Illia
Volochii.