1
+ on :
2
+ schedule :
3
+ - cron : " 00 05 * * *" # At 05:00 (UTC) every day.
4
+ workflow_dispatch : # allows manual triggering
5
+
6
+ permissions : {}
7
+
8
+ name : Daily Fuzz
9
+
10
+ jobs :
11
+ fuzz :
12
+ name : Cargo Fuzz
13
+ runs-on : ubuntu-latest
14
+ env :
15
+ # The version of `cargo-fuzz` to install and use.
16
+ CARGO_FUZZ_VERSION : 0.13.1
17
+
18
+ # The number of seconds to run the fuzz target. 1800 seconds = 30 minutes.
19
+ FUZZ_TIME : 1800
20
+
21
+ strategy :
22
+ fail-fast : false
23
+ matrix :
24
+ include :
25
+ - fuzz_target : bdk_wallet
26
+
27
+ steps :
28
+ - name : Checkout
29
+ uses : actions/checkout@v4
30
+ with :
31
+ persist-credentials : false
32
+
33
+ - name : Install the nightly Rust channel
34
+ uses : actions-rs/toolchain@v1
35
+ with :
36
+ toolchain : nightly
37
+ override : true
38
+ profile : minimal
39
+
40
+ - name : Check cache for cargo-fuzz
41
+ id : cache-cargo-fuzz
42
+ uses : actions/cache@v4
43
+ with :
44
+ path : ${{ runner.tool_cache }}/cargo-fuzz
45
+ key : cargo-fuzz-bin-${{ env.CARGO_FUZZ_VERSION }}
46
+
47
+ - name : Install cargo-fuzz
48
+ if : steps.cache-cargo-fuzz.outputs.cache-hit != 'true'
49
+ run : |
50
+ cargo_fuzz_version = "$CARGO_FUZZ_VERSION"
51
+ cargo install --root "${{ runner.tool_cache }}/cargo-fuzz" --version $cargo_fuzz_version cargo-fuzz --locked
52
+
53
+ - name : Add cargo-fuzz to PATH
54
+ run : echo "${{ runner.tool_cache }}/cargo-fuzz/bin" >> $GITHUB_PATH
55
+
56
+ - name : Build & Run Fuzz Target
57
+ run : |
58
+ fuzz_time = "$FUZZ_TIME"
59
+ cargo fuzz build ${{ matrix.fuzz_target }}
60
+ cargo fuzz run ${{ matrix.fuzz_target }} -- -max_total_time=$fuzz_time
61
+
62
+ - name : Upload fuzzing artifacts on failure
63
+ uses : actions/upload-artifact@v4
64
+ if : failure()
65
+ with :
66
+ name : fuzzing-artifacts-${{ matrix.fuzz_target }}-${{ github.sha }}
67
+ path : fuzz/artifacts
68
+
69
+ # TODO: add a verify-execution job similar to rust-bitcoin's one
0 commit comments