diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..24d5ad8 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,32 @@ +on: [push, pull_request] + +name: CI + +jobs: + check: + name: 🍋 Check 检测 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + + test: + name: 🍋 Run Test Suite 单元测试 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - uses: actions-rs/cargo@v1 + with: + command: test diff --git a/Cargo.toml b/Cargo.toml index 0c218bc..16a6bd9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc-rust" -version = "0.1.1" +version = "0.1.2" edition = "2018" repository = "https://github.com/lemonhx/mimalloc-rust" description = "the best binding for mimalloc in rust" diff --git a/src/lib.rs b/src/lib.rs index 468ab58..0fbb17b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,7 +20,7 @@ //! #![feature(allocator_api)] //! use std::{ffi::c_void, mem::ManuallyDrop}; //! -//! use crate::{ +//! use mimalloc_rust::{ //! heap::{HeapVisitor, MiMallocHeap}, //! raw::{ //! heap::{mi_heap_area_t, mi_heap_delete, mi_heap_new}, diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 4df0dad..9709ae1 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -1,17 +1,8 @@ mod heap; -use std::{ffi::c_void, mem::ManuallyDrop, println}; -use crate::raw::{ - heap::{mi_heap_area_t, mi_heap_delete}, - runtime_options::mi_option_show_stats, - types::mi_heap_t, -}; +use crate::raw::runtime_options::mi_option_show_stats; -use crate::{ - heap::{HeapVisitor, MiMallocHeap}, - raw::heap::mi_heap_new, - with_heap, GlobalMiMalloc, -}; +use crate::GlobalMiMalloc; #[global_allocator] static GLOBAL_MIMALLOC: GlobalMiMalloc = GlobalMiMalloc;