Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci-fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 Yegor Bugayenko
# SPDX-License-Identifier: MIT

name: CI (Build + Short Fuzz)

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-fuzz:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable

- name: Install nightly toolchain for fuzzing
run: rustup toolchain install nightly

- name: Install cargo-fuzz
run: cargo install cargo-fuzz

- name: Build library
run: cargo build --release

- name: Run short fuzz test (60s)
run: cargo +nightly fuzz run fuzz_map_basic -- -max_total_time=60

39 changes: 39 additions & 0 deletions .github/workflows/nightly-fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 Yegor Bugayenko
# SPDX-License-Identifier: MIT

name: Nightly Fuzz Testing

on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:

jobs:
nightly-fuzz:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchains
run: |
rustup toolchain install nightly
rustup default nightly
cargo install cargo-fuzz

- name: Enable sanitizers
run: |
export RUSTFLAGS="-Zsanitizer=address"
export ASAN_OPTIONS=detect_leaks=1

- name: Run extended fuzzing (1h)
run: cargo +nightly fuzz run fuzz_map_basic -- -max_total_time=3600

- name: Upload fuzz artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: fuzz-crashes
path: fuzz/artifacts/fuzz_map_basic/

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.DS_Store
.DS_Store
.idea/
*.bak
*.relf
Expand All @@ -7,3 +7,4 @@ bin/
node_modules/
target/
tmp/
fuzz/artifacts/
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 Yegor Bugayenko
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 Yegor Bugayenko
# SPDX-License-Identifier: MIT

[package]
Expand All @@ -12,6 +12,7 @@ readme = "README.md"
license = "MIT"
homepage = "https://github.com/yegor256/micromap"
keywords = ["memory", "map"]
exclude = ["fuzz"]
categories = ["data-structures", "memory-management"]

[dependencies]
Expand Down
209 changes: 209 additions & 0 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "micromap-fuzz"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
micromap = { path = "../" }
libfuzzer-sys = "0.4"
arbitrary = "1.3"

[dev-dependencies]
rand = "0.9.2"

[profile.release]
debug = true

[workspace]
# Keep this fuzz crate isolated from the main workspace.

[package.metadata]
cargo-fuzz = true

[[bin]]
name = "fuzz_map_basic"
path = "fuzz_targets/fuzz_map_basic.rs"
Loading
Loading