Skip to content

[CI] Update the examples to use v0.13.0. #93

[CI] Update the examples to use v0.13.0.

[CI] Update the examples to use v0.13.0. #93

Workflow file for this run

name: examples
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'info'
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build_aot:
runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.19.x', '1.20.x' ]
name: Run WasmEdge-go-examples in AOT mode with Go ${{ matrix.go }}
steps:
- name: Install apt-get packages
run: |
sudo ACCEPT_EULA=Y apt-get update
sudo ACCEPT_EULA=Y apt-get upgrade
sudo apt-get install wget git curl software-properties-common
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check go version
run: go version
- name: Install WasmEdge
run: |
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -p /usr/local --plugins wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image -v 0.13.0
- name: Install the examples
run: |
git clone https://github.com/second-state/wasmedge-go-examples
- name: go_WasmAOT
run: |
cd wasmedge-go-examples/go_WasmAOT
go get .
go build
- name: go_ThreadsMandelbrot
run: |
cd wasmedge-go-examples/go_ThreadsMandelbrot
go get .
go build threads.go
wasmedgec --enable-threads mandelbrot.wasm out.wasm
./threads out.wasm 4
- name: go_ReadFile
run: |
cd wasmedge-go-examples/go_ReadFile
go get .
go build
wasmedgec rust_readfile.wasm out.wasm
./read_file out.wasm file.txt
- name: go_ExternRef
run: |
cd wasmedge-go-examples/go_ExternRef
go get .
go build
wasmedgec funcs.wasm out.wasm
./externref out.wasm
- name: go_AccessMemory
run: |
cd wasmedge-go-examples/go_AccessMemory
go get .
go build run.go
wasmedgec rust_access_memory_lib.wasm out.wasm
./run out.wasm
- name: go_AccessMemoryTinyGo
run: |
cd wasmedge-go-examples/go_AccessMemoryTinyGo
go get .
go build run.go
wasmedgec fib.wasm out.wasm
./run out.wasm
- name: go_MemoryGreet
run: |
cd wasmedge-go-examples/go_MemoryGreet
go get .
go build greet_memory.go
wasmedgec rust_memory_greet_lib.wasm out.wasm
./greet_memory out.wasm
- name: go_MemoryGreetTinyGo
run: |
cd wasmedge-go-examples/go_MemoryGreetTinyGo
go get .
go build greet_memory.go
wasmedgec greet.wasm out.wasm
./greet_memory out.wasm
- name: go_BindgenFuncs
run: |
cd wasmedge-go-examples/go_BindgenFuncs
go get .
go build
wasmedgec rust_bindgen_funcs_lib.wasm out.wasm
./bindgen_funcs out.wasm
- name: go_BindgenKmeans
run: |
cd wasmedge-go-examples/go_BindgenKmeans
go get .
go build
wasmedgec rust_bindgen_kmeans_lib.wasm out.wasm
./bindgen_kmeans out.wasm
- name: go_BindgenWasi
run: |
cd wasmedge-go-examples/go_BindgenWasi
go get .
go build
wasmedgec rust_bindgen_wasi_lib.wasm out.wasm
./bindgen_wasi out.wasm
- name: go_Mobilenet
run: |
cd wasmedge-go-examples/go_Mobilenet
go get .
go build
wasmedgec rust_mobilenet_lib.wasm out.wasm
./mobilenet out.wasm grace_hopper.jpg
- name: go_MobilenetBirds
run: |
cd wasmedge-go-examples/go_MobilenetBirds
go get .
go build
wasmedgec rust_mobilenet_birds_lib.wasm out.wasm
./mobilenet_birds out.wasm PurpleGallinule.jpg
- name: go_MobilenetFood
run: |
cd wasmedge-go-examples/go_MobilenetFood
go get .
go build
wasmedgec rust_mobilenet_food_lib.wasm out.wasm
./mobilenet_food out.wasm food.jpg
- name: go_MobilenetInsects
run: |
cd wasmedge-go-examples/go_MobilenetInsects
go get .
go build
wasmedgec rust_mobilenet_insects_lib.wasm out.wasm
./mobilenet_insects out.wasm ladybug.jpg
- name: go_MobilenetPlants
run: |
cd wasmedge-go-examples/go_MobilenetPlants
go get .
go build
wasmedgec rust_mobilenet_plants_lib.wasm out.wasm
./mobilenet_plants out.wasm sunflower.jpg
- name: go_mtcnn
run: |
cd wasmedge-go-examples/go_mtcnn
go get .
go build
wasmedgec rust_mtcnn.wasm out.wasm
./mtcnn out.wasm mtcnn.pb solvay.jpg out.jpg
build_interpreter:
runs-on: ubuntu-20.04
needs: build_aot
strategy:
matrix:
go: [ '1.19.x', '1.20.x' ]
name: Run WasmEdge-go-examples in interpreter mode with Go ${{ matrix.go }}
steps:
- name: Install apt-get packages
run: |
sudo ACCEPT_EULA=Y apt-get update
sudo ACCEPT_EULA=Y apt-get upgrade
sudo apt-get install wget git curl software-properties-common
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check go version
run: go version
- name: Install WasmEdge
run: |
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -p /usr/local --plugins wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image -v 0.13.0
- name: Install the examples
run: |
git clone https://github.com/second-state/wasmedge-go-examples
- name: go_PrintFibonacci
run: |
cd wasmedge-go-examples/go_PrintFibonacci
go get .
go build
./print_fibonacci
- name: go_WasmAOT
run: |
cd wasmedge-go-examples/go_WasmAOT
go get .
go build
./wasmAOT fibonacci.wasm out.wasm
- name: go_ThreadsMandelbrot
run: |
cd wasmedge-go-examples/go_ThreadsMandelbrot
go get .
go build threads.go
./threads mandelbrot.wasm 4
- name: go_ReadFile
run: |
cd wasmedge-go-examples/go_ReadFile
go get .
go build
./read_file rust_readfile.wasm file.txt
- name: go_ExternRef
run: |
cd wasmedge-go-examples/go_ExternRef
go get .
go build
./externref funcs.wasm
- name: go_AccessMemory
run: |
cd wasmedge-go-examples/go_AccessMemory
go get .
go build run.go
./run rust_access_memory_lib.wasm
- name: go_AccessMemoryTinyGo
run: |
cd wasmedge-go-examples/go_AccessMemoryTinyGo
go get .
go build run.go
./run fib.wasm
- name: go_MemoryGreet
run: |
cd wasmedge-go-examples/go_MemoryGreet
go get .
go build greet_memory.go
./greet_memory rust_memory_greet_lib.wasm
- name: go_MemoryGreetTinyGo
run: |
cd wasmedge-go-examples/go_MemoryGreetTinyGo
go get .
go build greet_memory.go
./greet_memory greet.wasm
- name: go_BindgenFuncs
run: |
cd wasmedge-go-examples/go_BindgenFuncs
go get .
go build
./bindgen_funcs rust_bindgen_funcs_lib.wasm
- name: go_BindgenKmeans
run: |
cd wasmedge-go-examples/go_BindgenKmeans
go get .
go build
./bindgen_kmeans rust_bindgen_kmeans_lib.wasm
- name: go_BindgenWasi
run: |
cd wasmedge-go-examples/go_BindgenWasi
go get .
go build
./bindgen_wasi rust_bindgen_wasi_lib.wasm
- name: go_Mobilenet
run: |
cd wasmedge-go-examples/go_Mobilenet
go get .
go build
./mobilenet rust_mobilenet_lib.wasm grace_hopper.jpg
- name: go_MobilenetBirds
run: |
cd wasmedge-go-examples/go_MobilenetBirds
go get .
go build
./mobilenet_birds rust_mobilenet_birds_lib.wasm PurpleGallinule.jpg
- name: go_MobilenetFood
run: |
cd wasmedge-go-examples/go_MobilenetFood
go get .
go build
./mobilenet_food rust_mobilenet_food_lib.wasm food.jpg
- name: go_MobilenetInsects
run: |
cd wasmedge-go-examples/go_MobilenetInsects
go get .
go build
./mobilenet_insects rust_mobilenet_insects_lib.wasm ladybug.jpg
- name: go_MobilenetPlants
run: |
cd wasmedge-go-examples/go_MobilenetPlants
go get .
go build
./mobilenet_plants rust_mobilenet_plants_lib.wasm sunflower.jpg
- name: go_mtcnn
run: |
cd wasmedge-go-examples/go_mtcnn
go get .
go build
./mtcnn rust_mtcnn.wasm mtcnn.pb solvay.jpg out.jpg