Skip to content

Commit 14ceccd

Browse files
committed
fuzz: remove existing CI; run fuzz/generate-files.sh to make new one
1 parent 6fea17f commit 14ceccd

File tree

4 files changed

+83
-53
lines changed

4 files changed

+83
-53
lines changed

.github/workflows/fuzz.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Automatically generated by fuzz/generate-files.sh
2+
name: Fuzz
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- 'test-ci/**'
9+
pull_request:
10+
11+
jobs:
12+
fuzz:
13+
if: ${{ !github.event.act }}
14+
runs-on: ubuntu-20.04
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
fuzz_target: [
19+
roundtrip_miniscript_str,
20+
roundtrip_miniscript_script,
21+
parse_descriptor,
22+
roundtrip_semantic,
23+
parse_descriptor_secret,
24+
roundtrip_descriptor,
25+
roundtrip_concrete,
26+
compile_descriptor,
27+
]
28+
steps:
29+
- name: Install test dependencies
30+
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
31+
- uses: actions/checkout@v2
32+
- uses: actions/cache@v2
33+
id: cache-fuzz
34+
with:
35+
path: |
36+
~/.cargo/bin
37+
fuzz/target
38+
target
39+
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
40+
- uses: actions-rs/toolchain@v1
41+
with:
42+
toolchain: 1.58
43+
override: true
44+
profile: minimal
45+
- name: fuzz
46+
run: cd fuzz && ./fuzz.sh "${{ matrix.fuzz_target }}"
47+
- run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
48+
- uses: actions/upload-artifact@v2
49+
with:
50+
name: executed_${{ matrix.fuzz_target }}
51+
path: executed_${{ matrix.fuzz_target }}
52+
53+
verify-execution:
54+
if: ${{ !github.event.act }}
55+
needs: fuzz
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v2
59+
- uses: actions/download-artifact@v2
60+
- name: Display structure of downloaded files
61+
run: ls -R
62+
- run: find executed_* -type f -exec cat {} + | sort > executed
63+
- run: source ./fuzz/fuzz-util.sh && listTargetNames | sort | diff - executed

.github/workflows/rust.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,6 @@ on: [push, pull_request]
33
name: Continuous integration
44

55
jobs:
6-
Fuzz:
7-
name: Fuzz
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout Crate
11-
uses: actions/checkout@v2
12-
- name: Install hongfuzz dependencies
13-
run: sudo apt update && sudo apt install build-essential binutils-dev libunwind-dev libblocksruntime-dev liblzma-dev
14-
- name: Checkout Toolchain
15-
uses: actions-rs/toolchain@v1
16-
with:
17-
profile: minimal
18-
toolchain: 1.58.0
19-
override: true
20-
- name: Running fuzzer
21-
env:
22-
DO_FUZZ: true
23-
run: ./contrib/test.sh
24-
256
Nightly:
267
name: Nightly - Bench + Docs + Fmt
278
runs-on: ubuntu-latest

contrib/test.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,6 @@ if cargo --version | grep "1\.47\.0"; then
2626
cargo update -p serde --precise 1.0.156
2727
fi
2828

29-
# Fuzz if told to
30-
if [ "$DO_FUZZ" = true ]
31-
then
32-
cd fuzz
33-
cargo test --verbose
34-
./travis-fuzz.sh
35-
36-
# Exit out of the fuzzer, do not run other tests.
37-
exit 0
38-
fi
39-
4029
# Test bitcoind integration tests if told to (this only works with the stable toolchain)
4130
if [ "$DO_BITCOIND_TESTS" = true ]; then
4231
cd bitcoind-tests

fuzz/Cargo.toml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,47 @@
11
[package]
22
name = "descriptor-fuzz"
3+
edition = "2018"
34
version = "0.0.1"
4-
authors = ["Automatically generated"]
5+
authors = ["Generated by fuzz/generate-files.sh"]
56
publish = false
67

78
[package.metadata]
89
cargo-fuzz = true
910

10-
[features]
11-
afl_fuzz = ["afl"]
12-
honggfuzz_fuzz = ["honggfuzz"]
13-
1411
[dependencies]
15-
honggfuzz = { version = "0.5.55", default-features = false, optional = true }
16-
afl = { version = "0.8", optional = true }
17-
regex = { version = "1.4"}
18-
miniscript = { path = "..", features = ["compiler"] }
12+
honggfuzz = { version = "0.5.55", default-features = false }
13+
miniscript = { path = "..", features = [ "compiler" ] }
14+
15+
regex = "1.4"
1916

2017
[[bin]]
21-
name = "roundtrip_descriptor"
22-
path = "fuzz_targets/roundtrip_descriptor.rs"
18+
name = "roundtrip_miniscript_str"
19+
path = "fuzz_targets/roundtrip_miniscript_str.rs"
2320

2421
[[bin]]
2522
name = "roundtrip_miniscript_script"
2623
path = "fuzz_targets/roundtrip_miniscript_script.rs"
2724

2825
[[bin]]
29-
name = "roundtrip_miniscript_str"
30-
path = "fuzz_targets/roundtrip_miniscript_str.rs"
31-
32-
[[bin]]
33-
name = "roundtrip_concrete"
34-
path = "fuzz_targets/roundtrip_concrete.rs"
26+
name = "parse_descriptor"
27+
path = "fuzz_targets/parse_descriptor.rs"
3528

3629
[[bin]]
3730
name = "roundtrip_semantic"
3831
path = "fuzz_targets/roundtrip_semantic.rs"
3932

4033
[[bin]]
41-
name = "compile_descriptor"
42-
path = "fuzz_targets/compile_descriptor.rs"
34+
name = "parse_descriptor_secret"
35+
path = "fuzz_targets/parse_descriptor_secret.rs"
4336

4437
[[bin]]
45-
name = "parse_descriptor"
46-
path = "fuzz_targets/parse_descriptor.rs"
38+
name = "roundtrip_descriptor"
39+
path = "fuzz_targets/roundtrip_descriptor.rs"
4740

4841
[[bin]]
49-
name = "parse_descriptor_secret"
50-
path = "fuzz_targets/parse_descriptor_secret.rs"
42+
name = "roundtrip_concrete"
43+
path = "fuzz_targets/roundtrip_concrete.rs"
44+
45+
[[bin]]
46+
name = "compile_descriptor"
47+
path = "fuzz_targets/compile_descriptor.rs"

0 commit comments

Comments
 (0)