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

252 lines
6.0 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: 5
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')
run: sudo apt-get 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: 5
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: 5
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: 5
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
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
cmake -DWASIENV=1 ..
5 years ago
- name: Build
run: |
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-raspberry:
5 years ago
runs-on: [self-hosted, linux, ARM]
if: "false" # TODO: implement QEMU-based RPi build/test environment
5 years ago
timeout-minutes: 5
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
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
5 years ago
- name: Build Arduino MKR1000
run: |
cd platforms/arduino
5 years ago
pio run -e mkr1000
- 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
- name: Build HiFive1
run: |
cd platforms/hifive1
pio run
- 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
- name: Build Sipeed MAIX
run: |
cd platforms/arduino
pio run -e maix
build-esp32-idf:
runs-on: ubuntu-latest
container: igrr/idf-qemu:release-v4.0-esp-develop-20191228
timeout-minutes: 5
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