From 21850aeb0a8a30d01575d9c4d0a8307a73a7d1e3 Mon Sep 17 00:00:00 2001 From: Xu Jun <693788454@qq.com> Date: Sun, 20 Sep 2020 13:16:13 +0800 Subject: [PATCH] add more build option and samples in CI (#394) * Update linux.yml * Create mac.yml --- .github/workflows/linux.yml | 80 +++++++++++++++++++++++++++++++++++-- .github/workflows/mac.yml | 78 ++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/mac.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6dc2b1fdb..1f941b68c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -18,14 +18,62 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build iwasm + - name: Build iwasm [default] run: | cd product-mini/platforms/linux mkdir build && cd build cmake .. make - - - name: Build wasm-c-api + cd .. && rm -rf build + - name: Build iwasm [Classic interp] + run: | + cd product-mini/platforms/linux + mkdir build && cd build + cmake .. -DWAMR_BUILD_FAST_INTERP=0 + make + cd .. && rm -rf build + - name: Build iwasm [Multi module] + run: | + cd product-mini/platforms/linux + mkdir build && cd build + cmake .. -DWAMR_BUILD_MULTI_MODULE=1 + make + cd .. && rm -rf build + - name: Build iwasm [lib-pthread] + run: | + cd product-mini/platforms/linux + mkdir build && cd build + cmake .. -DWAMR_BUILD_LIB_PTHREAD=1 + make + cd .. && rm -rf build + - name: Build iwasm [aot only] + run: | + cd product-mini/platforms/linux + mkdir build && cd build + cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0 + make + cd .. && rm -rf build + - name: Build iwasm [interp only] + run: | + cd product-mini/platforms/linux + mkdir build && cd build + cmake .. -DWAMR_BUILD_AOT=0 + make + cd .. && rm -rf build + - name: Build iwasm [memory profiling] + run: | + cd product-mini/platforms/linux + mkdir build && cd build + cmake .. -DWAMR_BUILD_MEMORY_PROFILING=1 + make + cd .. && rm -rf build + - name: download wasi-sdk + run: | + cd /opt + wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-8/wasi-sdk-8.0-linux.tar.gz + tar -xzf wasi-sdk-8.0-linux.tar.gz + mv wasi-sdk-8.0 wasi-sdk + - name: Build Sample [wasm-c-api] run: | cd samples/wasm-c-api mkdir build && cd build @@ -34,3 +82,29 @@ jobs: ./hello ./global ./callback + - name: Build Sample [basic] + run: | + cd samples/basic + ./build.sh + ./run.sh + - name: Build Sample [multi-thread] + run: | + cd samples/multi-thread + mkdir build && cd build + cmake .. + make + ./iwasm wasm-apps/test.wasm + - name: Build Sample [multi-module] + run: | + cd samples/multi-module + mkdir build && cd build + cmake .. + make + ./multi_module + - name: Build Sample [spawn-thread] + run: | + cd samples/spawn-thread + mkdir build && cd build + cmake .. + make + ./spawn_thread diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 000000000..134f4c1ed --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,78 @@ +name: Mac + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + steps: + - uses: actions/checkout@v2 + + - name: Build iwasm [default] + run: | + cd product-mini/platforms/darwin + mkdir build && cd build + cmake .. + make + cd .. && rm -rf build + - name: Build iwasm [Classic interp] + run: | + cd product-mini/platforms/darwin + mkdir build && cd build + cmake .. -DWAMR_BUILD_FAST_INTERP=0 + make + cd .. && rm -rf build + - name: Build iwasm [Multi module] + run: | + cd product-mini/platforms/darwin + mkdir build && cd build + cmake .. -DWAMR_BUILD_MULTI_MODULE=1 + make + cd .. && rm -rf build + - name: Build iwasm [lib-pthread] + run: | + cd product-mini/platforms/darwin + mkdir build && cd build + cmake .. -DWAMR_BUILD_LIB_PTHREAD=1 + make + cd .. && rm -rf build + - name: Build iwasm [aot only] + run: | + cd product-mini/platforms/darwin + mkdir build && cd build + cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0 + make + cd .. && rm -rf build + - name: Build iwasm [interp only] + run: | + cd product-mini/platforms/darwin + mkdir build && cd build + cmake .. -DWAMR_BUILD_AOT=0 + make + cd .. && rm -rf build + - name: Build iwasm [memory profiling] + run: | + cd product-mini/platforms/darwin + mkdir build && cd build + cmake .. -DWAMR_BUILD_MEMORY_PROFILING=1 + make + cd .. && rm -rf build + - name: Build Sample [wasm-c-api] + run: | + cd samples/wasm-c-api + mkdir build && cd build + cmake .. + make + ./hello + ./global + ./callback