mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-23 07:58:09 +00:00
Run fuzzer in CI
Signed-off-by: AdamKorcz <Adam@adalogics.com>
This commit is contained in:
parent
20805af8a5
commit
fe75647b43
6
.clusterfuzzlite/Dockerfile
Normal file
6
.clusterfuzzlite/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
||||
FROM gcr.io/oss-fuzz-base/base-builder
|
||||
RUN apt-get update && apt-get install -y make autoconf automake libtool \
|
||||
pkg-config
|
||||
COPY . $SRC/trezor-firmware
|
||||
WORKDIR $SRC/trezor-firmware/crypto
|
||||
COPY .clusterfuzzlite/build.sh $SRC/
|
5
.clusterfuzzlite/build.sh
Executable file
5
.clusterfuzzlite/build.sh
Executable file
@ -0,0 +1,5 @@
|
||||
# reset sanitizer and optimization flags to avoid interfering with $CFLAGS
|
||||
export SANFLAGS=""
|
||||
export OPTFLAGS="-O3 -march=native -gline-tables-only"
|
||||
FUZZER=1 VALGRIND=0 make -j$(nproc) fuzzer
|
||||
mv fuzzer/fuzzer $OUT/
|
1
.clusterfuzzlite/project.yaml
Normal file
1
.clusterfuzzlite/project.yaml
Normal file
@ -0,0 +1 @@
|
||||
language: c
|
29
.github/workflows/cflite.yml
vendored
Normal file
29
.github/workflows/cflite.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: ClusterFuzzLite PR fuzzing
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**'
|
||||
permissions: read-all
|
||||
jobs:
|
||||
PR:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sanitizer: [address]
|
||||
steps:
|
||||
- name: Build Fuzzers (${{ matrix.sanitizer }})
|
||||
id: build
|
||||
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
|
||||
with:
|
||||
sanitizer: ${{ matrix.sanitizer }}
|
||||
language: c
|
||||
- name: Run Fuzzers (${{ matrix.sanitizer }})
|
||||
id: run
|
||||
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
fuzz-seconds: 400
|
||||
mode: 'code-change'
|
||||
sanitizer: ${{ matrix.sanitizer }}
|
Loading…
Reference in New Issue
Block a user