| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- # Copyright (C) 2019 Intel Corporation. All rights reserved.
- # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- name: spec test on nuttx
- on:
- pull_request:
- types:
- - opened
- - synchronize
- paths:
- - ".github/workflows/spec_test_on_nuttx.yml"
- - "core/**"
- - "!core/deps/**"
- - "product-mini/**"
- - "!samples/workload/**"
- - "tests/wamr-test-suites/**"
- - "wamr-compiler/**"
- - "wamr-sdk/**"
- schedule:
- - cron: '0 0 * * *'
- workflow_dispatch:
- # Note on INTERPRETERS_WAMR_STACK_GUARD_SIZE:
- # https://github.com/apache/nuttx-apps/pull/2241 is not included in
- # releases/12.4 branch as of writing this.
- env:
- LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
- WASI_SDK_PATH: "/opt/wasi-sdk"
- WAMR_COMMON_OPTION:
- "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_STACKSIZE=327680\\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\\nCONFIG_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\\nCONFIG_INTERPRETERS_WAMR_STACK_GUARD_SIZE=1024\\n"
- jobs:
- build_llvm_libraries:
- uses: ./.github/workflows/build_llvm_libraries.yml
- with:
- os: "ubuntu-22.04"
- arch: "ARM RISCV AArch64"
- container_image: ghcr.io/no1wudi/nuttx/apache-nuttx-ci-linux@sha256:8c4e00b607d4d6d66ba8f51c4544819a616eac69d3a2ac669e2af2150e2eb0f9
- spec_test_on_qemu:
- runs-on: ubuntu-latest
- needs: [build_llvm_libraries]
- container:
- image: ghcr.io/no1wudi/nuttx/apache-nuttx-ci-linux@sha256:8c4e00b607d4d6d66ba8f51c4544819a616eac69d3a2ac669e2af2150e2eb0f9
- strategy:
- matrix:
- target_config: [
- # {
- # config: "boards/arm64/qemu/qemu-armv8a/configs/nsh",
- # target: "aarch64_vfp",
- # fpu_type: "fp"
- # },
- # {
- # config: "boards/arm/imx6/sabre-6quad/configs/nsh",
- # target: "thumbv7",
- # fpu_type: "none"
- # },
- {
- config: "boards/arm/imx6/sabre-6quad/configs/nsh",
- target: "thumbv7_vfp",
- fpu_type: "dp"
- },
- {
- config: "boards/risc-v/qemu-rv/rv-virt/configs/nsh",
- target: "riscv32",
- fpu_type: "none"
- },
- # {
- # config: "boards/risc-v/qemu-rv/rv-virt/configs/nsh",
- # target: "riscv32_ilp32d",
- # fpu_type: "dp"
- # },
- {
- config: "boards/risc-v/qemu-rv/rv-virt/configs/nsh64",
- target: "riscv64",
- fpu_type: "none"
- },
- ]
- wamr_test_option: [
- {
- mode: "-t aot",
- option: "CONFIG_INTERPRETERS_WAMR_AOT=y\\n"
- },
- # {
- # mode: "-t aot -X",
- # option: "CONFIG_INTERPRETERS_WAMR_AOT=y\\n"
- # },
- # {
- # mode: "-t classic-interp",
- # option: "CONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n"
- # },
- # {
- # mode: "-t fast-interp",
- # option: "CONFIG_INTERPRETERS_WAMR_FAST=y\\n"
- # },
- ]
- wamr_feature_option:
- # Empty option for default
- - { option: "", mode: "" }
- - { option: "CONFIG_INTERPRETERS_WAMR_GC=y\\nCONFIG_INTERPRETERS_WAMR_AOT_STACK_FRAME=y\\n", mode: "-G" }
- exclude:
- # XIP is not fully supported yet on RISCV64, some relocations can not be resolved
- - target_config: { config: "boards/risc-v/qemu-rv/rv-virt/configs/nsh64" }
- wamr_test_option: { mode: "-t aot -X" }
- steps:
- - name: Checkout NuttX
- uses: actions/checkout@v4
- with:
- repository: apache/incubator-nuttx
- ref: releases/12.4
- path: nuttx
- - name: Checkout NuttX Apps
- uses: actions/checkout@v4
- with:
- repository: apache/incubator-nuttx-apps
- ref: releases/12.4
- path: apps
- - name: Checkout WAMR
- uses: actions/checkout@v4
- with:
- repository: ${{ github.repository }}
- path: apps/interpreters/wamr/wamr
- - name: Get LLVM libraries
- if: contains(matrix.wamr_test_option.mode, 'aot')
- id: retrieve_llvm_libs
- uses: actions/cache@v4
- with:
- path: |
- ./core/deps/llvm/build/bin
- ./core/deps/llvm/build/include
- ./core/deps/llvm/build/lib
- ./core/deps/llvm/build/libexec
- ./core/deps/llvm/build/share
- key: ${{ needs.build_llvm_libraries.outputs.cache_key }}
- - name: Quit if cache miss
- if: contains(matrix.wamr_test_option.mode, 'aot') && steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
- run: echo "::error::can not get prebuilt llvm libraries" && exit 1
- - name: Copy LLVM
- if: contains(matrix.wamr_test_option.mode, 'aot')
- run: cp -r core/deps/llvm apps/interpreters/wamr/wamr/core/deps/llvm
- # Inject the config option to NuttX
- # TODO: Merge this into NuttX once GC is generally available
- - name: Modify Kconfig
- run: |
- echo "\n" >> apps/interpreters/wamr/Kconfig
- echo "config INTERPRETERS_WAMR_GC" >> apps/interpreters/wamr/Kconfig
- echo "\tbool \"Enable GC\"" >> apps/interpreters/wamr/Kconfig
- echo "\tdefault n" >> apps/interpreters/wamr/Kconfig
- echo "\n" >> apps/interpreters/wamr/Kconfig
- echo "config INTERPRETERS_WAMR_AOT_STACK_FRAME" >> apps/interpreters/wamr/Kconfig
- echo "\tbool \"Enable AOT stack frame\"" >> apps/interpreters/wamr/Kconfig
- echo "\tdefault n" >> apps/interpreters/wamr/Kconfig
- echo "\n" >> apps/interpreters/wamr/Kconfig
- echo "config INTERPRETERS_WAMR_TAIL_CALL" >> apps/interpreters/wamr/Kconfig
- echo "\tbool \"Enable Tail Call\"" >> apps/interpreters/wamr/Kconfig
- echo "\tdefault y" >> apps/interpreters/wamr/Kconfig
- - name: Enable WAMR for NuttX
- run: |
- find nuttx/boards -name defconfig | xargs sed -i '$a\${{ env.WAMR_COMMON_OPTION }}'
-
- - name: Enable WAMR Interpreter for NuttX
- run: |
- find nuttx/boards -name defconfig | xargs sed -i '$a\${{ matrix.wamr_test_option.option }}'
- - name: Enable WAMR Feature for NuttX
- if: matrix.wamr_feature_option.option != ''
- run: |
- find nuttx/boards -name defconfig | xargs sed -i '$a\${{ matrix.wamr_feature_option.option }}'
- - name: Disable FPU for NuttX
- if: matrix.target_config.fpu_type == 'none'
- run: |
- find nuttx/boards -name defconfig | xargs sed -i '$a\# CONFIG_ARCH_FPU is not set\n'
- - name: Disable DPFPU for NuttX
- if: matrix.target_config.fpu_type == 'fp'
- run: |
- find nuttx/boards -name defconfig | xargs sed -i '$a\# CONFIG_ARCH_DPFPU is not set\n'
- - name: Build wamrc
- if: contains(matrix.wamr_test_option.mode, 'aot')
- working-directory: apps/interpreters/wamr/wamr/wamr-compiler
- run: |
- cmake -Bbuild .
- cmake --build build
- - name: Build
- id: build_firmware
- run: |
- cd nuttx
- tools/configure.sh ${{ matrix.target_config.config }}
- make -j$(nproc)
- echo "firmware=$PWD/nuttx" >> $GITHUB_OUTPUT
-
- - name: Test
- run: |
- cd apps/interpreters/wamr/wamr/tests/wamr-test-suites
- ./test_wamr.sh -s spec ${{ matrix.wamr_test_option.mode }} -m ${{ matrix.target_config.target }} -b -Q -P -F ${{ steps.build_firmware.outputs.firmware }} ${{ matrix.wamr_feature_option.mode}}
|