|
| 1 | +# Automatically generated by fuzz/generate-files.sh |
| 2 | +name: Fuzz |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # 6am every day UTC, this correlates to: |
| 6 | + # - 11pm PDT |
| 7 | + # - 7am CET |
| 8 | + # - 5pm AEDT |
| 9 | + - cron: '00 06 * * *' |
| 10 | + |
| 11 | +jobs: |
| 12 | + fuzz: |
| 13 | + if: ${{ !github.event.act }} |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + # We only get 20 jobs at a time, we probably don't want to go |
| 19 | + # over that limit with fuzzing because of the hour run time. |
| 20 | + fuzz_target: [ |
| 21 | + minreq_http, |
| 22 | + simple_http, |
| 23 | + ] |
| 24 | + steps: |
| 25 | + - name: Install test dependencies |
| 26 | + run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - uses: actions/cache@v4 |
| 29 | + id: cache-fuzz |
| 30 | + with: |
| 31 | + path: | |
| 32 | + ~/.cargo/bin |
| 33 | + fuzz/target |
| 34 | + target |
| 35 | + key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} |
| 36 | + - uses: dtolnay/rust-toolchain@stable |
| 37 | + with: |
| 38 | + toolchain: '1.65.0' |
| 39 | + - name: fuzz |
| 40 | + run: | |
| 41 | + if [[ "${{ matrix.fuzz_target }}" =~ ^bitcoin ]]; then |
| 42 | + export RUSTFLAGS='--cfg=hashes_fuzz --cfg=secp256k1_fuzz' |
| 43 | + fi |
| 44 | + echo "Using RUSTFLAGS $RUSTFLAGS" |
| 45 | + cd fuzz && ./fuzz.sh "${{ matrix.fuzz_target }}" |
| 46 | + - run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }} |
| 47 | + - uses: actions/upload-artifact@v3 |
| 48 | + with: |
| 49 | + name: executed_${{ matrix.fuzz_target }} |
| 50 | + path: executed_${{ matrix.fuzz_target }} |
| 51 | + |
| 52 | + verify-execution: |
| 53 | + if: ${{ !github.event.act }} |
| 54 | + needs: fuzz |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + - uses: actions/download-artifact@v3 |
| 59 | + - name: Display structure of downloaded files |
| 60 | + run: ls -R |
| 61 | + - run: find executed_* -type f -exec cat {} + | sort > executed |
| 62 | + - run: source ./fuzz/fuzz-util.sh && listTargetNames | sort | diff - executed |
0 commit comments