Improve CI #1272
Workflow file for this run
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@v4 | |
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-13 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
brew update | |
brew install cmake ninja pkg-config | |
- name: Build x64 | |
env: | |
BUILD_OPTIONS: -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/mac $BUILD_OPTIONS | |
ninja -Cout/mac | |
- 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/walrus" | |
build-on-macos-arm64: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
brew update | |
brew install cmake ninja | |
- name: Build arm64 | |
env: | |
BUILD_OPTIONS: -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/mac $BUILD_OPTIONS | |
ninja -Cout/mac | |
- 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/walrus" | |
build-by-clang: | |
strategy: | |
matrix: | |
arch: | |
- x86 | |
- x64 | |
compile: | |
- name: Build | |
options: "" | |
dir: clang | |
tests: "" | |
- name: Pure build | |
options: -DWALRUS_WASI=OFF | |
dir: "pure" | |
tests: "basic-tests wasm-test-core jit" | |
switch: | |
- --jit | |
- --jit-no-reg-alloc | |
- "" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
- name: ${{ matrix.compile.name }} ${{ matrix.arch }} | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=${{ matrix.arch }} -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell ${{ matrix.compile.options }} -GNinja | |
run: | | |
CC=clang CXX=clang++ cmake -H. -Bout/${{ matrix.compile.dir }}/${{ matrix.arch }} $BUILD_OPTIONS | |
ninja -Cout/${{ matrix.compile.dir }}/${{ matrix.arch }} | |
- 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 ${{ matrix.switch }} --engine="$GITHUB_WORKSPACE/out/${{ matrix.compile.dir }}/${{ matrix.arch }}/walrus" ${{ matrix.compile.tests }} | |
build-test-on-x86_x64: | |
strategy: | |
matrix: | |
arch: | |
- x86 | |
- x64 | |
switch: | |
- --jit | |
- --jit-no-reg-alloc | |
- "" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
- name: Build ${{ matrix.arch }} | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=${{ matrix.arch }} -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/linux/${{ matrix.arch }} $BUILD_OPTIONS | |
ninja -Cout/linux/${{ matrix.arch }} | |
- name: Run Tests | |
run: | | |
$RUNNER ${{ matrix.switch }} --engine="$GITHUB_WORKSPACE/out/linux/${{ matrix.arch }}/walrus" | |
build-on-x64-with-perf: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
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_JITPERF=1 -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/linux/x64 $BUILD_OPTIONS | |
ninja -Cout/linux/x64 | |
build-test-on-armv7: | |
strategy: | |
matrix: | |
switch: | |
- --jit | |
- --jit-no-reg-alloc | |
- "" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install compiler | |
run: | | |
sudo apt update | |
sudo apt install -y make wget ninja-build libglib2.0-dev | |
wget https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--glibc--stable-2024.05-1.tar.xz | |
tar -xvf armv7-eabihf--glibc--stable-2024.05-1.tar.xz | |
- name: Install qemu | |
run: | | |
wget https://download.qemu.org/qemu-9.0.2.tar.xz | |
tar -xvf qemu-9.0.2.tar.xz | |
cd qemu-9.0.2 | |
./configure --target-list="arm-linux-user" | |
make -j4 | |
- name: Build in armv7 | |
env: | |
CC: ./armv7-eabihf--glibc--stable-2024.05-1/bin/arm-buildroot-linux-gnueabihf-gcc-13.3.0.br_real | |
CXX: ./armv7-eabihf--glibc--stable-2024.05-1/bin/arm-buildroot-linux-gnueabihf-g++.br_real | |
run: | | |
cmake -H. -DCMAKE_EXE_LINKER_FLAGS="-static" -Bout/arm/debug -DCMAKE_BUILD_TYPE=debug -DWALRUS_ARCH=arm -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
cmake -H. -DCMAKE_EXE_LINKER_FLAGS="-static" -Bout/arm/pure -DWALRUS_ARCH=arm -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -DWALRUS_WASI=OFF -GNinja | |
ninja -C out/arm/debug/ | |
ninja -C out/arm/pure/ | |
- name: Test in armv7 | |
run: | | |
# remove 2 test files due to stack overflow occurred by recursion calls in debug mode build by clang | |
rm ./test/wasm-spec/core/call.wast | |
rm ./test/wasm-spec/core/call_indirect.wast | |
python3 ./tools/run-tests.py ${{ matrix.switch }} --engine="./out/debug/walrus" --qemu="./qemu-9.0.2/build/qemu-arm" | |
python3 ./tools/run-tests.py ${{ matrix.switch }} --engine="./out/pure/walrus" --qemu="./qemu-9.0.2/build/qemu-arm" basic-tests wasm-test-core jit | |
# build-test-on-armv7_aarch64: | |
# strategy: | |
# matrix: | |
# arch: | |
# - run_on_arch: armv7 | |
# walrus: arm | |
# distro: ubuntu_latest | |
# - run_on_arch: aarch64 | |
# walrus: aarch64 | |
# distro: ubuntu22.04 | |
# switch: | |
# - --jit | |
# - --jit-no-reg-alloc | |
# - "" | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# with: | |
# submodules: true | |
# - name: Build in container | |
# uses: uraimo/[email protected] | |
# with: | |
# arch: ${{ matrix.arch.run_on_arch }} | |
# distro: ${{ matrix.arch.distro }} | |
# # Install deps into the container. With the token, the container will be cached | |
# # The image is cached publically like a package | |
# githubToken: ${{ github.token }} | |
# install: | | |
# apt-get update | |
# apt-get install -y cmake build-essential ninja-build pkg-config python3 clang git | |
# run: | | |
# CC=clang CXX=clang++ cmake -H. -Bout/debug -DWALRUS_ARCH=${{ matrix.arch.walrus }} -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja | |
# CC=clang CXX=clang++ cmake -H. -Bout/pure -DWALRUS_ARCH=${{ matrix.arch.walrus }} -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -DWALRUS_WASI=OFF -GNinja | |
# ninja -Cout/debug | |
# ninja -Cout/pure | |
# # remove 2 test files due to stack overflow occurred by recursion calls in debug mode build by clang | |
# rm ./test/wasm-spec/core/call.wast | |
# rm ./test/wasm-spec/core/call_indirect.wast | |
# python3 ./tools/run-tests.py ${{ matrix.switch }} --engine="./out/debug/walrus" | |
# python3 ./tools/run-tests.py ${{ matrix.switch }} --engine="./out/pure/walrus" basic-tests wasm-test-core jit | |
build-test-on-riscv64: | |
strategy: | |
matrix: | |
switch: | |
# TODO enable JIT for RISC-V | |
#- --jit | |
#- --jit-no-reg-alloc | |
- "" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Build in riscv64 container | |
uses: uraimo/[email protected] | |
with: | |
arch: riscv64 | |
distro: ubuntu22.04 | |
# Install deps into the container. With the token, the container will be cached | |
# The image is cached publically like a package | |
githubToken: ${{ github.token }} | |
install: | | |
apt-get update | |
apt-get install -y cmake build-essential ninja-build pkg-config python3 clang git | |
run: | | |
CC=clang CXX=clang++ cmake -H. -Bout/release -DWALRUS_JIT=OFF -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja | |
CC=clang CXX=clang++ cmake -H. -Bout/pure -DWALRUS_JIT=OFF -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -DWALRUS_WASI=OFF -GNinja | |
ninja -Cout/release | |
ninja -Cout/pure | |
python3 ./tools/run-tests.py ${{ matrix.switch }} --engine="./out/release/walrus" | |
python3 ./tools/run-tests.py ${{ matrix.switch }} --engine="./out/pure/walrus" basic-tests wasm-test-core jit | |
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@v4 | |
with: | |
submodules: true | |
- uses: lukka/get-cmake@latest | |
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2 | |
with: | |
sdk-version: 20348 | |
- uses: actions/setup-python@v5 | |
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: | | |
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: 15 | |
build-test-extended-feature: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
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 -DWALRUS_EXTENDED_FEATURES=ON -GNinja | |
run: | | |
cmake -H. -Bout/extended $BUILD_OPTIONS | |
ninja -Cout/extended | |
- name: Run Tests | |
run: | | |
$RUNNER --engine="$GITHUB_WORKSPACE/out/extended/walrus" wasm-test-extended | |
build-test-performance-x64_x86: | |
strategy: | |
matrix: | |
arch: | |
- x64 | |
- x86 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
sudo pip install pandas | |
sudo pip install py-markdown-table | |
sudo pip install tqdm | |
- name: Build ${{ matrix.arch }} | |
env: | |
BUILD_OPTIONS: -DWALRUS_ARCH=${{ matrix.arch }} -DWALRUS_HOST=linux -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
cmake -H. -Bout/linux/${{ matrix.arch }} $BUILD_OPTIONS | |
ninja -Cout/linux/${{ matrix.arch }} | |
- name: Run Tests | |
run: | | |
test/wasmBenchmarker/benchmark.py --engines $GITHUB_WORKSPACE/out/linux/${{ matrix.arch }}/walrus --iterations 2 --verbose --summary --results i j2i n2i j n2j | |
built-test-wasm-c-api: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
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_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 | |
coverity-scan: | |
if: ${{ github.repository == 'Samsung/walrus' && github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build gcc-multilib g++-multilib | |
- name: Download Coverity Tool | |
env: | |
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
run: | | |
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=Samsung-walrus" -O cov-analysis-linux64.tar.gz | |
mkdir cov-analysis-linux64 | |
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 | |
- name: Build | |
env: | |
BUILD_OPTIONS: -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja | |
run: | | |
export PATH=$GITHUB_WORKSPACE/cov-analysis-linux64/bin:$PATH | |
cmake -H. -Bout/coverity_scan $BUILD_OPTIONS | |
cov-build --dir cov-int ninja -Cout/coverity_scan | |
- name: Submit | |
env: | |
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
NOTI_MAIL: ${{ secrets.COVERITY_SCAN_MAIL }} | |
run: | | |
tar czvf walrus.tgz cov-int | |
curl \ | |
--form token=$TOKEN \ | |
--form email=$NOTI_MAIL \ | |
--form [email protected] \ | |
--form version="0.0.1" \ | |
--form description="walrus coverity scan" \ | |
https://scan.coverity.com/builds?project=Samsung-walrus |