From b90c9abbf9284c1aedb60f519268cfcaa3c6bc46 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Thu, 6 Oct 2022 09:01:21 +0200 Subject: [PATCH 1/2] Increase carton version --- .github/workflows/wasm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index b7b1a98..48dc820 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 From f210c72fe78ed32bb20e98e6dc9a466b6bc920a5 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Thu, 6 Oct 2022 10:36:03 +0200 Subject: [PATCH 2/2] Work around for avoiding maximum locals --- .github/workflows/wasm.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 48dc820..afba689 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -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 +