From 2cff6df287cd6acc640f1c428f472b797b0cab75 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Thu, 6 Oct 2022 11:05:34 +0100 Subject: [PATCH] Workaround to make it compile in WASM (#9) * Increase carton version * Work around for avoiding maximum locals --- .github/workflows/wasm.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index b7b1a98..afba689 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -10,9 +10,9 @@ on: jobs: test: - name: BezierKit WASM support + name: WASM support runs-on: ubuntu-latest - container: ghcr.io/swiftwasm/carton:0.16.0 + container: ghcr.io/swiftwasm/carton:0.17.0 steps: - name: Checkout @@ -20,5 +20,11 @@ jobs: with: submodules: recursive + # Work around to avoid this issue: https://github.com/ChimeHQ/SwiftTreeSitter/issues/8 + # We are running wasm-opt -O before execute the test for avoiding maximum of locals - name: Test WebAssembly - run: carton test + run: | + swift build -c debug --product SwiftTreeSitterPackageTests -Xswiftc -color-diagnostics --triple wasm32-unknown-wasi + wasm-opt -O .build/wasm32-unknown-wasi/debug/SwiftTreeSitterPackageTests.wasm -o SwiftTreeSitterPackageTests.wasm + wasmer SwiftTreeSitterPackageTests.wasm +