update docs and CI

This commit is contained in:
Li Jie
2025-04-08 09:36:48 +08:00
parent f35063ee6e
commit f0ade21155
8 changed files with 79 additions and 20 deletions

View File

@@ -34,7 +34,7 @@ jobs:
- macos-latest
- ubuntu-24.04
llvm: [19]
go: ['1.21.13', '1.22.12', '1.23.6', '1.24.0']
go: ["1.21.13", "1.22.12", "1.23.6", "1.24.2"]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
@@ -58,7 +58,7 @@ jobs:
- name: Set up Go for build
uses: ./.github/actions/setup-go
with:
go-version: "1.24.0"
go-version: "1.24.2"
- name: Install
run: |
@@ -105,7 +105,7 @@ jobs:
- macos-latest
- ubuntu-24.04
llvm: [19]
go: ["1.24.0"]
go: ["1.24.2"]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
@@ -124,7 +124,7 @@ jobs:
- name: Set up Go for build
uses: ./.github/actions/setup-go
with:
go-version: "1.24.0"
go-version: "1.24.2"
- name: Install
run: |
@@ -146,7 +146,7 @@ jobs:
matrix:
os: [ubuntu-24.04, macos-latest]
llvm: [19]
go: ['1.21.13', '1.22.12', '1.23.6', '1.24.0']
go: ["1.21.13", "1.22.12", "1.23.6", "1.24.2"]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
@@ -158,7 +158,7 @@ jobs:
- name: Set up Go 1.23 for building llgo
uses: ./.github/actions/setup-go
with:
go-version: "1.24.0"
go-version: "1.24.2"
- name: Install llgo
run: |
@@ -197,3 +197,46 @@ jobs:
with:
go-version: ${{matrix.go}}
mod-version: "1.24"
cross-compile:
continue-on-error: true
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/setup-deps
with:
llvm-version: 19
- name: Set up Go for building llgo
uses: ./.github/actions/setup-go
with:
go-version: "1.24.2"
- name: Install wasmtime and wasi-libc
run: |
brew install wasmtime
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/libclang_rt.builtins-wasm32-wasi-25.0.tar.gz
tar -xvf libclang_rt.builtins-wasm32-wasi-25.0.tar.gz
mkdir -p `llvm-config --libdir`/clang/19/lib/wasi/
mv libclang_rt.builtins-wasm32-wasi-25.0/libclang_rt.builtins-wasm32.a `llvm-config --libdir`/clang/19/lib/wasi/
- name: Install llgo
run: |
go install ./...
echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Test Cross Compilation (wasm)
shell: bash
working-directory: _demo
run: |
echo "Testing cross-compilation wasm with Go 1.24.2"
# Compile for wasm architecture
GOOS=wasip1 GOARCH=wasm llgo build -o hello -v ./helloc
# Check file type
file hello.wasm
# Run the wasm binary using llgo_wasm
wasmtime hello.wasm