Skip to content

Commit

Permalink
Improve CI
Browse files Browse the repository at this point in the history
Test with jit-no-reg-alloc

Signed-off-by: Laszlo Voros <[email protected]>
  • Loading branch information
vorosl committed Jan 28, 2025
1 parent acf00db commit 79cf377
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 124 deletions.
266 changes: 161 additions & 105 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,24 @@ jobs:
$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
Expand All @@ -82,41 +100,19 @@ jobs:
run: |
sudo apt update
sudo apt install -y ninja-build gcc-multilib g++-multilib
- name: Build x86
env:
BUILD_OPTIONS: -DWALRUS_ARCH=x86 -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
- name: ${{ matrix.compile.name }} ${{ matrix.arch }}
env:
BUILD_OPTIONS: -DWALRUS_ARCH=x64 -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DWALRUS_ARCH=${{ matrix.arch }} -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell ${{ matrix.compile.options }} -GNinja
run: |
CC=clang CXX=clang++ cmake -H. -Bout/clang/x64 $BUILD_OPTIONS
ninja -Cout/clang/x64
- name: Pure Build x86
env:
BUILD_OPTIONS: -DWALRUS_ARCH=x86 -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -DWALRUS_WASI=OFF -GNinja
run: |
CC=clang CXX=clang++ cmake -H. -Bout/pure/x86 $BUILD_OPTIONS
ninja -Cout/pure/x86
- name: Pure Build x64
env:
BUILD_OPTIONS: -DWALRUS_ARCH=x64 -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -DWALRUS_WASI=OFF -GNinja
run: |
CC=clang CXX=clang++ cmake -H. -Bout/pure/x64 $BUILD_OPTIONS
ninja -Cout/pure/x64
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 --engine="$GITHUB_WORKSPACE/out/clang/x86/walrus"
$RUNNER --jit --engine="$GITHUB_WORKSPACE/out/clang/x64/walrus"
$RUNNER --jit --engine="$GITHUB_WORKSPACE/out/pure/x86/walrus" basic-tests wasm-test-core jit
$RUNNER --engine="$GITHUB_WORKSPACE/out/pure/x64/walrus" basic-tests wasm-test-core jit
$RUNNER ${{ matrix.switch }} --engine="$GITHUB_WORKSPACE/out/${{ matrix.compile.dir }}/${{ matrix.arch }}/walrus" ${{ matrix.compile.tests }}
build-test-on-x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -126,18 +122,26 @@ jobs:
run: |
sudo apt update
sudo apt install -y ninja-build gcc-multilib g++-multilib
- name: Build x86
- name: ${{matrix.compile.name}} ${{matrix.arch}}
env:
BUILD_OPTIONS: -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DWALRUS_ARCH=${{matrix.arch}} -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell ${{matrix.compile.options}} -GNinja
run: |
cmake -H. -Bout/linux/x86 $BUILD_OPTIONS
ninja -Cout/linux/x86
- name: Run Tests
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: |
$RUNNER --engine="$GITHUB_WORKSPACE/out/linux/x86/walrus"
$RUNNER --jit --engine="$GITHUB_WORKSPACE/out/linux/x86/walrus"
$RUNNER ${{ matrix.switch }} --engine="$GITHUB_WORKSPACE/out/${{matrix.compile.dir}}/${{matrix.arch}}/walrus" ${{matrix.compile.tests}}
build-test-on-x64:
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
Expand All @@ -147,16 +151,15 @@ jobs:
run: |
sudo apt update
sudo apt install -y ninja-build gcc-multilib g++-multilib
- name: Build x64
- name: Build ${{ matrix.arch }}
env:
BUILD_OPTIONS: -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DWALRUS_ARCH=${{ matrix.arch }} -DWALRUS_HOST=linux -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja
run: |
cmake -H. -Bout/linux/x64 $BUILD_OPTIONS
ninja -Cout/linux/x64
cmake -H. -Bout/linux/${{ matrix.arch }} $BUILD_OPTIONS
ninja -Cout/linux/${{ matrix.arch }}
- name: Run Tests
run: |
$RUNNER --engine="$GITHUB_WORKSPACE/out/linux/x64/walrus"
$RUNNER --jit --engine="$GITHUB_WORKSPACE/out/linux/x64/walrus"
$RUNNER ${{ matrix.switch }} --engine="$GITHUB_WORKSPACE/out/linux/${{ matrix.arch }}/walrus"
build-on-x64-with-perf:
runs-on: ubuntu-latest
Expand All @@ -175,68 +178,99 @@ jobs:
cmake -H. -Bout/linux/x64 $BUILD_OPTIONS
ninja -Cout/linux/x64
build-test-on-armv7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build in arm32 container
uses: uraimo/[email protected]
with:
arch: armv7
distro: ubuntu_latest

# 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
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
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: |
CC=clang CXX=clang++ cmake -H. -Bout/debug -DWALRUS_MODE=debug -DWALRUS_OUTPUT=shell -GNinja
CC=clang CXX=clang++ cmake -H. -Bout/pure -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 --engine="./out/debug/walrus"
python3 ./tools/run-tests.py --jit --engine="./out/debug/walrus"
python3 ./tools/run-tests.py --engine="./out/pure/walrus" basic-tests wasm-test-core jit
python3 ./tools/run-tests.py --jit --engine="./out/pure/walrus" basic-tests wasm-test-core jit
python3 ./tools/run-tests.py ${{ matrix.switch }} --engine="./out/debug/walrus" --qemu="./qemu-9.0.2/arm-linux-user/qemu-arm"
python3 ./tools/run-tests.py ${{ matrix.switch }} --engine="./out/pure/walrus" --qemu="./qemu-9.0.2/arm-linux-user/qemu-arm" basic-tests wasm-test-core jit
build-test-on-arm64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build in arm64 container
uses: uraimo/[email protected]
with:
arch: aarch64
distro: ubuntu22.04
# 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 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_MODE=release -DWALRUS_OUTPUT=shell -GNinja
CC=clang CXX=clang++ cmake -H. -Bout/pure -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -DWALRUS_WASI=OFF -GNinja
ninja -Cout/release
ninja -Cout/pure
python3 ./tools/run-tests.py --engine="./out/release/walrus"
python3 ./tools/run-tests.py --jit --engine="./out/release/walrus"
python3 ./tools/run-tests.py --engine="./out/pure/walrus" basic-tests wasm-test-core jit
python3 ./tools/run-tests.py --jit --engine="./out/pure/walrus" basic-tests wasm-test-core jit
# 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
Expand All @@ -256,15 +290,12 @@ jobs:
apt-get update
apt-get install -y cmake build-essential ninja-build pkg-config python3 clang git
run: |
# TODO enable JIT for RISC-V
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 --engine="./out/release/walrus"
#python3 ./tools/run-tests.py --jit --engine="./out/release/walrus"
python3 ./tools/run-tests.py --engine="./out/pure/walrus" basic-tests wasm-test-core jit
#python3 ./tools/run-tests.py --jit --engine="./out/pure/walrus" basic-tests wasm-test-core jit
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
Expand Down Expand Up @@ -306,7 +337,32 @@ jobs:
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15

build-test-performance:
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
Expand All @@ -319,15 +375,15 @@ jobs:
sudo pip install pandas
sudo pip install py-markdown-table
sudo pip install tqdm
- name: Build x64
- name: Build ${{ matrix.arch }}
env:
BUILD_OPTIONS: -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DWALRUS_ARCH=${{ matrix.arch }} -DWALRUS_HOST=linux -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja
run: |
cmake -H. -Bout/linux/x64 $BUILD_OPTIONS
ninja -Cout/linux/x64
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/x64/walrus --iterations 2 --verbose --summary --results i j2i n2i j n2j
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
Expand Down
Loading

0 comments on commit 79cf377

Please sign in to comment.