mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2024-11-26 15:32:05 +00:00
edb184f709
Remove unnecessary functions and implement more APIs: - wasm_##name##same - wasm##name##as_ref - wasm_ref_as##name## - wasm_ref_delete - wasm_module_validate - wasm_table_get/set/size - wasm_memory_size - wasm_config_new - wasm_foreign_new And add more wasm-c-api samples, update the related documen, add more CI rules. Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
227 lines
6.3 KiB
YAML
227 lines
6.3 KiB
YAML
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
name: Linux
|
|
|
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
# events but only for the main branch
|
|
on:
|
|
# triggers on every branch
|
|
push:
|
|
paths-ignore:
|
|
- 'doc/**'
|
|
# triggers on every PR
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'doc/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-18.04, ubuntu-20.04]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build iwasm [default]
|
|
run: |
|
|
cd product-mini/platforms/linux
|
|
mkdir build && cd build
|
|
cmake ..
|
|
make -j $(nproc)
|
|
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 -j $(nproc)
|
|
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 -j $(nproc)
|
|
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 -j $(nproc)
|
|
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 -j $(nproc)
|
|
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 -j $(nproc)
|
|
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 -j $(nproc)
|
|
cd .. && rm -rf build
|
|
- name: Build iwasm [tail call]
|
|
run: |
|
|
cd product-mini/platforms/linux
|
|
mkdir build && cd build
|
|
cmake .. -DWAMR_BUILD_TAIL_CALL=1
|
|
make -j $(nproc)
|
|
cd .. && rm -rf build
|
|
- name: Build iwasm [custom name section]
|
|
run: |
|
|
cd product-mini/platforms/linux
|
|
mkdir build && cd build
|
|
cmake .. -DWAMR_BUILD_CUSTOM_NAME_SECTION=1
|
|
make -j $(nproc)
|
|
cd .. && rm -rf build
|
|
- name: Build iwasm [disable hardware boundary check]
|
|
run: |
|
|
cd product-mini/platforms/linux
|
|
mkdir build && cd build
|
|
cmake .. -DWAMR_DISABLE_HW_BOUND_CHECK=1
|
|
make -j $(nproc)
|
|
cd .. && rm -rf build
|
|
- name: Build iwasm [reference types]
|
|
run: |
|
|
cd product-mini/platforms/linux
|
|
mkdir build && cd build
|
|
cmake .. -DWAMR_BUILD_REF_TYPES=1
|
|
make -j $(nproc)
|
|
cd .. && rm -rf build
|
|
- name: Build iwasm [128-bit SIMD]
|
|
run: |
|
|
cd product-mini/platforms/linux
|
|
mkdir build && cd build
|
|
cmake .. -DWAMR_BUILD_SIMD=1
|
|
make -j $(nproc)
|
|
cd .. && rm -rf build
|
|
- name: Cache LLVM libraries
|
|
uses: actions/cache@v2
|
|
id: cache_llvm
|
|
env:
|
|
cache-name: llvm_libraries
|
|
with:
|
|
path: ./core/deps/llvm
|
|
key: ${{ runner.os }}-build-${{env.cache-name}}
|
|
restore-keys: ${{ runner.os }}-build-${{env.cache-name}}
|
|
- name: Build llvm and clang from source
|
|
if: steps.cache_llvm.outputs.cache-hit != 'true'
|
|
run: |
|
|
cd wamr-compiler
|
|
./build_llvm.sh
|
|
- name: Build wamrc
|
|
run: |
|
|
cd wamr-compiler
|
|
mkdir build && cd build
|
|
cmake ..
|
|
make -j $(nproc)
|
|
cd ..
|
|
- name: download and install wasi-sdk
|
|
run: |
|
|
cd /opt
|
|
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
|
|
tar -xzf wasi-sdk-12.0-linux.tar.gz
|
|
mv wasi-sdk-12.0 wasi-sdk
|
|
rm wasi-sdk-12.0-linux.tar.gz
|
|
- name: download and install wabt
|
|
run: |
|
|
cd /opt
|
|
wget https://github.com/WebAssembly/wabt/releases/download/1.0.23/wabt-1.0.23-ubuntu.tar.gz
|
|
tar -xzf wabt-1.0.23-ubuntu.tar.gz
|
|
mv wabt-1.0.23 wabt
|
|
rm wabt-1.0.23-ubuntu.tar.gz
|
|
- name: Build Sample [wasm-c-api]
|
|
run: |
|
|
cd samples/wasm-c-api
|
|
mkdir build && cd build
|
|
cmake ..
|
|
make -j $(nproc)
|
|
./callback
|
|
./callback_chain
|
|
./global
|
|
./hello
|
|
./hostref
|
|
./memory
|
|
./reflect
|
|
./table
|
|
./trap
|
|
cd .. && rm -r build
|
|
- name: Build Sample [wasm-c-api] [Jit]
|
|
run: |
|
|
cd samples/wasm-c-api
|
|
mkdir build && cd build
|
|
cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1 ..
|
|
make -j $(nproc)
|
|
./callback
|
|
./callback_chain
|
|
./global
|
|
./hello
|
|
./hostref
|
|
./memory
|
|
./reflect
|
|
./table
|
|
./trap
|
|
cd .. && rm -r build
|
|
- name: Build Sample [wasm-c-api] [Aot]
|
|
run: |
|
|
cd samples/wasm-c-api
|
|
mkdir build && cd build
|
|
cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=1 ..
|
|
make -j $(nproc)
|
|
./callback
|
|
./callback_chain
|
|
./global
|
|
./hello
|
|
./hostref
|
|
./memory
|
|
./reflect
|
|
./table
|
|
./trap
|
|
cd .. && rm -r build
|
|
- 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 -j $(nproc)
|
|
./iwasm wasm-apps/test.wasm
|
|
- name: Build Sample [multi-module]
|
|
run: |
|
|
cd samples/multi-module
|
|
mkdir build && cd build
|
|
cmake ..
|
|
make -j $(nproc)
|
|
./multi_module
|
|
- name: Build Sample [spawn-thread]
|
|
run: |
|
|
cd samples/spawn-thread
|
|
mkdir build && cd build
|
|
cmake ..
|
|
make -j $(nproc)
|
|
./spawn_thread
|
|
- name: Build Sample [ref-types]
|
|
run: |
|
|
cd samples/ref-types
|
|
mkdir build && cd build
|
|
cmake ..
|
|
make -j $(nproc)
|
|
./hello
|