github/workflows: Add workflow to build and run unix port on MIPS.
This adds a coverage build and running of the test suite on a MIPS 32-bit big endian architecture. It uses the feature of qemu to execute foreign code as though it were native to the system (using qemu user mode). The code compiled for MIPS will run under the qemu VM, but all syscalls made by this code go to the host (Linux) system. See related #7268 and #7273. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
dc86e04476
commit
ef16834887
14
.github/workflows/ports_unix.yml
vendored
14
.github/workflows/ports_unix.yml
vendored
@ -186,3 +186,17 @@ jobs:
|
|||||||
- name: Print failures
|
- name: Print failures
|
||||||
if: failure()
|
if: failure()
|
||||||
run: tests/run-tests.py --print-failures
|
run: tests/run-tests.py --print-failures
|
||||||
|
|
||||||
|
qemu_mips:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install packages
|
||||||
|
run: source tools/ci.sh && ci_unix_qemu_mips_setup
|
||||||
|
- name: Build
|
||||||
|
run: source tools/ci.sh && ci_unix_qemu_mips_build
|
||||||
|
- name: Run main test suite
|
||||||
|
run: source tools/ci.sh && ci_unix_qemu_mips_run_tests
|
||||||
|
- name: Print failures
|
||||||
|
if: failure()
|
||||||
|
run: tests/run-tests.py --print-failures
|
||||||
|
27
tools/ci.sh
27
tools/ci.sh
@ -292,6 +292,13 @@ CI_UNIX_OPTS_SYS_SETTRACE_STACKLESS=(
|
|||||||
CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1 -DMICROPY_PY_SYS_SETTRACE=1"
|
CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1 -DMICROPY_PY_SYS_SETTRACE=1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
CI_UNIX_OPTS_QEMU_MIPS=(
|
||||||
|
CROSS_COMPILE=mips-linux-gnu-
|
||||||
|
VARIANT=coverage
|
||||||
|
MICROPY_STANDALONE=1
|
||||||
|
LDFLAGS_EXTRA="-static"
|
||||||
|
)
|
||||||
|
|
||||||
function ci_unix_build_helper {
|
function ci_unix_build_helper {
|
||||||
make ${MAKEOPTS} -C mpy-cross
|
make ${MAKEOPTS} -C mpy-cross
|
||||||
make ${MAKEOPTS} -C ports/unix "$@" submodules
|
make ${MAKEOPTS} -C ports/unix "$@" submodules
|
||||||
@ -478,6 +485,26 @@ function ci_unix_macos_run_tests {
|
|||||||
(cd tests && ./run-tests.py --exclude 'uasyncio_(basic|heaplock|lock|wait_task)' --exclude 'import_pkg7.py' --exclude 'urandom_basic.py')
|
(cd tests && ./run-tests.py --exclude 'uasyncio_(basic|heaplock|lock|wait_task)' --exclude 'import_pkg7.py' --exclude 'urandom_basic.py')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ci_unix_qemu_mips_setup {
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install gcc-mips-linux-gnu g++-mips-linux-gnu
|
||||||
|
sudo apt-get install qemu-user
|
||||||
|
qemu-mips --version
|
||||||
|
}
|
||||||
|
|
||||||
|
function ci_unix_qemu_mips_build {
|
||||||
|
# qemu-mips on GitHub Actions will seg-fault if not linked statically
|
||||||
|
ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_MIPS[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function ci_unix_qemu_mips_run_tests {
|
||||||
|
# Issues with MIPS tests:
|
||||||
|
# - (i)listdir does not work, it always returns the empty list (it's an issue with the underlying C call)
|
||||||
|
# - ffi tests do not work
|
||||||
|
file ./ports/unix/micropython-coverage
|
||||||
|
(cd tests && MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py --exclude 'vfs_posix.py' --exclude 'ffi_(callback|float|float2).py')
|
||||||
|
}
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
# ports/windows
|
# ports/windows
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user