Fuzz Testing #1
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 Testing | |
| on: | |
| # Run daily at 2 AM UTC | |
| schedule: | |
| - cron: '0 2 * * *' | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| inputs: | |
| duration: | |
| description: 'Fuzz test duration (e.g., 10m, 1h)' | |
| required: false | |
| default: '15m' | |
| permissions: | |
| contents: read | |
| jobs: | |
| fuzz: | |
| runs-on: ubuntu-latest | |
| name: Fuzz Testing | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 21 | |
| distribution: 'corretto' | |
| - name: Cache compiled buildscripts | |
| uses: actions/cache@v4 | |
| with: | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('buildSrc/**/*.kts') }} | |
| path: | | |
| ./buildSrc/build | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| gradle-home-cache-includes: | | |
| caches | |
| - name: Restore fuzz corpus cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: fuzz-corpus-${{ github.run_id }} | |
| restore-keys: | | |
| fuzz-corpus- | |
| path: | | |
| **/.cifuzz-corpus/ | |
| **/src/fuzz/resources/corpus/ | |
| - name: Run all fuzz tests | |
| run: | | |
| DURATION="${{ github.event.inputs.duration || '1h' }}" | |
| ./gradlew fuzz -Pfuzz.maxDuration=$DURATION --stacktrace | |
| - name: Save fuzz corpus cache | |
| uses: actions/cache/save@v4 | |
| if: always() | |
| with: | |
| key: fuzz-corpus-${{ github.run_id }} | |
| path: | | |
| **/.cifuzz-corpus/ | |
| **/src/fuzz/resources/corpus/ | |
| - name: Upload fuzz test reports | |
| uses: actions/upload-artifact@v5 | |
| if: always() | |
| with: | |
| name: fuzz-test-reports | |
| path: '**/build/reports/jazzer/**' | |
| - name: Upload crash artifacts | |
| uses: actions/upload-artifact@v5 | |
| if: failure() | |
| with: | |
| name: fuzz-crashes | |
| path: | | |
| **/crash-* | |
| **/leak-* | |
| **/timeout-* |