2021-09-23 08:36:07 +00:00
|
|
|
name: Fuzz
|
|
|
|
|
2023-03-22 15:19:30 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- 'test-ci/**'
|
|
|
|
pull_request:
|
2021-09-23 08:36:07 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
fuzz:
|
2022-02-16 23:15:42 +00:00
|
|
|
if: ${{ !github.event.act }}
|
2021-09-23 08:36:07 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-08-16 05:07:59 +00:00
|
|
|
fuzz_target: [deser_net_msg, deserialize_address, deserialize_amount, deserialize_block, deserialize_psbt, deserialize_script, deserialize_transaction, deserialize_prefilled_transaction, deserialize_witness, outpoint_string, script_bytes_to_asm_fmt]
|
2021-09-23 08:36:07 +00:00
|
|
|
steps:
|
|
|
|
- name: Install test dependencies
|
|
|
|
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
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: cache-fuzz
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin
|
|
|
|
fuzz/target
|
|
|
|
target
|
|
|
|
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-02-25 07:45:49 +00:00
|
|
|
toolchain: 1.58
|
2021-09-23 08:36:07 +00:00
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- name: fuzz
|
2022-09-16 01:52:57 +00:00
|
|
|
run: cd bitcoin/fuzz && ./travis-fuzz.sh "${{ matrix.fuzz_target }}"
|
2021-09-24 08:47:16 +00:00
|
|
|
- run: echo "${{ matrix.fuzz_target }}.rs" >executed_${{ matrix.fuzz_target }}
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: executed_${{ matrix.fuzz_target }}
|
|
|
|
path: executed_${{ matrix.fuzz_target }}
|
|
|
|
|
|
|
|
verify-execution:
|
2022-02-16 23:15:42 +00:00
|
|
|
if: ${{ !github.event.act }}
|
2021-09-24 08:47:16 +00:00
|
|
|
needs: fuzz
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
- name: Display structure of downloaded files
|
|
|
|
run: ls -R
|
|
|
|
- run: find executed_* -type f -exec cat {} + | sort > executed
|
2022-09-16 01:52:57 +00:00
|
|
|
- run: ls bitcoin/fuzz/fuzz_targets | sort > expected
|
2021-09-24 08:47:16 +00:00
|
|
|
- run: diff expected executed
|