3434 - macos-latest
3535 - ubuntu-24.04
3636 llvm : [19]
37- go : [' 1.21.13', ' 1.22.12', ' 1.23.6', ' 1.24.0' ]
37+ go : [" 1.21.13", " 1.22.12", " 1.23.6", " 1.24.2" ]
3838 runs-on : ${{matrix.os}}
3939 steps :
4040 - uses : actions/checkout@v4
5858 - name : Set up Go for build
5959 uses : ./.github/actions/setup-go
6060 with :
61- go-version : " 1.24.0 "
61+ go-version : " 1.24.2 "
6262
6363 - name : Install
6464 run : |
@@ -105,7 +105,7 @@ jobs:
105105 - macos-latest
106106 - ubuntu-24.04
107107 llvm : [19]
108- go : ["1.24.0 "]
108+ go : ["1.24.2 "]
109109 runs-on : ${{matrix.os}}
110110 steps :
111111 - uses : actions/checkout@v4
@@ -124,7 +124,7 @@ jobs:
124124 - name : Set up Go for build
125125 uses : ./.github/actions/setup-go
126126 with :
127- go-version : " 1.24.0 "
127+ go-version : " 1.24.2 "
128128
129129 - name : Install
130130 run : |
@@ -146,7 +146,7 @@ jobs:
146146 matrix :
147147 os : [ubuntu-24.04, macos-latest]
148148 llvm : [19]
149- go : [' 1.21.13', ' 1.22.12', ' 1.23.6', ' 1.24.0' ]
149+ go : [" 1.21.13", " 1.22.12", " 1.23.6", " 1.24.2" ]
150150 runs-on : ${{matrix.os}}
151151 steps :
152152 - uses : actions/checkout@v4
@@ -158,7 +158,7 @@ jobs:
158158 - name : Set up Go 1.23 for building llgo
159159 uses : ./.github/actions/setup-go
160160 with :
161- go-version : " 1.24.0 "
161+ go-version : " 1.24.2 "
162162
163163 - name : Install llgo
164164 run : |
@@ -197,3 +197,50 @@ jobs:
197197 with :
198198 go-version : ${{matrix.go}}
199199 mod-version : " 1.24"
200+
201+ cross-compile :
202+ continue-on-error : true
203+ strategy :
204+ matrix :
205+ os : [macos-latest]
206+ llvm : [19]
207+ runs-on : ${{matrix.os}}
208+ steps :
209+ - uses : actions/checkout@v4
210+ - name : Install dependencies
211+ uses : ./.github/actions/setup-deps
212+ with :
213+ llvm-version : ${{matrix.llvm}}
214+
215+ - name : Set up Go for building llgo
216+ uses : ./.github/actions/setup-go
217+ with :
218+ go-version : " 1.24.2"
219+
220+ - name : Install wasmtime and wasi-libc
221+ run : |
222+ brew install wasmtime
223+ wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/libclang_rt.builtins-wasm32-wasi-25.0.tar.gz
224+ tar -xvf libclang_rt.builtins-wasm32-wasi-25.0.tar.gz
225+ mkdir -p `llvm-config --libdir`/clang/19/lib/wasi/
226+ mv libclang_rt.builtins-wasm32-wasi-25.0/libclang_rt.builtins-wasm32.a `llvm-config --libdir`/clang/19/lib/wasi/
227+
228+ - name : Install llgo
229+ run : |
230+ go install ./...
231+ echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV
232+
233+ - name : Test Cross Compilation (wasm)
234+ shell : bash
235+ working-directory : _demo
236+ run : |
237+ echo "Testing cross-compilation wasm with Go 1.24.2"
238+
239+ # Compile for wasm architecture
240+ GOOS=wasip1 GOARCH=wasm llgo build -o hello -v ./helloc
241+
242+ # Check file type
243+ file hello.wasm
244+
245+ # Run the wasm binary using llgo_wasm
246+ wasmtime hello.wasm
0 commit comments