Refactor CI rules: merge ubuntu/macos/android, enable spec test (#777)

Refactor CI rules:
- merge ubuntu/macos/android into one job file
- add job file to test spec cases
- add compilation for lazy jit, debug interpreter and debug aot
- add compilation for performance profile, dump call stack and mini-loader
- re-org llvm build script to build lldb

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-10-11 20:32:29 +08:00
committed by GitHub
parent 0be1f687af
commit 03494f9487
12 changed files with 768 additions and 458 deletions

View File

@ -0,0 +1,513 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: compilation on android, ubuntu-18.04, ubuntu-20.04, macos-latest
on:
# will be triggered on PR events
pull_request:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
# allow to be triggered manually
workflow_dispatch:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
AOT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
FAST_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
jobs:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
cancel_previous:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
# set different traffic lights based on the current repo and the running OS.
# according to light colors, the workflow will run different jobs
check_repo:
needs: cancel_previous
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
outputs:
traffic_light_on_ubuntu_1804: ${{ steps.do_check_on_ubuntu_1804.outputs.light }}
traffic_light_on_ubuntu_2004: ${{ steps.do_check_on_ubuntu_2004.outputs.light }}
traffic_light_on_macos_latest: ${{ steps.do_check_on_macos_latest.outputs.light }}
steps:
- name: do_check_on_ubuntu_1804
id: do_check_on_ubuntu_1804
if: ${{ matrix.os == 'ubuntu-18.04' }}
run: |
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
echo "::set-output name=light::green"
else
echo "::set-output name=light::red"
fi
- name: do_check_on_ubuntu_2004
id: do_check_on_ubuntu_2004
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
echo "::set-output name=light::green"
else
echo "::set-output name=light::green"
fi
- name: do_check_on_macos_latest
id: do_check_on_macos_latest
if: ${{ matrix.os == 'macos-latest' }}
run: |
if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
echo "::set-output name=light::green"
else
echo "::set-output name=light::red"
fi
build_llvm_libraries:
needs: check_repo
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
include:
- os: ubuntu-18.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v2
- name: Cache LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v2
with:
path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
restore-keys: ${{ matrix.os }}-${{env.LLVM_CACHE_SUFFIX }}
- name: Build llvm and clang from source on ubuntu
id: build_llvm_ubuntu
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os != 'macos-latest' }}
run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly --project clang lldb
working-directory: build-scripts
- name: Build llvm and clang from source on macos
id: build_llvm_macos
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' }}
run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly
working-directory: build-scripts
- name: package LLVM
if: ${{ matrix.light == 'green' && (steps.build_llvm_ubuntu.conclusion == 'success' || steps.build_llvm_macos.conclusion == 'success')}}
run: mv LLVM-13.0.0-*.tar.gz LLVM-13.0.0.tar.gz
working-directory: core/deps/llvm/build/
build_wamrc:
needs: [build_llvm_libraries, check_repo]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
include:
- os: ubuntu-18.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v2
with:
path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Extract the LLVM package
if: ${{ matrix.light == 'green' }}
run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: Build wamrc
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake ..
cmake --build . --config Release
working-directory: wamr-compiler
build_iwasm:
needs: [build_llvm_libraries, check_repo]
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options_run_mode: [
# Running mode
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
$JIT_BUILD_OPTIONS,
$LAZY_JIT_BUILD_OPTIONS,
$AOT_BUILD_OPTIONS,
]
make_options_feature: [
# Features
"-DWAMR_BUILD_CUSTOM_NAME_SECTION=1",
"-DWAMR_BUILD_DEBUG_AOT=1",
"-DWAMR_BUILD_DEBUG_INTERP=1",
"-DWAMR_BUILD_DUMP_CALL_STACK=1",
"-DWAMR_BUILD_LIB_PTHREAD=1",
"-DWAMR_BUILD_MINI_LOADER=1",
"-DWAMR_BUILD_MEMORY_PROFILING=1",
"-DWAMR_BUILD_MULTI_MODULE=1",
"-DWAMR_BUILD_PERF_PROFILING=1",
"-DWAMR_BUILD_REF_TYPES=1",
"-DWAMR_BUILD_SIMD=1",
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
]
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
platform: [android, linux, darwin]
exclude:
# uncompatiable os and platform
# ubuntu can not go with darwin
- os: ubuntu-18.04
platform: darwin
- os: ubuntu-20.04
platform: darwin
# macos can not go with android, linux
- os: macos-latest
platform: android
- os: macos-latest
platform: linux
# uncompatiable feature and platform
- os: macos-latest
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
- os: macos-latest
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
# uncompatiable mode and feature
# MULTI_MODULE only on INTERP mode
- make_options_run_mode: $JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
- make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
# SIMD only on JIT/AOT mode
- make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_SIMD=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_SIMD=1"
# DEBUG_INTERP only on CLASSIC INTERP mode
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
# DEBUG_AOT only on JIT/AOT mode
- make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
- make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
# TODO: DEBUG_AOT on JIT
- make_options_run_mode: $JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
- make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
# MINI_LOADER only on INTERP mode
- make_options_run_mode: $AOT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
- make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
include:
- os: ubuntu-18.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v2
with:
path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Extract the LLVM package
if: ${{ matrix.light == 'green' }}
run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: Build iwasm
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
cmake --build . --config Release
working-directory: product-mini/platforms/${{ matrix.platform }}
build_samples_wasm_c_api:
needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options: [
# Running mode
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
$JIT_BUILD_OPTIONS,
$LAZY_JIT_BUILD_OPTIONS,
$AOT_BUILD_OPTIONS,
]
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
include:
- os: ubuntu-18.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz
exclude:
# TODO: a .aot compatiable problem
- os: macos-latest
make_options: $JIT_BUILD_OPTIONS
- os: macos-latest
make_options: $AOT_BUILD_OPTIONS
- os: macos-latest
make_options: $LAZY_JIT_BUILD_OPTIONS
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v2
with:
path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Extract the LLVM package
if: ${{ matrix.light == 'green' }}
run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: download and install wabt
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
sudo tar -xzf wabt-1.0.24-*.tar.gz
sudo mv wabt-1.0.24 wabt
- name: Build wamrc
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake ..
cmake --build . --config Release
working-directory: wamr-compiler
- name: Build Sample [wasm-c-api]
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options }}
cmake --build . --config Release
./callback
./callback_chain
./global
./hello
./hostref
./memory
./reflect
./table
./trap
working-directory: samples/wasm-c-api
build_samples_others:
needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-18.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
- os: ubuntu-20.04
light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
- os: macos-latest
light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz
steps:
- name: light status
run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
- name: checkout
if: ${{ matrix.light == 'green' }}
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
if: ${{ matrix.light == 'green' }}
uses: actions/cache@v2
with:
path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Extract the LLVM package
if: ${{ matrix.light == 'green' }}
run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: download and install wasi-sdk
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wasi_sdk_release }}
sudo tar -xzf wasi-sdk-12.0-*.tar.gz
sudo mv wasi-sdk-12.0 wasi-sdk
- name: download and install wabt
if: ${{ matrix.light == 'green' }}
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
sudo tar -xzf wabt-1.0.24-*.tar.gz
sudo mv wabt-1.0.24 wabt
- name: Build wamrc
if: ${{ matrix.light == 'green' }}
run: |
mkdir build && cd build
cmake ..
cmake --build . --config Release
working-directory: wamr-compiler
- name: Build Sample [basic]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/basic
./build.sh
./run.sh
- name: Build Sample [multi-thread]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/multi-thread
mkdir build && cd build
cmake ..
cmake --build . --config Release
./iwasm wasm-apps/test.wasm
- name: Build Sample [multi-module]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/multi-module
mkdir build && cd build
cmake ..
cmake --build . --config Release
./multi_module
- name: Build Sample [spawn-thread]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/spawn-thread
mkdir build && cd build
cmake ..
cmake --build . --config Release
./spawn_thread
- name: Build Sample [ref-types]
if: ${{ matrix.light == 'green' }}
run: |
cd samples/ref-types
mkdir build && cd build
cmake ..
cmake --build . --config Release
./hello

View File

@ -0,0 +1,99 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: compilation on windows-latest
on:
# will be triggered on PR events
pull_request:
paths-ignore:
- "assembly-script/**"
- "ci/**"
- "doc/**"
- "test-tools/**"
# allow to be triggered manually
workflow_dispatch:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
cancel_previous:
runs-on: windows-latest
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
build:
needs: cancel_previous
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: clone uvwasi library
run: |
cd core/deps
git clone https://github.com/nodejs/uvwasi.git
- name: Build iwasm [default]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake ..
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [aot only]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [interp only]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_AOT=0
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [tail call]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_TAIL_CALL=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [custom name section]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_CUSTOM_NAME_SECTION=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [disable hardware boundary check]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_DISABLE_HW_BOUND_CHECK=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [reference types]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_REF_TYPES=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [128-bit SIMD]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_SIMD=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build

View File

@ -1,229 +0,0 @@
# 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_llvm_libraries:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Cache LLVM libraries
id: cache_llvm
uses: actions/cache@v2
env:
cache-name: llvm_libraries
with:
path: ./core/deps/llvm/build/LLVM-13.0.0-Linux.tar.gz
key: ${{ matrix.os }}-build-${{env.cache-name}}
restore-keys: ${{ matrix.os }}-build-${{env.cache-name}}
- name: Build llvm and clang from source
id: build_llvm
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: |
cd wamr-compiler
./build_llvm.sh
cd ../core/deps/llvm/build/
make package
build_wamrc:
needs: build_llvm_libraries
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v2
env:
cache-name: llvm_libraries
with:
path: ./core/deps/llvm/build/LLVM-13.0.0-Linux.tar.gz
key: ${{ matrix.os }}-build-${{env.cache-name}}
restore-keys: ${{ matrix.os }}-build-${{env.cache-name}}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: exit 1
- name: Extract the LLVM package
run: tar xf LLVM-13.0.0-Linux.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: Build wamrc
run: |
mkdir build && cd build
cmake .. && make -j $(nproc)
working-directory: wamr-compiler
- name: Upload Wamrc
uses: actions/upload-artifact@v2
with:
name: wamrc_bin-${{ matrix.os }}
path: ./wamr-compiler/build/wamrc
retention-days: 1
build_iwasm:
needs: build_llvm_libraries
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options: [
# Running mode
"-DWAMR_BUILD_INERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1",
"-DWAMR_BUILD_INERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0",
"-DWAMR_BUILD_INERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=0",
"-DWAMR_BUILD_INERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1",
# Features
"-DWAMR_BUILD_CUSTOM_NAME_SECTION=1",
"-DWAMR_BUILD_LIB_PTHREAD=1",
"-DWAMR_BUILD_MEMORY_PROFILING=1",
"-DWAMR_BUILD_MULTI_MODULE=1",
"-DWAMR_BUILD_REF_TYPES=1",
"-DWAMR_BUILD_SIMD=1",
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
]
os: [ubuntu-18.04, ubuntu-20.04]
platform: [linux, android]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v2
env:
cache-name: llvm_libraries
with:
path: ./core/deps/llvm/build/LLVM-13.0.0-Linux.tar.gz
key: ${{ matrix.os }}-build-${{env.cache-name}}
restore-keys: ${{ matrix.os }}-build-${{env.cache-name}}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: exit 1
- name: Extract the LLVM package
run: tar xf LLVM-13.0.0-Linux.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: Build iwasm
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options }} && make -j $(nproc)
cd .. && rm -rf build
working-directory: product-mini/platforms/${{ matrix.platform }}
build_samples:
needs: [build_llvm_libraries, build_wamrc]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
make_options: [
# Running mode
"-DWAMR_BUILD_INERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1",
"-DWAMR_BUILD_INERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0",
"-DWAMR_BUILD_INERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=0",
"-DWAMR_BUILD_INERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1",
]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v2
env:
cache-name: llvm_libraries
with:
path: ./core/deps/llvm/build/LLVM-13.0.0-Linux.tar.gz
key: ${{ matrix.os }}-build-${{env.cache-name}}
restore-keys: ${{ matrix.os }}-build-${{env.cache-name}}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: exit 1
- name: Extract the LLVM package
run: tar xf LLVM-13.0.0-Linux.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: Download Wamrc
uses: actions/download-artifact@v2
with:
name: wamrc_bin-${{ matrix.os }}
path: ./wamr-compiler/build
- name: Give execution rights
run: chmod a+x ./wamr-compiler/build/wamrc
- 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 .. ${{ matrix.make_options }}
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

View File

@ -1,128 +0,0 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Mac
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main 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 -j $(nproc)
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 -j $(nproc)
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 -j $(nproc)
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 -j $(nproc)
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 -j $(nproc)
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 -j $(nproc)
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 -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [tail call]
run: |
cd product-mini/platforms/darwin
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/darwin
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/darwin
mkdir build && cd build
cmake .. -DWAMR_DISABLE_HW_BOUND_CHECK=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [ref types]
run: |
cd product-mini/platforms/darwin
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/darwin
mkdir build && cd build
cmake .. -DWAMR_BUILD_SIMD=1
make -j $(nproc)
cd .. && rm -rf build
- name: download and install wabt
run: |
cd /opt
sudo wget https://github.com/WebAssembly/wabt/releases/download/1.0.19/wabt-1.0.19-macos.tar.gz
sudo tar -xzf wabt-1.0.19-macos.tar.gz
sudo mv wabt-1.0.19 wabt
- name: Build Sample [wasm-c-api]
run: |
cd samples/wasm-c-api
mkdir build && cd build
cmake ..
make
./callback
./callback_chain
./global
./hello
./hostref
./memory
./reflect
./table
./trap

97
.github/workflows/spec_test.yml vendored Normal file
View File

@ -0,0 +1,97 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Spec tests on non-windows
on:
# will be triggered on PR events
pull_request:
paths:
- "core/iwasm/**"
# allow to be triggered manually
workflow_dispatch:
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
LLVM_CACHE_SUFFIX: "build-llvm_libraries"
jobs:
cancel_previous:
runs-on: ubuntu-20.04
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
build_llvm_libraries:
needs: cancel_previous
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: Cache LLVM libraries
id: cache_llvm
uses: actions/cache@v2
with:
path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Build llvm and clang from source
id: build_llvm
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly
working-directory: build-scripts
- name: package LLVM
if: ${{ steps.build_llvm.conclusion == 'success' }}
run: mv LLVM-13.0.0-*.tar.gz LLVM-13.0.0.tar.gz
working-directory: core/deps/llvm/build/
spec_test_on_ubuntu_2004:
needs: build_llvm_libraries
runs-on: ubuntu-20.04
strategy:
matrix:
test_option: [
# DEFAULT
"-s spec",
# SIMD
"-s spec -S",
# THREAD
"-s spec -p",
# MULTI_MODULES
"-s spec -M",
]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v2
with:
path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- name: Extract the LLVM package
run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: install Ninja
run: sudo apt install -y ninja-build
- name: run spec tests
run: ./test_wamr.sh ${{ matrix.test_option }}
working-directory: ./tests/wamr-test-suites

View File

@ -1,84 +0,0 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Windows
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v2
- name: clone uvwasi library
run: |
cd core/deps
git clone https://github.com/nodejs/uvwasi.git
- name: Build iwasm [default]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake ..
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [aot only]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [interp only]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_AOT=0
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [tail call]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_TAIL_CALL=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [custom name section]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_CUSTOM_NAME_SECTION=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [disable hardware boundary check]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_DISABLE_HW_BOUND_CHECK=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [reference types]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_REF_TYPES=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build
- name: Build iwasm [128-bit SIMD]
run: |
cd product-mini/platforms/windows
mkdir build && cd build
cmake .. -DWAMR_BUILD_SIMD=1
cmake --build . --config Release --parallel 4
cd .. && rm -force -r build