Skip to content

Commit

Permalink
Merge branch 'main' into fix_jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzzabiyaka authored Jun 5, 2023
2 parents 28b423b + 5fb5119 commit b64a144
Show file tree
Hide file tree
Showing 108 changed files with 4,568 additions and 495 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/compilation_on_android_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:
- opened
- synchronize
paths:
- ".github/**"
- ".github/workflows/build_llvm_libraries.yml"
- ".github/workflows/compilation_on_android_ubuntu.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand All @@ -26,7 +27,8 @@ on:
- main
- "dev/**"
paths:
- ".github/**"
- ".github/workflows/build_llvm_libraries.yml"
- ".github/workflows/compilation_on_android_ubuntu.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/compilation_on_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:
- opened
- synchronize
paths:
- ".github/**"
- ".github/workflows/build_llvm_libraries.yml"
- ".github/workflows/compilation_on_macos.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand All @@ -26,7 +27,8 @@ on:
- main
- "dev/**"
paths:
- ".github/**"
- ".github/workflows/build_llvm_libraries.yml"
- ".github/workflows/compilation_on_macos.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/compilation_on_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- opened
- synchronize
paths:
- ".github/**"
- ".github/workflows/compilation_on_nuttx.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand All @@ -26,7 +26,7 @@ on:
- main
- "dev/**"
paths:
- ".github/**"
- ".github/workflows/compilation_on_nuttx.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Install RISC-V Compilers
if: contains(matrix.nuttx_board_config, 'risc-v')
run: |
curl -L https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz > riscv.tar.gz
curl -L -k https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz > riscv.tar.gz
tar xvf riscv.tar.gz
echo "$PWD/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_PATH
Expand Down
210 changes: 71 additions & 139 deletions .github/workflows/compilation_on_sgx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:
- opened
- synchronize
paths:
- ".github/**"
- ".github/workflows/build_llvm_libraries.yml"
- ".github/workflows/compilation_on_sgx.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand All @@ -26,7 +27,8 @@ on:
- main
- "dev/**"
paths:
- ".github/**"
- ".github/workflows/build_llvm_libraries.yml"
- ".github/workflows/compilation_on_sgx.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand All @@ -49,6 +51,7 @@ 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"
FAST_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=1"
LLVM_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_EAGER_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"

Expand All @@ -68,6 +71,7 @@ jobs:
$AOT_BUILD_OPTIONS,
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
$FAST_JIT_BUILD_OPTIONS,
# Running modes unsupported
#$LLVM_LAZY_JIT_BUILD_OPTIONS,
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
Expand Down Expand Up @@ -125,69 +129,24 @@ jobs:
mkdir build && cd build
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
cmake --build . --config Release --parallel 4
cd ../enclave-sample
make
working-directory: product-mini/platforms/${{ matrix.platform }}

build_wamrc:
needs: [build_llvm_libraries]
run_samples_file:
needs: [build_iwasm, build_llvm_libraries]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
llvm_cache_key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
steps:
- name: install SGX SDK and necessary libraries
run: |
mkdir -p /opt/intel
cd /opt/intel
wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
sudo apt update
sudo apt install -y libsgx-launch libsgx-urts
source /opt/intel/sgxsdk/environment
- name: checkout
uses: actions/checkout@v3

- name: Get LLVM libraries
id: retrieve_llvm_libs
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ${{ matrix.llvm_cache_key }}

- name: Quit if cache miss
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
run: echo "::error::can not get prebuilt llvm libraries" && exit 1

- name: Build wamrc
run: |
mkdir build && cd build
cmake ..
cmake --build . --config Release --parallel 4
working-directory: wamr-compiler

build_samples_wasm_c_api:
needs: [build_iwasm]
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options: [
iwasm_make_options_run_mode: [
# Running modes supported
$AOT_BUILD_OPTIONS,
$CLASSIC_INTERP_BUILD_OPTIONS,
$FAST_INTERP_BUILD_OPTIONS,
$FAST_JIT_BUILD_OPTIONS,
# Running modes unsupported
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
#$LLVM_LAZY_JIT_BUILD_OPTIONS,
#$AOT_BUILD_OPTIONS,
#$LLVM_EAGER_JIT_BUILD_OPTIONS,
]
os: [ubuntu-20.04]
wasi_sdk_release:
Expand All @@ -198,51 +157,15 @@ jobs:
[
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz",
]
steps:
- name: checkout
uses: actions/checkout@v3

- name: download and install wabt
run: |
cd /opt
sudo wget ${{ matrix.wabt_release }}
sudo tar -xzf wabt-1.0.31-*.tar.gz
sudo mv wabt-1.0.31 wabt
- name: install SGX SDK and necessary libraries
run: |
mkdir -p /opt/intel
cd /opt/intel
wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
sudo apt update
sudo apt install -y libsgx-launch libsgx-urts
source /opt/intel/sgxsdk/environment
- name: Build Sample [wasm-c-api]
run: |
cmake -S . -B build ${{ matrix.make_options }}
cmake --build build --config Release --parallel 4
ctest --test-dir build
working-directory: samples/wasm-c-api

build_samples_others:
needs: [build_iwasm]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
wasi_sdk_release:
[
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz",
]
wabt_release:
[
"https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz",
iwasm_make_options_feature: [
# Features to be tested: IPFS
"-DWAMR_BUILD_SGX_IPFS=1",
]
platform: [linux-sgx]
include:
- os: ubuntu-20.04
llvm_cache_key: ${{ needs.build_llvm_libraries.outputs.cache_key }}

steps:
- name: checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -288,76 +211,85 @@ jobs:
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
sudo apt update
sudo apt install -y libsgx-launch libsgx-urts
source /opt/intel/sgxsdk/environment
- name: Build Sample [basic]
run: |
cd samples/basic
./build.sh
./run.sh
- name: Build Sample [file]
- name: Build iwasm for testing samples
run: |
cd samples/file
mkdir build && cd build
cmake ..
cmake .. ${{ matrix.iwasm_make_options_run_mode }} ${{ matrix.iwasm_make_options_feature }}
cmake --build . --config Release --parallel 4
./src/iwasm -f wasm-app/file.wasm -d .
cd ../enclave-sample
make
working-directory: product-mini/platforms/${{ matrix.platform }}

- name: Build Sample [multi-thread]
run: |
cd samples/multi-thread
mkdir build && cd build
cmake ..
cmake --build . --config Release --parallel 4
./iwasm wasm-apps/test.wasm
- name: Get LLVM libraries
if: matrix.iwasm_make_options_run_mode == '$AOT_BUILD_OPTIONS'
id: retrieve_llvm_libs
uses: actions/cache@v3
with:
path: |
./core/deps/llvm/build/bin
./core/deps/llvm/build/include
./core/deps/llvm/build/lib
./core/deps/llvm/build/libexec
./core/deps/llvm/build/share
key: ${{ matrix.llvm_cache_key }}
fail-on-cache-miss: true

- name: Build Sample [multi-module]
- name: Build wamrc only for testing samples in aot mode
if: matrix.iwasm_make_options_run_mode == '$AOT_BUILD_OPTIONS'
run: |
cd samples/multi-module
mkdir build && cd build
cmake ..
cmake --build . --config Release --parallel 4
./multi_module
cp wamrc `pwd`/../../product-mini/platforms/${{ matrix.platform }}/enclave-sample
working-directory: wamr-compiler

- name: Build Sample [spawn-thread]
- name: Build Sample [file]
run: |
cd samples/spawn-thread
cd samples/file
mkdir build && cd build
cmake ..
cmake --build . --config Release --parallel 4
./spawn_thread
cp wasm-app/file.wasm `pwd`/../../../product-mini/platforms/${{ matrix.platform }}/enclave-sample
- name: Build Sample [ref-types]
- name: Test Sample [file] in non-aot mode
if: matrix.iwasm_make_options_run_mode != '$AOT_BUILD_OPTIONS'
run: |
cd samples/ref-types
mkdir build && cd build
cmake ..
cmake --build . --config Release --parallel 4
./hello
source /opt/intel/sgxsdk/environment
./iwasm --dir=. file.wasm
working-directory: product-mini/platforms/${{ matrix.platform }}/enclave-sample

- name: Build Sample [wasi-threads]
- name: Test Sample [file] in aot mode
if: matrix.iwasm_make_options_run_mode == '$AOT_BUILD_OPTIONS'
run: |
cd samples/wasi-threads
mkdir build && cd build
cmake -DWASI_SYSROOT=`pwd`/../../../core/deps/wasi-libc/sysroot ..
cmake --build . --config Release --parallel 4
./iwasm wasm-apps/no_pthread.wasm
source /opt/intel/sgxsdk/environment
./wamrc -sgx -o file.aot file.wasm
./iwasm --dir=. file.aot
working-directory: product-mini/platforms/${{ matrix.platform }}/enclave-sample

spec_test_default:
needs: [build_iwasm, build_llvm_libraries, build_wamrc]
needs: [build_iwasm, build_llvm_libraries]
runs-on: ubuntu-20.04
strategy:
matrix:
running_mode: ["classic-interp", "fast-interp", "aot"]
test_option: ["-x -p -s spec -b -P", "-x -p -s spec -S -b -P"]
running_mode: ["classic-interp", "fast-interp", "aot", "fast-jit"]
test_option: ["-x -p -s spec -b -P", "-x -p -s spec -S -b -P", "-x -p -s spec -X -b -P"]
llvm_cache_key: ["${{ needs.build_llvm_libraries.outputs.cache_key }}"]
# classic-interp and fast-interp don't support simd
exclude:
# classic-interp, fast-interp and fast-jit don't support simd
- running_mode: "classic-interp"
test_option: "-x -p -s spec -S -b -P"
- running_mode: "fast-interp"
test_option: "-x -p -s spec -S -b -P"
- running_mode: "fast-jit"
test_option: "-x -p -s spec -S -b -P"
# classic-interp, fast-interp and fast jit don't support XIP
- running_mode: "classic-interp"
test_option: "-x -p -s spec -X -b -P"
- running_mode: "fast-interp"
test_option: "-x -p -s spec -X -b -P"
- running_mode: "fast-jit"
test_option: "-x -p -s spec -X -b -P"

steps:
- name: checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compilation_on_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- opened
- synchronize
paths:
- ".github/**"
- ".github/workflows/compilation_on_windows.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand All @@ -26,7 +26,7 @@ on:
- main
- "dev/**"
paths:
- ".github/**"
- ".github/workflows/compilation_on_windows.yml"
- "build-scripts/**"
- "core/**"
- "!core/deps/**"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spec_test_on_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install RISC-V Compilers
if: contains(matrix.nuttx_board_config, 'risc-v')
run: |
curl -L https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz > riscv.tar.gz
curl -L -k https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz > riscv.tar.gz
tar xvf riscv.tar.gz
echo "$PWD/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_PATH
Expand Down
Loading

0 comments on commit b64a144

Please sign in to comment.