You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wasm3/.github/workflows/tests.yml

434 lines
12 KiB
YAML

name: tests
5 years ago
on: [push, pull_request]
5 years ago
jobs:
build-linux:
5 years ago
runs-on: ubuntu-latest
timeout-minutes: 10
5 years ago
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
flags: ["", "-m32"]
5 years ago
build_type: ["-DCMAKE_BUILD_TYPE=Debug", ""]
exclude:
- compiler: clang
build_type: "-DCMAKE_BUILD_TYPE=Debug"
5 years ago
- compiler: gcc # TODO: fails on numeric operations
flags: "-m32"
5 years ago
steps:
- uses: actions/checkout@v1
- name: Install multilib
if: contains(matrix.flags, '-m32')
4 years ago
run: |
sudo apt update
sudo apt install gcc-multilib
5 years ago
- name: Run CMake
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.flags }}
5 years ago
run: |
mkdir build
cd build
cmake ${{ matrix.build_type }} ..
5 years ago
- name: Build
5 years ago
run: |
cmake --build build
- name: Run spec tests
5 years ago
run: |
cd test
./run-spec-test.py
- name: Run WASI tests
run: |
cd test
./run-wasi-test.py
build-mac:
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
5 years ago
- name: Run CMake
run: |
mkdir build
cd build
cmake ..
5 years ago
- name: Build
run: |
cmake --build build
- name: Run spec tests
run: |
cd test
./run-spec-test.py
- name: Run WASI tests
run: |
cd test
./run-wasi-test.py
build-win:
runs-on: windows-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
5 years ago
platform: ["-A Win32", "-A x64"]
5 years ago
toolset: ["-T ClangCL", ""]
steps:
- uses: actions/checkout@v1
5 years ago
- name: Run CMake
run: |
mkdir build
cd build
cmake ${{ matrix.platform }} ${{ matrix.toolset }} ..
5 years ago
- name: Build
run: |
cmake --build build --config Release
cp ./build/Release/wasm3.exe ./build/
- name: Run spec tests
run: |
cd test
python run-spec-test.py
- name: Run WASI tests
run: |
cd test
python run-wasi-test.py
5 years ago
build-wasi:
runs-on: ubuntu-latest
timeout-minutes: 10
5 years ago
steps:
- uses: actions/checkout@v1
5 years ago
- name: Install Wasienv
run: curl https://raw.githubusercontent.com/wasienv/wasienv/master/install.sh | sh
5 years ago
- name: Install Wasmer
4 years ago
env:
WASMER_RELEASE_TAG: "0.15.0"
run: curl https://get.wasmer.io -sSfL | sh
5 years ago
- name: Run CMake
run: |
source $HOME/.wasienv/wasienv.sh
mkdir build-wasi
cd build-wasi
wasimake cmake ..
5 years ago
- name: Build
run: |
source $HOME/.wasienv/wasienv.sh
cmake --build build-wasi
5 years ago
- name: Run spec tests (in Wasmer)
run: |
5 years ago
source $HOME/.wasmer/wasmer.sh
cd test
5 years ago
./run-spec-test.py --exec "wasmer run --dir=. ../build-wasi/wasm3.wasm -- --repl"
5 years ago
- name: Run CMake (native)
run: |
mkdir build
cd build
cmake ..
- name: Build (native)
run: |
cmake --build build
- name: Run spec tests (in Wasm3, self-hosting)
continue-on-error: true # TODO
5 years ago
run: |
cd test
5 years ago
cp ../build-wasi/wasm3.wasm ./
./run-spec-test.py --exec "../build/wasm3 ./wasm3.wasm --repl"
5 years ago
5 years ago
build-ios:
runs-on: macos-latest
timeout-minutes: 10
5 years ago
steps:
- uses: actions/checkout@v1
- name: List Xcode versions
run: ls /Applications | grep Xcode
- name: Select Xcode 11
run: sudo xcode-select -switch /Applications/Xcode_11.3.app
- name: Build (iPhone 11)
run: |
cd platforms/ios
5 years ago
xcodebuild build -scheme wasm3 -project wasm3.xcodeproj -configuration Release -destination 'platform=iOS Simulator,name=iPhone 11,OS=13.3'
5 years ago
build-android:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
5 years ago
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build
run: |
cd platforms/android
./gradlew build
5 years ago
build-raspberry:
5 years ago
runs-on: [self-hosted, linux, ARM]
if: "false" # TODO: implement QEMU-based RPi build/test environment
timeout-minutes: 10
5 years ago
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
5 years ago
steps:
- uses: actions/checkout@v1
- name: Run CMake
env:
CC: ${{ matrix.compiler }}
5 years ago
run: |
mkdir build
cd build
cmake ..
- name: Build
run: |
cmake --build build
- name: Run spec tests
run: |
cd test
5 years ago
python3 run-spec-test.py
- name: Run WASI tests
run: |
cd test
./run-wasi-test.py
4 years ago
build-cross-qemu:
4 years ago
runs-on: ubuntu-latest
4 years ago
name: build-cross-qemu-${{ matrix.config.target }}
4 years ago
timeout-minutes: 10
4 years ago
4 years ago
strategy:
4 years ago
fail-fast: false
4 years ago
matrix:
4 years ago
config:
4 years ago
- {target: arm, toolchain: gcc-arm-linux-gnueabi, cc: arm-linux-gnueabi-gcc, qemu: qemu-arm-static }
- {target: armhf, toolchain: gcc-arm-linux-gnueabihf, cc: arm-linux-gnueabihf-gcc, qemu: qemu-arm-static }
- {target: aarch64, toolchain: gcc-aarch64-linux-gnu, cc: aarch64-linux-gnu-gcc, qemu: qemu-aarch64-static }
4 years ago
- {target: riscv64, toolchain: gcc-riscv64-linux-gnu, cc: riscv64-linux-gnu-gcc, qemu: qemu-riscv64-static }
- {target: alpha, toolchain: gcc-alpha-linux-gnu, cc: alpha-linux-gnu-gcc, qemu: qemu-alpha-static }
4 years ago
#- {target: ppc, toolchain: gcc-powerpc-linux-gnu, cc: powerpc-linux-gnu-gcc, qemu: qemu-ppc-static }
#- {target: ppc64, toolchain: gcc-powerpc64-linux-gnu, cc: powerpc64-linux-gnu-gcc, qemu: qemu-ppc64-static }
- {target: ppc64le, toolchain: gcc-powerpc64le-linux-gnu, cc: powerpc64le-linux-gnu-gcc, qemu: qemu-ppc64le-static }
#- {target: mips, toolchain: gcc-mips-linux-gnu, cc: mips-linux-gnu-gcc, qemu: qemu-mips-static }
#- {target: mips64, toolchain: gcc-mips64-linux-gnuabi64, cc: mips64-linux-gnuabi64-gcc, qemu: qemu-mips64-static }
4 years ago
- {target: mipsel, toolchain: gcc-mipsel-linux-gnu, cc: mipsel-linux-gnu-gcc, qemu: qemu-mipsel-static, skip-fail: true }
- {target: mips64el,toolchain: gcc-mips64el-linux-gnuabi64, cc: mips64el-linux-gnuabi64-gcc, qemu: qemu-mips64el-static, skip-fail: true }
4 years ago
#- {target: s390x, toolchain: gcc-s390x-linux-gnu, cc: s390x-linux-gnu-gcc, qemu: qemu-s390x-static }
4 years ago
#- {target: sparc64, toolchain: gcc-sparc64-linux-gnu, cc: sparc64-linux-gnu-gcc, qemu: qemu-sparc64-static }
#- {target: m68k, toolchain: gcc-m68k-linux-gnu, cc: m68k-linux-gnu-gcc, qemu: qemu-m68k-static }
4 years ago
steps:
- uses: actions/checkout@v1
- name: Install prerequisites
run: |
sudo apt update
4 years ago
wget http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu/qemu-user-static_4.2-3ubuntu4_amd64.deb
sudo dpkg -i qemu-user-static_4.2-3ubuntu4_amd64.deb
sudo apt install ${{ matrix.config.toolchain }}
4 years ago
- name: Cross-compile
run: |
mkdir build
cd build
4 years ago
${{ matrix.config.cc }} -Dd_m3HasWASI \
4 years ago
-I../source ../source/*.c ../platforms/app/main.c \
-O3 -g0 -lm -static \
-o wasm3
- name: Run spec tests
4 years ago
continue-on-error: ${{ matrix.config.skip-fail }}
4 years ago
run: |
cd test
4 years ago
python3 run-spec-test.py --exec "${{ matrix.config.qemu }} ../build/wasm3 --repl"
4 years ago
- name: Run WASI tests
run: |
cd test
4 years ago
python3 run-wasi-test.py --fast --exec "${{ matrix.config.qemu }} ../build/wasm3"
4 years ago
build-platformio:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
5 years ago
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
5 years ago
python -m pip install --upgrade pip
pip install -U platformio
- name: Build AVR ATmega1284
run: |
cd platforms/arduino
pio run -e mega1284
! nm .pio/build/mega1284/firmware.elf | grep printf
5 years ago
- name: Build ESP8266
run: |
cd platforms/esp8266
5 years ago
pio run
- name: Build ESP32
run: |
cd platforms/esp32-pio
pio run
5 years ago
build-platformio-arm:
runs-on: ubuntu-latest
timeout-minutes: 10
5 years ago
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install PlatformIO
5 years ago
run: |
5 years ago
python -m pip install --upgrade pip
pip install -U platformio
- name: Build Arduino MKR1000
run: |
cd platforms/arduino
pio run -e mkr1000
5 years ago
- name: Build Blue Pill (JeeH)
run: |
cd platforms/bluepill
pio run
- name: Build TinyBLE
run: |
cd platforms/arduino
pio run -e tinyBLE
- name: Build MXChip AZ3166
run: |
cd platforms/arduino
pio run -e az3166
5 years ago
build-platformio-riscv:
runs-on: ubuntu-latest
timeout-minutes: 10
5 years ago
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install -U platformio
- name: Build HiFive1
run: |
cd platforms/hifive1
pio run
- name: Build Sipeed MAIX
run: |
cd platforms/arduino
pio run -e maix
5 years ago
build-particle:
runs-on: ubuntu-latest
timeout-minutes: 10
5 years ago
if: "github.event_name == 'push'"
steps:
- uses: actions/checkout@v1
- name: Set up Particle CLI
5 years ago
run: sudo npm install -g particle-cli
- name: Log in
env:
PARTICLE_TOKEN: ${{ secrets.PARTICLE_TOKEN }}
run: particle login --token $PARTICLE_TOKEN
- name: Build Photon
run: |
cd platforms/particle
particle compile --followSymlinks photon
build-esp32-idf:
runs-on: ubuntu-latest
container: igrr/idf-qemu:release-v4.0-esp-develop-20191228
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
- name: Build for ESP32 (IDF v4.0)
run: |
. $IDF_PATH/export.sh
cd platforms/esp32-idf
export EXTRA_CFLAGS="-Werror"
idf.py build
shell: bash
- name: Test for ESP32 in QEMU
run: |
cd platforms/esp32-idf
make-flash-img.sh wasm3 flash_img.bin
qemu-system-xtensa -machine esp32 -nographic -drive file=flash_img.bin,if=mtd,format=raw -no-reboot | tee out.txt
grep "Result: 46368" out.txt
grep "Elapsed: " out.txt
grep "Restarting..." out.txt
test $(($(grep "ets Jun 8 2016" out.txt | wc -l))) -eq 1
- name: Check that IDF and PIO examples are in sync
run: |
diff -q platforms/esp32-idf/main/main.cpp platforms/esp32-pio/src/main.cpp
# TODO: also check that the build flags are in sync
build-cpp:
runs-on: ubuntu-latest
4 years ago
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
- name: Run CMake
run: |
cd platforms/cpp
mkdir build
cd build
cmake ..
- name: Build
run: |
cd platforms/cpp
cmake --build build
- name: Run
run: |
cd platforms/cpp/build
./wasm3_cpp_example
4 years ago
# Build as C++ (i.e. to run some C++-related checks)
build-as-cpp:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
- name: Run CMake
env:
CC: g++
CFLAGS: -xc++
run: |
mkdir build
cd build
4 years ago
cmake -DCMAKE_C_COMPILER_WORKS=1 ..
4 years ago
- name: Build
run: |
cmake --build build
- name: Run spec tests
run: |
cd test
./run-spec-test.py
- name: Run WASI tests
run: |
cd test
./run-wasi-test.py