|
| 1 | +# Copyright (C) 2019 Intel Corporation. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | + |
| 4 | +name: spec test on nuttx |
| 5 | + |
| 6 | +on: |
| 7 | + schedule: |
| 8 | + - cron: '0 0 * * *' |
| 9 | + |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + spec_test_on_qemu: |
| 14 | + runs-on: ubuntu-22.04 |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + nuttx_board_config: [ |
| 18 | + # cortex-a9 |
| 19 | + "boards/arm/imx6/sabre-6quad/configs/nsh", |
| 20 | + # riscv32imac |
| 21 | + "boards/risc-v/qemu-rv/rv-virt/configs/nsh", |
| 22 | + # riscv64imac |
| 23 | + # "boards/risc-v/qemu-rv/rv-virt/configs/nsh64", |
| 24 | + ] |
| 25 | + wamr_test_option: [ |
| 26 | + # "-t fast-interp", |
| 27 | + "-t aot", |
| 28 | + # "-t aot -X" |
| 29 | + ] |
| 30 | + steps: |
| 31 | + - name: Install Utilities |
| 32 | + run: | |
| 33 | + sudo apt install -y kconfig-frontends-nox genromfs |
| 34 | +
|
| 35 | + - name: Install ARM Compilers |
| 36 | + if: contains(matrix.nuttx_board_config, 'arm') |
| 37 | + run: sudo apt install -y gcc-arm-none-eabi |
| 38 | + |
| 39 | + - name: Install RISC-V Compilers |
| 40 | + if: contains(matrix.nuttx_board_config, 'risc-v') |
| 41 | + run: | |
| 42 | + curl -L https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz > riscv.tar.gz |
| 43 | + tar xvf riscv.tar.gz |
| 44 | + echo "$PWD/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_PATH |
| 45 | +
|
| 46 | + - name: Checkout NuttX |
| 47 | + uses: actions/checkout@v3 |
| 48 | + with: |
| 49 | + repository: apache/incubator-nuttx |
| 50 | + path: nuttx |
| 51 | + |
| 52 | + - name: Checkout NuttX Apps |
| 53 | + uses: actions/checkout@v3 |
| 54 | + with: |
| 55 | + repository: apache/incubator-nuttx-apps |
| 56 | + path: apps |
| 57 | + |
| 58 | + - name: Checkout WAMR |
| 59 | + uses: actions/checkout@v3 |
| 60 | + with: |
| 61 | + repository: ${{ github.repository }} |
| 62 | + path: apps/interpreters/wamr/wamr |
| 63 | + |
| 64 | + - name: Enable WAMR for NuttX |
| 65 | + run: | |
| 66 | + find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_INTERPRETERS_WAMR=y\nCONFIG_INTERPRETERS_WAMR_AOT=y\nCONFIG_INTERPRETERS_WAMR_FAST=y\nCONFIG_INTERPRETERS_WAMR_LOG=y\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\n' |
| 67 | + find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_LF=y\nCONFIG_ARM_SEMIHOSTING_HOSTFS=y\nCONFIG_ARM_SEMIHOSTING_HOSTFS_CACHE_COHERENCE=y\nCONFIG_RISCV_SEMIHOSTING_HOSTFS=y\nCONFIG_FS_HOSTFS=y\nCONFIG_LIBC_FLOATINGPOINT=y\n' |
| 68 | +
|
| 69 | + - name: Build wamrc |
| 70 | + working-directory: apps/interpreters/wamr/wamr/wamr-compiler |
| 71 | + run: | |
| 72 | + sudo apt install llvm-13-dev |
| 73 | + cmake -Bbuild -DWAMR_BUILD_WITH_CUSTOM_LLVM=1 . |
| 74 | + cmake --build build |
| 75 | +
|
| 76 | + - name: Build |
| 77 | + run: | |
| 78 | + cd nuttx |
| 79 | + tools/configure.sh ${{ matrix.nuttx_board_config }} |
| 80 | + make -j$(nproc) |
| 81 | + echo "firmware=$PWD/nuttx" >> $GITHUB_ENV |
| 82 | +
|
| 83 | + - name: Test on ARM |
| 84 | + if: endsWith(matrix.nuttx_board_config, 'sabre-6quad/configs/nsh') |
| 85 | + run: | |
| 86 | + curl -L https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v7.1.0-1/xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz > xpack-qemu-arm.tar.gz |
| 87 | + tar xvf xpack-qemu-arm.tar.gz |
| 88 | + export PATH=$PATH:$PWD/xpack-qemu-arm-7.1.0-1/bin |
| 89 | + cd apps/interpreters/wamr/wamr/tests/wamr-test-suites |
| 90 | + ./test_wamr.sh -s spec ${{ matrix.wamr_test_option }} -m thumbv7_vfp -b -Q -P -F ${{ env.firmware }} |
| 91 | +
|
| 92 | + - name: Test on RISCV32 |
| 93 | + if: endsWith(matrix.nuttx_board_config, 'rv-virt/configs/nsh') |
| 94 | + run: | |
| 95 | + curl -L https://github.com/xpack-dev-tools/qemu-riscv-xpack/releases/download/v7.1.0-1/xpack-qemu-riscv-7.1.0-1-linux-x64.tar.gz > xpack-qemu-riscv.tar.gz |
| 96 | + tar xvf xpack-qemu-riscv.tar.gz |
| 97 | + export PATH=$PATH:$PWD/xpack-qemu-riscv-7.1.0-1/bin |
| 98 | + cd apps/interpreters/wamr/wamr/tests/wamr-test-suites |
| 99 | + ./test_wamr.sh -s spec ${{ matrix.wamr_test_option }} -m RISCV32 -b -Q -P -F ${{ env.firmware }} |
| 100 | +
|
| 101 | + - name: Test on RISCV64 |
| 102 | + if: endsWith(matrix.nuttx_board_config, 'rv-virt/configs/nsh64') |
| 103 | + run: | |
| 104 | + curl -L https://github.com/xpack-dev-tools/qemu-riscv-xpack/releases/download/v7.1.0-1/xpack-qemu-riscv-7.1.0-1-linux-x64.tar.gz > xpack-qemu-riscv.tar.gz |
| 105 | + tar xvf xpack-qemu-riscv.tar.gz |
| 106 | + export PATH=$PATH:$PWD/xpack-qemu-riscv-7.1.0-1/bin |
| 107 | + cd apps/interpreters/wamr/wamr/tests/wamr-test-suites |
| 108 | + ./test_wamr.sh -s spec ${{ matrix.wamr_test_option }} -m riscv64 -b -Q -P -F ${{ env.firmware }} |
0 commit comments