From 90753ea9153297515e41ce7cb4d989c20efe1375 Mon Sep 17 00:00:00 2001 From: Zhenchi Date: Tue, 23 Jan 2024 08:27:50 +0000 Subject: [PATCH 1/3] chore: prepare 0.1.5 Signed-off-by: Zhenchi --- Cargo.toml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cdfad14..d4958e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minstant" -version = "0.1.4" +version = "0.1.5" authors = ["The TiKV Authors"] edition = "2021" license = "MIT" diff --git a/README.md b/README.md index cb319cc..e9f3749 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A drop-in replacement for [`std::time::Instant`](https://doc.rust-lang.org/std/t ```toml [dependencies] -minstant = "0.1.2" +minstant = "0.1" ``` ```rust From 4d087429e7deb14c9064dc5de77ad94d40ce03cf Mon Sep 17 00:00:00 2001 From: Zhenchi Date: Tue, 23 Jan 2024 09:12:09 +0000 Subject: [PATCH 2/3] ci: add wasm Signed-off-by: Zhenchi --- .github/workflows/ci.yml | 10 ++++++++++ Cargo.toml | 2 ++ src/lib.rs | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c9ba3e..695e6e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,3 +36,13 @@ jobs: run: cargo test --workspace --all-targets --all-features -- --nocapture - name: Run benches run: cargo bench --workspace --all-targets --all-features + + build-wasm: + runs-on: ubuntu-latest + env: + RUST_BACKTRACE: 1 + steps: + - uses: actions/checkout@v2 + - name: Set up toolchains + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - run: wasm-pack test --node diff --git a/Cargo.toml b/Cargo.toml index d4958e3..4e6267b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,8 @@ atomic = [] criterion = "0.3" quanta = "0.9" rand = "0.8" +wasm-bindgen-test = "0.3" +getrandom = { version = "0.2", features = ["js"] } [[bench]] name = "criterion" diff --git a/src/lib.rs b/src/lib.rs index d3151a1..d069405 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -96,13 +96,16 @@ mod tests { use super::*; use rand::Rng; use std::time::{Duration, Instant as StdInstant}; + use wasm_bindgen_test::wasm_bindgen_test; #[test] + #[wasm_bindgen_test] fn test_is_tsc_available() { let _ = is_tsc_available(); } #[test] + #[wasm_bindgen_test] fn test_monotonic() { let mut prev = 0; for _ in 0..10000 { @@ -113,6 +116,7 @@ mod tests { } #[test] + #[wasm_bindgen_test] fn test_nanos_per_cycle() { let _ = nanos_per_cycle(); } From 90fe898db11f43e79fe850f8f7d887944d64b17f Mon Sep 17 00:00:00 2001 From: Zhenchi Date: Tue, 23 Jan 2024 09:14:13 +0000 Subject: [PATCH 3/3] fix yaml format Signed-off-by: Zhenchi --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 695e6e6..14cd99e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: env: RUST_BACKTRACE: 1 steps: - - uses: actions/checkout@v2 - - name: Set up toolchains - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - run: wasm-pack test --node + - uses: actions/checkout@v2 + - name: Set up toolchains + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - run: wasm-pack test --node