github/workflows: Add CI to run tests against zephyr with qemu.
With this change, the zephyr port is tested against the standard test suite via the following scheme: - the zephyr port is built with the `qemu_cortex_m3` board and the `prj_minimal.conf` configuration - `qemu-system-arm` runs `zephyr.elf` - the zephyr console is redirected to a pts/pty - `tests/run-tests.py` is run in bare-metal mode against the pts/pty device This allows testing the zephyr port as though it were a physical board attached over a serial port. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
5
.github/workflows/ports_zephyr.yml
vendored
5
.github/workflows/ports_zephyr.yml
vendored
@@ -27,3 +27,8 @@ jobs:
|
|||||||
run: source tools/ci.sh && ci_zephyr_install
|
run: source tools/ci.sh && ci_zephyr_install
|
||||||
- name: Build
|
- name: Build
|
||||||
run: source tools/ci.sh && ci_zephyr_build
|
run: source tools/ci.sh && ci_zephyr_build
|
||||||
|
- name: Run main test suite
|
||||||
|
run: source tools/ci.sh && ci_zephyr_run_tests
|
||||||
|
- name: Print failures
|
||||||
|
if: failure()
|
||||||
|
run: tests/run-tests.py --print-failures
|
||||||
|
|||||||
12
tools/ci.sh
12
tools/ci.sh
@@ -749,6 +749,11 @@ function ci_zephyr_setup {
|
|||||||
-w /micropython/ports/zephyr \
|
-w /micropython/ports/zephyr \
|
||||||
zephyrprojectrtos/ci:${ZEPHYR_DOCKER_VERSION}
|
zephyrprojectrtos/ci:${ZEPHYR_DOCKER_VERSION}
|
||||||
docker ps -a
|
docker ps -a
|
||||||
|
|
||||||
|
# qemu-system-arm is needed to run the test suite.
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install qemu-system-arm
|
||||||
|
qemu-system-arm --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function ci_zephyr_install {
|
function ci_zephyr_install {
|
||||||
@@ -763,3 +768,10 @@ function ci_zephyr_build {
|
|||||||
docker exec zephyr-ci west build -p auto -b mimxrt1050_evk
|
docker exec zephyr-ci west build -p auto -b mimxrt1050_evk
|
||||||
docker exec zephyr-ci west build -p auto -b nucleo_wb55rg # for bluetooth
|
docker exec zephyr-ci west build -p auto -b nucleo_wb55rg # for bluetooth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ci_zephyr_run_tests {
|
||||||
|
docker exec zephyr-ci west build -p auto -b qemu_cortex_m3 -- -DCONF_FILE=prj_minimal.conf
|
||||||
|
# Issues with zephyr tests:
|
||||||
|
# - inf_nan_arith fails pow(-1, nan) test
|
||||||
|
(cd tests && ./run-tests.py --target minimal --device execpty:"qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -monitor null -serial pty -kernel ../ports/zephyr/build/zephyr/zephyr.elf" -d basics float --exclude inf_nan_arith)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user