-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (73 loc) · 2.37 KB
/
fuzz.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Automatically generated by fuzz/generate-files.sh
name: Fuzz
on:
push:
branches:
- master
- 'test-ci/**'
pull_request:
jobs:
fuzz:
if: ${{ !github.event.act }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fuzz_target: [
bitcoin_deserialize_address,
bitcoin_deserialize_amount,
bitcoin_deserialize_block,
bitcoin_deserialize_prefilled_transaction,
bitcoin_deserialize_psbt,
bitcoin_deserialize_script,
bitcoin_deserialize_transaction,
bitcoin_deserialize_witness,
bitcoin_deser_net_msg,
bitcoin_outpoint_string,
bitcoin_script_bytes_to_asm_fmt,
hashes_cbor,
hashes_json,
hashes_ripemd160,
hashes_sha1,
hashes_sha256,
hashes_sha512_256,
hashes_sha512,
]
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@v4
- uses: actions/cache@v3
id: cache-fuzz
with:
path: |
~/.cargo/bin
fuzz/target
target
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: '1.65.0'
- name: fuzz
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 }}"
- run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v3
with:
name: executed_${{ matrix.fuzz_target }}
path: executed_${{ matrix.fuzz_target }}
verify-execution:
if: ${{ !github.event.act }}
needs: fuzz
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- run: find executed_* -type f -exec cat {} + | sort > executed
- run: source ./fuzz/fuzz-util.sh && listTargetNames | sort | diff - executed