1
1
---
2
2
version : 2.1
3
3
4
+ orbs :
5
+
6
+
4
7
commands :
5
8
rust_components :
6
9
description : Verify installed components
@@ -370,11 +373,64 @@ jobs:
370
373
command : cargo +nightly fuzz build
371
374
- cache_save
372
375
376
+ # Runs fuzzing
377
+ run-fuzz :
378
+ docker :
379
+ - image : quay.io/influxdb/rust:ci
380
+ resource_class : xlarge # use of a smaller executor tends crashes on link
381
+ environment :
382
+ # Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
383
+ CARGO_INCREMENTAL : " 0"
384
+ # Disable full debug symbol generation to speed up CI build
385
+ # "1" means line tables only, which is useful for panic tracebacks.
386
+ RUSTFLAGS : " -C debuginfo=1"
387
+ # https://github.com/rust-lang/cargo/issues/10280
388
+ CARGO_NET_GIT_FETCH_WITH_CLI : " true"
389
+ steps :
390
+ - checkout
391
+ - rust_components
392
+ - cache_restore
393
+ - restore_cache :
394
+ name : Restoring artifacts & corpus
395
+ keys :
396
+ - fuzz-state
397
+ - run :
398
+ name : Install cargo-fuzz
399
+ command : cargo install cargo-fuzz
400
+ - run :
401
+ name : Install nightly toolchain
402
+ command : rustup toolchain install nightly-x86_64-unknown-linux-gnu
403
+ - run :
404
+ name : Cargo fuzz build
405
+ command : cargo +nightly fuzz build
406
+ - run :
407
+ name : Run fuzzers
408
+ command : |
409
+ for f in ./fuzz/fuzz_targets/*.rs; do
410
+ cargo +nightly fuzz run "$(basename "$f" .rs)" -- -runs=100000
411
+ done
412
+ - save_cache :
413
+ name : Save artifacts & corpus
414
+ paths :
415
+ - fuzz/artifacts
416
+ - fuzz/corpus
417
+ key : fuzz-state-{{ epoch }}
418
+ when : always
419
+ - store_artifacts :
420
+ path : fuzz/artifacts
421
+ - cache_save
422
+ - slack/notify :
423
+ event : fail
424
+ template : basic_fail_1
425
+
373
426
workflows :
374
427
version : 2
375
428
376
429
# CI for all pull requests.
377
430
ci :
431
+ when :
432
+ and :
433
+ - not : << pipeline.parameters.fuzz >>
378
434
jobs :
379
435
- fmt
380
436
- lint
@@ -386,3 +442,15 @@ workflows:
386
442
- build-all-features
387
443
- build-fuzz
388
444
- doc
445
+
446
+ # Run fuzzer every 15mins
447
+ fuzz :
448
+ triggers :
449
+ - schedule :
450
+ cron : " */15 * * * *"
451
+ filters :
452
+ branches :
453
+ only :
454
+ - main
455
+ jobs :
456
+ - run-fuzz
0 commit comments