Skip to content

Commit e1420ce

Browse files
authored
Merge pull request #46 from DANP-LABS/feat/github-actions-wasm-build
feat(github-actions): Add WASM module build to CI
2 parents 21b59df + 03e05f8 commit e1420ce

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,31 @@ jobs:
4848
# bin/DANP-MCP-CLIENT-${{ matrix.platform }}*
4949
# bin/DANP-MCP-SERVER-${{ matrix.platform }}*
5050
# bin/*.exe
51+
52+
build-wasm:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Set up Go
58+
uses: actions/setup-go@v5
59+
with:
60+
go-version: '1.24'
61+
62+
- name: Install TinyGo
63+
run: |
64+
wget https://github.com/tinygo-org/tinygo/releases/download/v0.32.0/tinygo0.32.0.linux-amd64.tar.gz
65+
tar -xzf tinygo0.32.0.linux-amd64.tar.gz
66+
sudo mv tinygo /usr/local
67+
68+
- name: Build WASM Modules
69+
run: |
70+
for dir in wasm-examples/*/; do
71+
MODULE_NAME=$(basename "$dir")
72+
echo "Building $MODULE_NAME"
73+
cd "$dir" && \
74+
go mod init "$MODULE_NAME" >/dev/null 2>&1 && \
75+
go get github.com/extism/go-pdk && \
76+
GOOS=wasip1 GOARCH=wasm tinygo build -o "$MODULE_NAME".wasm -target wasi -opt=z -no-debug -scheduler=none main.go
77+
cd -
78+
done

0 commit comments

Comments
 (0)