parser-fuzz #65
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
| # SPDX-License-Identifier: MPL-2.0 | |
| # | |
| # Parser fuzzing (TRG §3.1). | |
| # | |
| # Runs the three `oo7-core-parser-fuzz` targets for a bounded | |
| # duration on every nightly schedule. This is the runner side of the | |
| # TRG §3.1 parser-fuzz-harness gate; the ≥1-day-continuous-fuzzing | |
| # claim the audit asks for is gated on consecutive green runs of | |
| # this workflow. | |
| # | |
| # Run duration per target is intentionally short (5 minutes each, 15 | |
| # minutes total) so the job fits inside the standard nightly window | |
| # without crowding the oracle-fuzz job. The gate counts wall-clock | |
| # days of clean runs, not CPU-hours. | |
| # | |
| # Scheduled 20 minutes after `oracle-fuzz` (04:13 UTC) to avoid | |
| # registry / build-cache contention. | |
| name: parser-fuzz | |
| on: | |
| schedule: | |
| - cron: '33 4 * * *' # 04:33 UTC nightly | |
| workflow_dispatch: | |
| permissions: read-all | |
| concurrency: | |
| group: parser-fuzz | |
| cancel-in-progress: false | |
| jobs: | |
| fuzz: | |
| name: oo7-core parser fuzz (5 min × 3 targets) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install nightly toolchain | |
| uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 | |
| with: | |
| toolchain: nightly | |
| - name: Cache cargo registry + fuzz target | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 | |
| with: | |
| workspaces: | | |
| . | |
| crates/oo7-core/fuzz | |
| - name: Install cargo-fuzz | |
| run: cargo install cargo-fuzz --locked | |
| - name: Seed corpus from repo | |
| working-directory: crates/oo7-core/fuzz | |
| run: | | |
| mkdir -p corpus/parse_str corpus/parse_grammar corpus/parse_recover | |
| # Seed all three raw-string targets from the same seed set: | |
| # real .007 programs exercise far more rule combinations than | |
| # libFuzzer's mutator can reach in 5 minutes from empty. | |
| if [ -d seeds ]; then | |
| cp -f seeds/* corpus/parse_str/ 2>/dev/null || true | |
| cp -f seeds/* corpus/parse_grammar/ 2>/dev/null || true | |
| cp -f seeds/* corpus/parse_recover/ 2>/dev/null || true | |
| fi | |
| - name: Run parse_str (5 minutes) | |
| working-directory: crates/oo7-core/fuzz | |
| run: | | |
| cargo +nightly fuzz run parse_str -- -max_total_time=300 | |
| - name: Run parse_grammar (5 minutes) | |
| working-directory: crates/oo7-core/fuzz | |
| run: | | |
| cargo +nightly fuzz run parse_grammar -- -max_total_time=300 | |
| - name: Run parse_recover (5 minutes) | |
| working-directory: crates/oo7-core/fuzz | |
| run: | | |
| cargo +nightly fuzz run parse_recover -- -max_total_time=300 | |
| - name: Upload corpus + artefacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: parser-fuzz-artifacts | |
| path: | | |
| crates/oo7-core/fuzz/artifacts | |
| crates/oo7-core/fuzz/corpus |