6565 override : true
6666 components : rustfmt
6767 - name : fmt
68- run : cargo fmt --all -- --check
68+ uses : actions-rs/cargo@v1
69+ with :
70+ command : fmt
71+ args : --all -- --check
6972
7073 style_and_docs :
7174 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
@@ -105,38 +108,61 @@ jobs:
105108 profile : minimal
106109 toolchain : nightly
107110 override : true
108- - uses : actions-rs/cargo@v1
111+ - name : Install afl
112+ uses : actions-rs/cargo@v1
109113 with :
110114 command : install
111- args : cargo-fuzz
115+ args : cargo-afl
116+ - name : cargo afl system-config
117+ uses : actions-rs/cargo@v1
118+ with :
119+ command : afl
120+ args : system-config
112121 - name : compile fuzz
113122 uses : actions-rs/cargo@v1
114123 with :
115- command : fuzz
116- args : build --all-features fuzz_read
124+ command : afl
125+ args : build --all-features --manifest-path ${{ github.workspace }}/ fuzz_read/Cargo.toml
117126 - name : run fuzz
118- timeout-minutes : 350
127+ timeout-minutes : 70
119128 uses : actions-rs/cargo@v1
120129 with :
121- command : fuzz
122- args : run --all-features fuzz_read -- fuzz/corpus/fuzz_read -timeout=10s -rss_limit_mb=8192 -fork=2 -runs=25000000 -max_len=1000 -max_total_time=20700 -dict=fuzz/fuzz.dict
130+ command : afl
131+ args : fuzz -i ${{ github.workspace }}/fuzz_read/in -o out -V 3600 -a binary -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read
132+ - name : Minimize corpus
133+ uses : actions-rs/cargo@v1
134+ with :
135+ command : afl
136+ args : cmin -i out/default/queue -o out_cmin -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read
137+ - name : Report coverage
138+ uses : actions-rs/cargo@v1
139+ with :
140+ command : afl
141+ args : showmap -C -i out -o map -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read
142+ - run : sudo apt install rename
143+ - name : Rename files
144+ run : |
145+ rename 's/:/-/g' map/*
146+ rename 's/:/-/g' out_cmin/*
147+ rename 's/:/-/g' out/default/crashes/*
148+ - name : Upload updated corpus
149+ uses : actions/upload-artifact@v4
150+ with :
151+ name : fuzz_read_corpus
152+ path : out_cmin/*
123153 - name : Upload any failure inputs
124154 if : always()
125155 uses : actions/upload-artifact@v4
126156 with :
127157 name : fuzz_read_bad_inputs
128- path : fuzz/artifacts/fuzz_read/crash- *
158+ path : out/default/crashes/ *
129159 if-no-files-found : ignore
130- - name : Minimize seed corpus
131- if : always()
132- run : ./recursive-fuzz-cmin.sh read 70000
133- shell : bash
134- - name : Upload updated seed corpus
160+ - name : Upload coverage report
135161 if : always()
136162 uses : actions/upload-artifact@v4
137163 with :
138- name : fuzz_read_corpus
139- path : fuzz/corpus/fuzz_read/*
164+ name : fuzz_read_coverage
165+ path : map
140166
141167 fuzz_read_with_no_features :
142168 runs-on : ubuntu-latest
@@ -151,28 +177,50 @@ jobs:
151177 profile : minimal
152178 toolchain : nightly
153179 override : true
154- - uses : actions-rs/cargo@v1
180+ - name : Install afl
181+ uses : actions-rs/cargo@v1
155182 with :
156183 command : install
157- args : cargo-fuzz
184+ args : cargo-afl
185+ - name : cargo afl system-config
186+ uses : actions-rs/cargo@v1
187+ with :
188+ command : afl
189+ args : system-config
158190 - name : compile fuzz
159191 uses : actions-rs/cargo@v1
160192 with :
161- command : fuzz
162- args : build --no-default-features fuzz_read
193+ command : afl
194+ args : build --manifest-path ${{ github.workspace }}/ fuzz_read/Cargo.toml
163195 - name : run fuzz
164- timeout-minutes : 350
196+ timeout-minutes : 70
197+ uses : actions-rs/cargo@v1
198+ with :
199+ command : afl
200+ args : fuzz -i ${{ github.workspace }}/fuzz_read/in -o out -V 3600 -a binary -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read
201+ - name : Report coverage
165202 uses : actions-rs/cargo@v1
166203 with :
167- command : fuzz
168- args : run --no-default-features fuzz_read fuzz/corpus/fuzz_read -- -rss_limit_mb=8192 -timeout=10s -fork=2 -runs=40000000 -max_total_time=20700 -max_len=70000 -dict=fuzz/fuzz.dict
204+ command : afl
205+ args : showmap -C -i out -o map -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read
206+ - run : sudo apt install rename
207+ - name : Rename files
208+ run : |
209+ rename 's/:/-/g' map/*
210+ rename 's/:/-/g' out/default/crashes/*
169211 - name : Upload any failure inputs
170212 if : always()
171213 uses : actions/upload-artifact@v4
172214 with :
173- name : fuzz_read_no_features_bad_inputs
174- path : fuzz/artifacts/fuzz_read/crash- *
215+ name : fuzz_read_bad_inputs_no_features
216+ path : out/default/crashes/ *
175217 if-no-files-found : ignore
218+ - name : Upload coverage report
219+ if : always()
220+ uses : actions/upload-artifact@v4
221+ with :
222+ name : fuzz_read_coverage_no_features
223+ path : map
176224
177225 fuzz_write :
178226 runs-on : ubuntu-latest
@@ -187,41 +235,61 @@ jobs:
187235 profile : minimal
188236 toolchain : nightly
189237 override : true
190- - uses : actions-rs/cargo@v1
238+ - name : Install afl
239+ uses : actions-rs/cargo@v1
191240 with :
192241 command : install
193- args : cargo-fuzz
242+ args : cargo-afl
243+ - name : cargo afl system-config
244+ uses : actions-rs/cargo@v1
245+ with :
246+ command : afl
247+ args : system-config
194248 - name : compile fuzz
195249 uses : actions-rs/cargo@v1
196250 with :
197- command : fuzz
198- args : build --all-features fuzz_write
251+ command : afl
252+ args : build --all-features --manifest-path ${{ github.workspace }}/ fuzz_write/Cargo.toml
199253 - name : run fuzz
200- timeout-minutes : 350
254+ timeout-minutes : 70
255+ uses : actions-rs/cargo@v1
256+ with :
257+ command : afl
258+ args : fuzz -i ${{ github.workspace }}/fuzz_write/in -o out -V 3600 -a binary -x ${{ github.workspace }}/fuzz_write/fuzz.dict -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write
259+ - name : Minimize corpus
201260 uses : actions-rs/cargo@v1
202261 with :
203- command : fuzz
204- args : run --all-features fuzz_write fuzz/corpus/fuzz_write -- -rss_limit_mb=8192 -timeout=2s -fork=2 -runs=5000000 -max_len=160 -max_total_time=20700 -dict=fuzz/fuzz.dict
262+ command : afl
263+ args : cmin -i out/default/queue -o out_cmin -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write
264+ - name : Report coverage
265+ uses : actions-rs/cargo@v1
266+ with :
267+ command : afl
268+ args : showmap -C -i out -o map -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write
269+ - run : sudo apt install rename
270+ - name : Rename files
271+ run : |
272+ rename 's/:/-/g' map/*
273+ rename 's/:/-/g' out_cmin/*
274+ rename 's/:/-/g' out/default/crashes/*
275+ - name : Upload updated corpus
276+ uses : actions/upload-artifact@v4
277+ with :
278+ name : fuzz_write_corpus
279+ path : out_cmin/*
205280 - name : Upload any failure inputs
206281 if : always()
207282 uses : actions/upload-artifact@v4
208283 with :
209284 name : fuzz_write_bad_inputs
210- path : |
211- fuzz/artifacts/fuzz_write/crash-*
212- fuzz/artifacts/fuzz_write/leak-*
213- fuzz/artifacts/fuzz_write/timeout-*
285+ path : out/default/crashes/*
214286 if-no-files-found : ignore
215- - name : Minimize seed corpus
216- if : always()
217- run : ./recursive-fuzz-cmin.sh write 500
218- shell : bash
219- - name : Upload updated seed corpus
287+ - name : Upload coverage report
220288 if : always()
221289 uses : actions/upload-artifact@v4
222290 with :
223- name : fuzz_write_corpus
224- path : fuzz/corpus/fuzz_write/*
291+ name : fuzz_write_coverage
292+ path : map
225293
226294 fuzz_write_with_no_features :
227295 runs-on : ubuntu-latest
@@ -236,25 +304,47 @@ jobs:
236304 profile : minimal
237305 toolchain : nightly
238306 override : true
239- - uses : actions-rs/cargo@v1
307+ - name : Install afl
308+ uses : actions-rs/cargo@v1
240309 with :
241310 command : install
242- args : cargo-fuzz
311+ args : cargo-afl
312+ - name : cargo afl system-config
313+ uses : actions-rs/cargo@v1
314+ with :
315+ command : afl
316+ args : system-config
243317 - name : compile fuzz
244318 uses : actions-rs/cargo@v1
245319 with :
246- command : fuzz
247- args : build --no-default- features fuzz_write
320+ command : afl
321+ args : build --all- features --manifest-path ${{ github.workspace }}/ fuzz_write/Cargo.toml
248322 - name : run fuzz
249- timeout-minutes : 350
323+ timeout-minutes : 70
250324 uses : actions-rs/cargo@v1
251325 with :
252- command : fuzz
253- args : run --no-default-features fuzz_write fuzz/corpus/fuzz_write -- -rss_limit_mb=8192 -timeout=10s -fork=2 -runs=40000000 -max_len=256 -max_total_time=20700 -dict=fuzz/fuzz.dict
326+ command : afl
327+ args : fuzz -i ${{ github.workspace }}/fuzz_write/in -o out -V 3600 -a binary -x ${{ github.workspace }}/fuzz_write/fuzz.dict -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write
328+ - name : Report coverage
329+ uses : actions-rs/cargo@v1
330+ with :
331+ command : afl
332+ args : showmap -C -i out -o map -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write
333+ - run : sudo apt install rename
334+ - name : Rename files
335+ run : |
336+ rename 's/:/-/g' map/*
337+ rename 's/:/-/g' out/default/crashes/*
254338 - name : Upload any failure inputs
255339 if : always()
256340 uses : actions/upload-artifact@v4
257341 with :
258- name : fuzz_write_no_features_bad_inputs
259- path : fuzz/artifacts/fuzz_write/crash- *
342+ name : fuzz_write_bad_inputs_no_features
343+ path : out/default/crashes/ *
260344 if-no-files-found : ignore
345+ - name : Upload coverage report
346+ if : always()
347+ uses : actions/upload-artifact@v4
348+ with :
349+ name : fuzz_write_coverage_no_features
350+ path : map
0 commit comments