From 0d46dd904fce4e73c3b2e181ceee7ddc6e1c7516 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 | 24 +++++++++++++++--------- justfile | 4 ++-- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69b94a48..a9b872cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,11 @@ jobs: # For some reason this is required to run the fuzzer on OSX rustup target add x86_64-apple-darwin + - name: Setup wasmtime + uses: bytecodealliance/actions/wasmtime/setup@v1 + with: + version: "24.0.0" + - name: Install cargo-deny if: steps.rust-cache.outputs.cache-hit != 'true' run: rustup run --install 1.74 cargo install --force --version 0.14.17 cargo-deny --locked @@ -60,6 +65,10 @@ jobs: if: steps.rust-cache.outputs.cache-hit != 'true' run: cargo install --force --version 0.11.0 cargo-fuzz --locked + - name: Install cargo-wasi + if: steps.rust-cache.outputs.cache-hit != 'true' + run: cargo install --force --version 0.1.28 cargo-wasi --locked + - name: Install just if: steps.rust-cache.outputs.cache-hit != 'true' run: cargo install --force --version 1.8.0 just --locked @@ -98,12 +107,9 @@ 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 + just test_wasi diff --git a/justfile b/justfile index cf5e6f8b..e2eb7302 100644 --- a/justfile +++ b/justfile @@ -27,8 +27,8 @@ install_py: pre test: pre RUST_BACKTRACE=1 cargo test -test_wasi: pre - CARGO_TARGET_WASM32_WASI_RUNNER="wasmtime --mapdir=/::$TMPDIR" cargo +nightly wasi test -- --nocapture +test_wasi: + RUSTFLAGS="-Z wasi-exec-model=reactor" cargo +nightly wasi test -- --nocapture bench bench='lmdb_benchmark': pre cargo bench --bench {{bench}}