From 6e93431cc611174b193ca1a7c1708438347b71f8 Mon Sep 17 00:00:00 2001 From: Bodigrim Date: Mon, 5 Feb 2024 21:44:00 +0000 Subject: [PATCH] Add WASM CI job --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44b5d9503..e5585f268 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -246,3 +246,37 @@ jobs: name: Run build (arm64v8 linux) with: args: sh -c "cabal update && cabal test" + + wasi: + runs-on: ubuntu-latest + env: + GHC_WASM_META_REV: c0aa3bb7d88bb6ec809210e17658dd1ed64ba66c + strategy: + matrix: + ghc: ['9.6', '9.8'] + fail-fast: false + steps: + - name: setup-ghc-wasm32-wasi + run: | + cd $(mktemp -d) + curl -L https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/$GHC_WASM_META_REV/ghc-wasm-meta.tar.gz | tar xz --strip-components=1 + ./setup.sh + ~/.ghc-wasm/add_to_github_path.sh + env: + FLAVOUR: ${{ matrix.ghc }} + - uses: actions/checkout@v4 + - uses: actions/cache@v3 + with: + path: | + ~/.ghc-wasm/.cabal/store + key: wasi-${{ runner.os }}-${{ env.GHC_WASM_META_REV }}-flavour-${{ matrix.ghc }}-${{ github.sha }} + restore-keys: | + wasi-${{ runner.os }}-${{ env.GHC_WASM_META_REV }}-flavour-${{ matrix.ghc }}- + - name: Build + run: | + mv cabal.project.wasi cabal.project.local + wasm32-wasi-cabal build --enable-tests + wasm32-wasi-cabal list-bin test:tests + - name: Test + run: | + wasmtime.sh $(wasm32-wasi-cabal list-bin test:tests)