From 92b151faa1f524b2b31a9ffd4edeb361c7607fe8 Mon Sep 17 00:00:00 2001 From: Christopher Berner Date: Sat, 7 Sep 2024 11:56:07 -0700 Subject: [PATCH] Enable wasi CI tests --- .github/workflows/ci.yml | 21 ++++++++++++--------- justfile | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69b94a48..2b24d347 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,6 +64,11 @@ jobs: if: steps.rust-cache.outputs.cache-hit != 'true' run: cargo install --force --version 1.8.0 just --locked + - name: Setup wasmtime + uses: bytecodealliance/actions/wasmtime/setup@v1 + with: + version: "24.0.0" + - name: Compile run: cargo build --all-targets --all-features @@ -98,12 +103,10 @@ jobs: pip3 install maturin just test_py -# Re-enable when this works on stable -# - name: Run WASI tests -# if: startsWith(matrix.os, 'macos') -# run: | -# rustup toolchain install nightly -# rustup target add wasm32-wasi -# brew install wasmtime -# cargo install --force --version 0.1.27 cargo-wasi --locked -# just test_wasi + - name: Run WASI tests + if: runner.os != 'Windows' + run: | + rustup toolchain install nightly + rustup target add wasm32-wasi + cargo install --force --version 0.1.27 cargo-wasi --locked + just test_wasi diff --git a/justfile b/justfile index cf5e6f8b..4bb7b739 100644 --- a/justfile +++ b/justfile @@ -28,7 +28,7 @@ test: pre RUST_BACKTRACE=1 cargo test test_wasi: pre - CARGO_TARGET_WASM32_WASI_RUNNER="wasmtime --mapdir=/::$TMPDIR" cargo +nightly wasi test -- --nocapture + CARGO_TARGET_WASM32_WASI_RUNNER="wasmtime --mapdir=/::/tmp" cargo +nightly wasi test -- --nocapture bench bench='lmdb_benchmark': pre cargo bench --bench {{bench}}