From 452b6ed7b1b5827f8176b47fb7529a5a373f38db Mon Sep 17 00:00:00 2001 From: lemonhx Date: Fri, 13 Aug 2021 15:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=8B=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/rust.yml | 32 ++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- src/lib.rs | 2 +- src/tests/mod.rs | 13 ++----------- 4 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/rust.yml 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;