From b15e1ef5a6c40b543e2b0d65252ef1475d03005e Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 4 Jun 2021 23:40:47 +1000 Subject: [PATCH] github/workflows: Add workflow to build and run unix port on ARM. Following on from ef16834887de02cbddf414b560e5a2af9cae4b16, this adds a coverage build and running of the test suite on an ARM 32-bit Linux-based architecture. Signed-off-by: Damien George --- .github/workflows/ports_unix.yml | 14 ++++++++++++++ tools/ci.sh | 25 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/.github/workflows/ports_unix.yml b/.github/workflows/ports_unix.yml index 5c4a4f3047..c6ddd53037 100644 --- a/.github/workflows/ports_unix.yml +++ b/.github/workflows/ports_unix.yml @@ -200,3 +200,17 @@ jobs: - name: Print failures if: failure() run: tests/run-tests.py --print-failures + + qemu_arm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: source tools/ci.sh && ci_unix_qemu_arm_setup + - name: Build + run: source tools/ci.sh && ci_unix_qemu_arm_build + - name: Run main test suite + run: source tools/ci.sh && ci_unix_qemu_arm_run_tests + - name: Print failures + if: failure() + run: tests/run-tests.py --print-failures diff --git a/tools/ci.sh b/tools/ci.sh index 22b43d4513..e726ae40a7 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -300,6 +300,12 @@ CI_UNIX_OPTS_QEMU_MIPS=( LDFLAGS_EXTRA="-static" ) +CI_UNIX_OPTS_QEMU_ARM=( + CROSS_COMPILE=arm-linux-gnueabi- + VARIANT=coverage + MICROPY_STANDALONE=1 +) + function ci_unix_build_helper { make ${MAKEOPTS} -C mpy-cross make ${MAKEOPTS} -C ports/unix "$@" submodules @@ -506,6 +512,25 @@ function ci_unix_qemu_mips_run_tests { (cd tests && MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py --exclude 'vfs_posix.py' --exclude 'ffi_(callback|float|float2).py') } +function ci_unix_qemu_arm_setup { + sudo apt-get update + sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi + sudo apt-get install qemu-user + qemu-arm --version +} + +function ci_unix_qemu_arm_build { + ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_ARM[@]}" +} + +function ci_unix_qemu_arm_run_tests { + # Issues with ARM tests: + # - (i)listdir does not work, it always returns the empty list (it's an issue with the underlying C call) + export QEMU_LD_PREFIX=/usr/arm-linux-gnueabi + file ./ports/unix/micropython-coverage + (cd tests && MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py --exclude 'vfs_posix.py') +} + ######################################################################################## # ports/windows