From 65fe3cdb9991aeea610bac53abed23df8f497cb0 Mon Sep 17 00:00:00 2001 From: konsumlamm Date: Sat, 2 Dec 2023 15:12:46 +0100 Subject: [PATCH] Run WASM tests --- .github/workflows/ci.yaml | 6 +++++- bitvec.cabal | 4 +++- cabal.project.wasi | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 cabal.project.wasi diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 21af1bb..dd32e22 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -147,11 +147,15 @@ jobs: export SKIP_GHC=yes ./setup.sh source ~/.ghc-wasm/env + ~/.ghc-wasm/add_to_github_path.sh cd .. ghcup install ghc --set ${{ env.version }} -- --host=x86_64-linux --with-intree-gmp --with-system-libffi - name: Build run: | - cabal --with-compiler=wasm32-wasi-ghc --with-hc-pkg=wasm32-wasi-ghc-pkg build + mv cabal.project.wasi cabal.project.local + cabal --with-compiler=wasm32-wasi-ghc --with-hc-pkg=wasm32-wasi-ghc-pkg build --enable-tests + cabal --with-compiler=wasm32-wasi-ghc --with-hc-pkg=wasm32-wasi-ghc-pkg list-bin test:bitvec-tests --enable-tests + wasmtime $(cabal --with-compiler=wasm32-wasi-ghc --with-hc-pkg=wasm32-wasi-ghc-pkg list-bin test:bitvec-tests --enable-tests) bounds-checking: needs: build diff --git a/bitvec.cabal b/bitvec.cabal index 858596d..43e9191 100644 --- a/bitvec.cabal +++ b/bitvec.cabal @@ -128,7 +128,9 @@ test-suite bitvec-tests Tests.SetOps Tests.SetOpsTS Tests.Vector - ghc-options: -Wall -threaded -rtsopts -Wcompat + ghc-options: -Wall -Wcompat + if !arch(wasm32) + ghc-options: -threaded -rtsopts include-dirs: test if impl(ghc <9.0) diff --git a/cabal.project.wasi b/cabal.project.wasi new file mode 100644 index 0000000..386cf71 --- /dev/null +++ b/cabal.project.wasi @@ -0,0 +1,5 @@ +-- https://github.com/haskellari/splitmix/pull/73 +source-repository-package + type: git + location: https://github.com/amesgen/splitmix.git + tag: 83b906c4bcdc2720546f1779a16eb65e8e12ecba