Skip to content

Commit

Permalink
chore(main):add valgrind test
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Apr 20, 2024
1 parent f7dcd0b commit 5ce2fca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
rustup override set nightly
cargo miri setup
export MIRIFLAGS="-Zmiri-disable-isolation"
- name: Setting Up Valgrind
run: python3 ./script/init_valgrind_rust.py
- name: Build
run: cargo build --all
- name: Build Release
Expand Down
14 changes: 14 additions & 0 deletions script/init_valgrind_rust.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
用于初始化rust的valgrind配置,主要用于CI/CD的valgrind检测单元测试
"""

import os

dir_name = os.path.expanduser("~/.cargo/config.toml")
with open(dir_name, "w") as f:
f.write(
"""
[target.'cfg(target_os = "linux")']
runner = "valgrind --leak-check=full"
"""
)

0 comments on commit 5ce2fca

Please sign in to comment.