Skip to content

Commit

Permalink
Create fuzzing_parser and fuzzing_checker CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasikpark committed Jun 1, 2024
1 parent df16602 commit 34eecf1
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jobs:
working-directory: src/js-cli-and-library
shell: bash

fuzzing:
fuzzing_parser:
needs: validity
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down Expand Up @@ -244,6 +244,56 @@ jobs:
fi
working-directory: parser/fuzz

fuzzing_checker:
needs: validity
runs-on: ubuntu-latest
timeout-minutes: 15
continue-on-error: true
strategy:
matrix:
fuzz-target: [check_project_naive]

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
checker:
- 'checker/**'
- name: Install latest nightly and set it as default
if: steps.changes.outputs.checker == 'true'
run: |
rustup install nightly
rustup default nightly
- uses: brndnmtthws/rust-action-cargo-binstall@v1
if: steps.changes.outputs.checker == 'true'
with:
packages: cargo-fuzz

- name: Run fuzzing
env:
SHORT_CIRCUIT: true
if: steps.changes.outputs.checker == 'true'
run: |
if ${{ env.SHORT_CIRCUIT }}; then
cargo fuzz run -s none ${{ matrix.fuzz-target }} -- -timeout=10 -use_value_profile=1 -max_total_time=120
else
cargo fuzz run -s none ${{ matrix.fuzz-target }} -- -timeout=10 -use_value_profile=1 -max_total_time=300 -fork=1 -ignore_crashes=1
# if test -d fuzz/artifacts; then
# find fuzz/artifacts -type f -print -exec xxd {} \; -exec cargo fuzz fmt -s none module_roundtrip_structured {} \;; false;
# fi
fi
working-directory: checker/fuzz
clippy:
needs: validity
runs-on: ubuntu-latest
Expand Down

0 comments on commit 34eecf1

Please sign in to comment.