test: add deserialization fuzz testing #28
Workflow file for this run
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
name: fuzz | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '30 12 * * 0' | |
permissions: | |
contents: read | |
jobs: | |
build_fuzz_targets: | |
name: Build fuzz target | |
runs-on: macos-14 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install cargo fuzz | |
run: cargo install cargo-fuzz | |
- name: Build fuzz targetsFuzz Tests | |
run: cargo fuzz build --release --debug-assertions | |
- name: Upload fuzz target | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz-target | |
path: fuzz/target/ | |
fuzz: | |
name: ${{ matrix.target }} | |
runs-on: macos-14 | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
# classfile fuzzing | |
- base_type_parse | |
- class_access_flags_from_bytes | |
- class_file_from_bytes | |
- constant_from_bytes | |
- constant_pool_from_bytes | |
- field_access_flags_from_bytes | |
- field_from_bytes | |
- field_type_parse | |
- method_access_flags_from_bytes | |
- method_from_bytes | |
- mutf8_from_bytes | |
- mutf8_to_bytes | |
- reference_kind_from_bytes | |
- version_from_bytes | |
# classfile attributes fuzzing | |
- annotation_from_bytes | |
- annotation_element_from_bytes | |
- annotation_value_pair_from_bytes | |
- array_type_from_bytes | |
- bootstrap_method_from_bytes | |
- code_exception_from_bytes | |
- exports_flags_from_bytes | |
- exports_from_bytes | |
- inner_class_from_bytes | |
- instruction_from_bytes | |
- line_number_from_bytes | |
- local_variable_table_from_bytes | |
- local_variable_target_from_bytes | |
- method_parameter_from_bytes | |
- module_access_flags_from_bytes | |
- nested_class_access_flags_from_bytes | |
- opens_from_bytes | |
- opens_flags_from_bytes | |
- parameter_annotation_from_bytes | |
- provides_from_bytes | |
- record_from_bytes | |
- requires_flags_from_bytes | |
- requires_from_bytes | |
- stack_frame_from_bytes | |
- target_path_from_bytes | |
- target_type_from_bytes | |
- type_annotation_from_bytes | |
- verification_type_from_bytes | |
include: | |
- target: base_type_parse | |
option: -max_len=1 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install cargo fuzz | |
run: cargo install cargo-fuzz | |
- name: Download fuzz target | |
uses: actions/download-artifact@v4 | |
with: | |
name: fuzz-target | |
- name: Fuzz Tests | |
run: cargo fuzz run ${{ matrix.target }} -- -max_total_time=30 -rss_limit_mb=8192 ${{ matrix.option }} |