diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 372bce8..ac0c709 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,12 @@ jobs: cd erlang rebar3 compile rebar3 eunit + - name: build-test-golang + run: | + cd go + go build -o ruapu-go + ./ruapu-go + macos: runs-on: macos-latest @@ -79,6 +85,11 @@ jobs: cd rust cargo build --verbose cargo test --verbose + - name: build-test-golang + run: | + cd go + go build -o ruapu-go + ./ruapu-go macos-arm64: runs-on: macos-14 @@ -103,6 +114,14 @@ jobs: cd rust cargo build --verbose cargo test --verbose + - uses: actions/setup-go@v2 + with: + go-version: 1.21.x + - name: build-test-golang + run: | + cd go + go build -o ruapu-go + ./ruapu-go windows: runs-on: windows-latest @@ -142,6 +161,11 @@ jobs: cd erlang rebar3 compile rebar3 eunit + - name: build-test-golang + run: | + cd go + go build -o ruapu-go.exe + ./ruapu-go.exe qemu: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 993cac8..be36c1a 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,46 @@ end program main +### ruapu with Golang + +
+ +Compile ruapu library + +```shell +cd go +go build -o ruapu-go +``` + + | ++ +Use ruapu in Golang + +```go +package main + +import ( + "fmt" + "ruapu-go/ruapu" + "strconv" +) + +func main() { + ruapu.Init() + avx2Status := ruapu.Supports("avx2") + fmt.Println("avx2:" + strconv.Itoa(avx2Status)) + rua := ruapu.Rua() + fmt.Println(rua) +} +``` + + |