2022-09-02 03:07:59 +00:00
|
|
|
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
|
|
|
|
name: compilation on nuttx
|
|
|
|
|
|
|
|
on:
|
|
|
|
# will be triggered on PR events
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- "assembly-script/**"
|
|
|
|
- "ci/**"
|
|
|
|
- "doc/**"
|
|
|
|
- "test-tools/**"
|
|
|
|
# will be triggered on push events
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "assembly-script/**"
|
|
|
|
- "ci/**"
|
|
|
|
- "doc/**"
|
|
|
|
- "test-tools/**"
|
|
|
|
# allow to be triggered manually
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# Cancel any in-flight jobs for the same PR/branch so there's only one active
|
|
|
|
# at a time
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# Cancel any in-flight jobs for the same PR/branch so there's only one active
|
|
|
|
# at a time
|
|
|
|
cancel_previous:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- name: Cancel Workflow Action
|
|
|
|
uses: styfle/cancel-workflow-action@0.9.1
|
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
|
|
|
|
|
|
|
build_iwasm_on_nuttx:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
nuttx_board_config : [
|
2022-09-05 04:12:32 +00:00
|
|
|
# x64
|
|
|
|
"boards/sim/sim/sim/configs/nsh",
|
|
|
|
# cortex-m0
|
|
|
|
"boards/arm/rp2040/raspberrypi-pico/configs/nsh",
|
|
|
|
# cortex-m4
|
|
|
|
"boards/arm/stm32/stm32f4discovery/configs/nsh",
|
|
|
|
# cortex-m7
|
|
|
|
"boards/arm/stm32h7/nucleo-h743zi/configs/nsh",
|
|
|
|
# cortex-a9
|
|
|
|
"boards/arm/imx6/sabre-6quad/configs/nsh",
|
|
|
|
# riscv32imac
|
|
|
|
"boards/risc-v/qemu-rv/rv-virt/configs/nsh",
|
|
|
|
# riscv64imac
|
|
|
|
"boards/risc-v/qemu-rv/rv-virt/configs/nsh64",
|
|
|
|
# riscv64gc
|
|
|
|
"boards/risc-v/k210/maix-bit/configs/nsh",
|
2022-09-02 03:07:59 +00:00
|
|
|
]
|
|
|
|
wamr_config_option: [
|
|
|
|
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
|
|
|
|
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
|
2022-09-05 04:12:32 +00:00
|
|
|
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
|
2022-09-02 03:07:59 +00:00
|
|
|
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
|
|
|
|
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\n",
|
2022-09-05 04:12:32 +00:00
|
|
|
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
|
|
|
|
"CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
|
2022-09-02 03:07:59 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
steps:
|
2022-09-05 04:12:32 +00:00
|
|
|
- name: Install Utilities
|
2022-09-29 04:31:56 +00:00
|
|
|
run: |
|
|
|
|
sudo apt install -y kconfig-frontends-nox genromfs
|
|
|
|
pip3 install pyelftools
|
|
|
|
pip3 install cxxfilt
|
2022-09-05 04:12:32 +00:00
|
|
|
|
|
|
|
- name: Install ARM Compilers
|
|
|
|
if: ${{ contains(matrix.nuttx_board_config, 'arm') }}
|
|
|
|
run: sudo apt install -y gcc-arm-none-eabi
|
|
|
|
|
|
|
|
- name: Install RISC-V Compilers
|
|
|
|
if: ${{ contains(matrix.nuttx_board_config, 'risc-v') }}
|
|
|
|
run: sudo apt install -y gcc-riscv64-unknown-elf
|
2022-09-02 03:07:59 +00:00
|
|
|
|
|
|
|
- name: Checkout NuttX
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: apache/incubator-nuttx
|
|
|
|
path: nuttx
|
|
|
|
|
|
|
|
- name: Checkout NuttX Apps
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: apache/incubator-nuttx-apps
|
|
|
|
path: apps
|
|
|
|
|
|
|
|
- name: Checkout WAMR
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: ${{ github.repository }}
|
|
|
|
path: apps/interpreters/wamr/wamr
|
|
|
|
|
|
|
|
- name: Enable WAMR for NuttX
|
2022-09-05 04:12:32 +00:00
|
|
|
run: |
|
|
|
|
find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_CR=y\n${{ matrix.wamr_config_option }}'
|
|
|
|
find nuttx/boards/sim -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
|
|
|
|
find nuttx/boards/risc-v -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
|
2022-09-02 03:07:59 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd nuttx
|
|
|
|
tools/configure.sh ${{ matrix.nuttx_board_config }}
|
|
|
|
make -j$(nproc)
|