Fixes for release (#237)
* Fixes for release * add new test * Remove change applied in development branch * Only add dependency for wasm32 * Update ci.yml Co-authored-by: Luis Moreno <morenol@users.noreply.github.com> Co-authored-by: Lorenzo <tunedconsulting@gmail.com>
This commit is contained in:
@@ -46,11 +46,16 @@ jobs:
|
||||
- name: Install test runner for wasi
|
||||
if: matrix.platform.target == 'wasm32-wasi'
|
||||
run: curl https://wasmtime.dev/install.sh -sSf | bash
|
||||
- name: Stable Build
|
||||
- name: Stable Build with all features
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --all-features --target ${{ matrix.platform.target }}
|
||||
- name: Stable Build without features
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --target ${{ matrix.platform.target }}
|
||||
- name: Tests
|
||||
if: matrix.platform.target == 'x86_64-unknown-linux-gnu' || matrix.platform.target == 'x86_64-pc-windows-msvc' || matrix.platform.target == 'aarch64-apple-darwin'
|
||||
uses: actions-rs/cargo@v1
|
||||
|
||||
+1
-2
@@ -26,7 +26,6 @@ ndarray = { version = "0.15", optional = true }
|
||||
num-traits = "0.2.12"
|
||||
num = "0.4"
|
||||
rand = { version = "0.8.5", default-features = false, features = ["small_rng"] }
|
||||
getrandom = "*"
|
||||
rand_distr = { version = "0.4", optional = true }
|
||||
serde = { version = "1", features = ["derive"], optional = true }
|
||||
|
||||
@@ -40,7 +39,7 @@ std_rand = ["rand/std_rng", "rand/std"]
|
||||
js = ["getrandom/js"]
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
getrandom = { version = "*", features = ["js"] }
|
||||
getrandom = { version = "*", optional = true }
|
||||
|
||||
[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dev-dependencies]
|
||||
wasm-bindgen-test = "0.3"
|
||||
|
||||
+11
-3
@@ -15,9 +15,17 @@ pub fn get_rng_impl(seed: Option<u64>) -> RngImpl {
|
||||
RngImpl::seed_from_u64(rand::thread_rng().next_u64())
|
||||
} else {
|
||||
// no std_random feature build, use getrandom
|
||||
let mut buf = [0u8; 64];
|
||||
getrandom::getrandom(&mut buf).unwrap();
|
||||
RngImpl::seed_from_u64(buf[0] as u64)
|
||||
#[cfg(feature = "js")]
|
||||
{
|
||||
let mut buf = [0u8; 64];
|
||||
getrandom::getrandom(&mut buf).unwrap();
|
||||
RngImpl::seed_from_u64(buf[0] as u64)
|
||||
}
|
||||
#[cfg(not(feature = "js"))]
|
||||
{
|
||||
// Using 0 as default seed
|
||||
RngImpl::seed_from_u64(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user