2023-03-22 17:18:07 +00:00
|
|
|
# Automatically generated by fuzz/generate-files.sh
|
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 }}
|
2023-10-08 09:19:06 +00:00
|
|
|
runs-on: ubuntu-latest
|
2021-09-23 08:36:07 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-03-22 17:18:07 +00:00
|
|
|
fuzz_target: [
|
2023-10-08 09:19:06 +00:00
|
|
|
bitcoin_deserialize_address,
|
|
|
|
bitcoin_deserialize_block,
|
|
|
|
bitcoin_deserialize_prefilled_transaction,
|
|
|
|
bitcoin_deserialize_psbt,
|
|
|
|
bitcoin_deserialize_script,
|
|
|
|
bitcoin_deserialize_transaction,
|
|
|
|
bitcoin_deserialize_witness,
|
2023-10-10 14:30:33 +00:00
|
|
|
bitcoin_deser_net_msg,
|
2023-10-08 09:19:06 +00:00
|
|
|
bitcoin_outpoint_string,
|
|
|
|
bitcoin_script_bytes_to_asm_fmt,
|
|
|
|
hashes_cbor,
|
|
|
|
hashes_json,
|
|
|
|
hashes_ripemd160,
|
|
|
|
hashes_sha1,
|
|
|
|
hashes_sha256,
|
|
|
|
hashes_sha512_256,
|
2023-10-10 14:30:33 +00:00
|
|
|
hashes_sha512,
|
2023-08-08 08:47:05 +00:00
|
|
|
units_deserialize_amount,
|
2023-03-22 17:18:07 +00:00
|
|
|
]
|
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
|
2023-09-09 15:26:36 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-08 20:23:05 +00:00
|
|
|
- uses: actions/cache@v3
|
2021-09-23 08:36:07 +00:00
|
|
|
id: cache-fuzz
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin
|
|
|
|
fuzz/target
|
|
|
|
target
|
|
|
|
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
2023-10-08 09:19:06 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2021-09-23 08:36:07 +00:00
|
|
|
with:
|
2023-10-08 09:19:06 +00:00
|
|
|
toolchain: '1.65.0'
|
2021-09-23 08:36:07 +00:00
|
|
|
- name: fuzz
|
2023-05-08 21:56:10 +00:00
|
|
|
run: |
|
|
|
|
if [[ "${{ matrix.fuzz_target }}" =~ ^bitcoin ]]; then
|
|
|
|
export RUSTFLAGS='--cfg=hashes_fuzz --cfg=secp256k1_fuzz'
|
|
|
|
fi
|
|
|
|
echo "Using RUSTFLAGS $RUSTFLAGS"
|
|
|
|
cd fuzz && ./fuzz.sh "${{ matrix.fuzz_target }}"
|
2023-03-22 17:18:07 +00:00
|
|
|
- run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
|
2023-09-11 10:17:32 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2021-09-24 08:47:16 +00:00
|
|
|
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:
|
2023-09-09 15:26:36 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-18 10:36:58 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2021-09-24 08:47:16 +00:00
|
|
|
- name: Display structure of downloaded files
|
|
|
|
run: ls -R
|
|
|
|
- run: find executed_* -type f -exec cat {} + | sort > executed
|
2023-03-22 17:18:07 +00:00
|
|
|
- run: source ./fuzz/fuzz-util.sh && listTargetNames | sort | diff - executed
|