Skip to content

Commit 95ec137

Browse files
authored
cmov: test WASM using wasmtime (#1438)
1 parent 368f33d commit 95ec137

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

.github/workflows/cmov.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,28 @@ concurrency:
2626
cancel-in-progress: true
2727

2828
jobs:
29-
minimal-versions:
30-
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
31-
with:
32-
working-directory: ${{ github.workflow }}
33-
34-
build:
35-
runs-on: ubuntu-latest
29+
build-no-std:
3630
strategy:
3731
matrix:
38-
rust:
39-
- 1.85.0 # MSRV
40-
- stable
4132
target:
33+
- riscv32i-unknown-none-elf
4234
- thumbv7em-none-eabi
43-
- wasm32-unknown-unknown
35+
runs-on: ubuntu-latest
4436
steps:
4537
- uses: actions/checkout@v6
4638
- uses: RustCrypto/actions/cargo-cache@master
4739
- uses: dtolnay/rust-toolchain@master
4840
with:
49-
toolchain: ${{ matrix.rust }}
41+
toolchain: stable
5042
targets: ${{ matrix.target }}
5143
- uses: RustCrypto/actions/cargo-hack-install@master
52-
- run: cargo build --target ${{ matrix.target }}
44+
- run: cargo build --target ${{ matrix.target }} --all-features
45+
- run: cargo build --target ${{ matrix.target }} --all-features --release
46+
47+
minimal-versions:
48+
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
49+
with:
50+
working-directory: ${{ github.workflow }}
5351

5452
test:
5553
strategy:
@@ -163,3 +161,18 @@ jobs:
163161
- uses: dtolnay/rust-toolchain@nightly
164162
- run: rustup component add miri && cargo miri setup
165163
- run: cargo miri test --target ${{ matrix.target }} --all-features --lib
164+
165+
# Test WASM using `wasmtime`
166+
test-wasm:
167+
runs-on: ubuntu-latest
168+
env:
169+
CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime"
170+
steps:
171+
- uses: actions/checkout@v6
172+
- uses: bytecodealliance/actions/wasmtime/setup@v1
173+
- uses: dtolnay/rust-toolchain@master
174+
with:
175+
toolchain: stable
176+
targets: wasm32-wasip1
177+
- run: cargo test --target wasm32-wasip1 --all-features
178+
- run: cargo test --target wasm32-wasip1 --all-features --release

cmov/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ wrappers for the CMOV family of instructions on x86/x86_64 and CSEL on AArch64,
1717
portable "best-effort" pure Rust fallback implementation.
1818
"""
1919

20-
[dev-dependencies]
20+
[target.'cfg(any(unix, windows))'.dev-dependencies]
2121
proptest = "1.9"
2222

2323
[lints]

cmov/tests/proptests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! `cmov` property-based tests: randomized with shrinking.
22
3+
#![cfg(any(unix, windows))]
4+
35
/// Write the proptests for an integer type.
46
macro_rules! int_proptests {
57
( $($int:ident),+ ) => {

0 commit comments

Comments
 (0)