Pr2 #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Actions | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
RUNNER: tools/run-tests.py | |
jobs: | |
check-tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ focal main universe" | |
sudo apt update | |
sudo apt install -y clang-format-10 | |
- name: Test | |
run: tools/check_tidy.py | |
build-on-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
brew update | |
brew install cmake ninja pkg-config | |
- name: Build x64 | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=x64 -DWALRUS_HOST=darwin -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/mac/x64 $BUILD_OPTIONS | |
ninja -Cout/mac/x64 | |
#- name: Run Tests | |
#run: | | |
#FIXME try-catch is unstable in macos build | |
#remove 2 test files due to stack overflow occurred by recursion calls in debug mode build by apple-clang | |
#rm $GITHUB_WORKSPACE/test/wasm-spec/core/call.wast | |
#rm $GITHUB_WORKSPACE/test/wasm-spec/core/call_indirect.wast | |
#$RUNNER --engine="$GITHUB_WORKSPACE/out/mac/x64/walrus" | |
build-by-clang: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
- name: Build x86 | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=x86 -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
CC=clang CXX=clang++ cmake -H. -Bout/clang/x86 $BUILD_OPTIONS | |
ninja -Cout/clang/x86 | |
- name: Build x64 | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=x64 -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
CC=clang CXX=clang++ cmake -H. -Bout/clang/x64 $BUILD_OPTIONS | |
ninja -Cout/clang/x64 | |
- name: Run Tests | |
run: | | |
# remove 2 test files due to stack overflow occurred by recursion calls in debug mode build by clang | |
rm $GITHUB_WORKSPACE/test/wasm-spec/core/call.wast | |
rm $GITHUB_WORKSPACE/test/wasm-spec/core/call_indirect.wast | |
$RUNNER --engine="$GITHUB_WORKSPACE/out/clang/x64/walrus" | |
build-test-on-x86: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
- name: Build x86 | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=x86 -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/linux/x86 $BUILD_OPTIONS | |
ninja -Cout/linux/x86 | |
- name: Run Tests | |
run: $RUNNER --engine="$GITHUB_WORKSPACE/out/linux/x86/walrus" | |
build-test-on-x64: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
- name: Build x64 | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=x64 -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/linux/x64 $BUILD_OPTIONS | |
ninja -Cout/linux/x64 | |
- name: Run Tests | |
run: $RUNNER --engine="$GITHUB_WORKSPACE/out/linux/x64/walrus" | |
test-on-windows-x86-x64: | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
arch: [x86, x64] | |
steps: | |
- name: Set git cllf config | |
run: | | |
git config --global core.autocrlf input | |
git config --global core.eol lf | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: lukka/get-cmake@latest | |
- uses: GuillaumeFalourd/[email protected] | |
with: | |
sdk-version: 20348 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install msvc redist package | |
run: | | |
(new-object System.Net.WebClient).DownloadFile('https://github.com/abbodi1406/vcredist/releases/download/v0.73.0/VisualCppRedist_AIO_x86_x64.exe','VisualCppRedist_AIO_x86_x64.exe') | |
.\VisualCppRedist_AIO_x86_x64.exe /y | |
- uses: ilammy/[email protected] | |
with: | |
arch: ${{ matrix.arch }} | |
sdk: "10.0.20348.0" | |
- name: Build ${{ matrix.arch }} Release | |
run: | | |
cp ./sljitNativeX86_common.c ./third_party/sljit/sljit_src/. | |
cp ./sljitLir.h ./third_party/sljit/sljit_src/. | |
cp ./sljitLir.c ./third_party/sljit/sljit_src/. | |
CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -Bout/ -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release | |
CMake --build out/ --config Release | |
- name: Run tests | |
run: | | |
python tools\run-tests.py --engine=%cd%\out\walrus.exe | |
shell: cmd | |
- if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 60 | |
build-test-performance: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
sudo pip install py-markdown-table | |
- name: Build x64 | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=x64 -DWALRUS_HOST=linux -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/linux/x64 $BUILD_OPTIONS | |
ninja -Cout/linux/x64 | |
- name: Run Tests | |
run: test/wasmBenchmarker/benchmark.py --engines $GITHUB_WORKSPACE/out/linux/x64/walrus --iterations 3 | |
built-test-wasm-c-api: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
- name: Build x64 | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=x64 -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=api_test -GNinja | |
run: | | |
cmake -H. -Bout/api_test/x64 $BUILD_OPTIONS | |
ninja -Cout/api_test/x64 | |
cp third_party/wasm-c-api/example/*.wasm out/api_test/x64/. | |
- name: Run Tests | |
working-directory: ./out/api_test/x64 | |
run: | | |
./wasm-c-api-callback | |
./wasm-c-api-global | |
./wasm-c-api-hello | |
./wasm-c-api-memory | |
./wasm-c-api-multi | |
./wasm-c-api-table |