Fuzz #50
This file contains hidden or 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: | |
| schedule: | |
| # Nightly at 03:00 UTC. | |
| - cron: "0 3 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| max_total_time: | |
| description: "Per-target fuzzing time in seconds" | |
| required: false | |
| default: "600" | |
| permissions: | |
| contents: read | |
| jobs: | |
| fuzz: | |
| name: fuzz ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| # Don't cancel the other targets when one finds a crash. | |
| fail-fast: false | |
| matrix: | |
| # Each entry is a fuzz target plus an optional libFuzzer dictionary | |
| # (basename under fuzz/dictionaries/, without the .dict suffix). | |
| include: | |
| - target: sparse_reader | |
| dict: csr | |
| - target: npy_reader | |
| dict: npy | |
| - target: jsonl_reader | |
| dict: json | |
| - target: compound_payloads | |
| dict: json | |
| - target: metadata | |
| dict: json | |
| - target: parse_info | |
| dict: info | |
| - target: datetime | |
| dict: datetime | |
| - target: ft_search | |
| dict: resp | |
| - target: compound_queries | |
| dict: json | |
| - target: compound_data | |
| dict: json | |
| - target: sparse_roundtrip | |
| dict: csr | |
| - target: npy_roundtrip | |
| dict: npy | |
| - target: gt_reader | |
| dict: gt | |
| - target: gt_roundtrip | |
| dict: gt | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libhdf5-dev pkg-config | |
| - name: Install nightly toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| . | |
| fuzz | |
| - name: Install cargo-fuzz | |
| run: cargo install cargo-fuzz --locked | |
| # Persist/restore the fuzzing corpus so coverage accumulates across nights. | |
| - name: Restore corpus cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: fuzz/corpus/${{ matrix.target }} | |
| key: fuzz-corpus-${{ matrix.target }}-${{ github.run_id }} | |
| restore-keys: | | |
| fuzz-corpus-${{ matrix.target }}- | |
| - name: Build fuzz targets | |
| run: cargo fuzz build ${{ matrix.target }} | |
| - name: Run fuzzer (high effort) | |
| run: | | |
| DICT_ARG="" | |
| if [ -n "${{ matrix.dict }}" ] && [ -f "fuzz/dictionaries/${{ matrix.dict }}.dict" ]; then | |
| DICT_ARG="-dict=fuzz/dictionaries/${{ matrix.dict }}.dict" | |
| fi | |
| cargo fuzz run ${{ matrix.target }} -- \ | |
| -max_total_time=${{ github.event.inputs.max_total_time || '600' }} \ | |
| -rss_limit_mb=4096 -timeout=25 $DICT_ARG | |
| # On crash the previous step fails; upload the reproducers before failing. | |
| - name: Upload crash artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fuzz-crashes-${{ matrix.target }} | |
| path: fuzz/artifacts/** | |
| if-no-files-found: ignore |