Skip to content

Commit

Permalink
Use cifuzz actions
Browse files Browse the repository at this point in the history
  • Loading branch information
akheron committed Jan 25, 2021
1 parent aa52a60 commit f7aee00
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
pull_request:
branches: [ master ]
paths:
- '**.c'
- '**.h'

jobs:
fuzz:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'jansson'
dry-run: false
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'jansson'
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v1
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
17 changes: 0 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,3 @@ jobs:
- run: cmake -DJANSSON_COVERAGE=ON -DJANSSON_COVERALLS=ON -DCMAKE_BUILD_TYPE=Debug
- run: cmake --build .
- run: cmake --build . --target coveralls

fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git clone https://github.com/google/oss-fuzz.git /tmp/ossfuzz
if [ "$GITHUB_HEAD_REF" ]; then
BRANCH=${GITHUB_HEAD_REF##*/}
else
BRANCH=${GITHUB_REF##*/}
fi
sed -i "s@https://github.com/akheron/jansson.git@-b $BRANCH https://github.com/${{github.repository}}.git@" /tmp/ossfuzz/projects/jansson/Dockerfile
pushd /tmp/ossfuzz
python infra/helper.py build_image --pull jansson
python infra/helper.py build_fuzzers jansson
popd

0 comments on commit f7aee00

Please sign in to comment.