compilation_on_nuttx.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. name: compilation on nuttx
  4. on:
  5. # will be triggered on PR events
  6. pull_request:
  7. types:
  8. - opened
  9. - synchronize
  10. paths:
  11. - ".github/**"
  12. - "build-scripts/**"
  13. - "core/**"
  14. - "!core/deps/**"
  15. - "product-mini/**"
  16. - "samples/**"
  17. - "!samples/workload/**"
  18. - "tests/wamr-test-suites/**"
  19. - "wamr-compiler/**"
  20. - "wamr-sdk/**"
  21. # will be triggered on push events
  22. push:
  23. branches:
  24. - main
  25. - "dev/**"
  26. paths:
  27. - ".github/**"
  28. - "build-scripts/**"
  29. - "core/**"
  30. - "!core/deps/**"
  31. - "product-mini/**"
  32. - "samples/**"
  33. - "!samples/workload/**"
  34. - "tests/wamr-test-suites/**"
  35. - "wamr-compiler/**"
  36. - "wamr-sdk/**"
  37. # allow to be triggered manually
  38. workflow_dispatch:
  39. # Cancel any in-flight jobs for the same PR/branch so there's only one active
  40. # at a time
  41. concurrency:
  42. group: ${{ github.workflow }}-${{ github.ref }}
  43. cancel-in-progress: true
  44. jobs:
  45. build_iwasm_on_nuttx:
  46. runs-on: ubuntu-22.04
  47. strategy:
  48. matrix:
  49. nuttx_board_config: [
  50. # x64
  51. "boards/sim/sim/sim/configs/nsh",
  52. # cortex-m0
  53. "boards/arm/rp2040/raspberrypi-pico/configs/nsh",
  54. # cortex-m7
  55. "boards/arm/stm32h7/nucleo-h743zi/configs/nsh",
  56. # riscv32imac
  57. "boards/risc-v/qemu-rv/rv-virt/configs/nsh",
  58. # riscv64imac
  59. "boards/risc-v/qemu-rv/rv-virt/configs/nsh64",
  60. # riscv64gc
  61. "boards/risc-v/k210/maix-bit/configs/nsh",
  62. ]
  63. wamr_config_option: [
  64. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
  65. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
  66. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
  67. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
  68. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
  69. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
  70. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
  71. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\n",
  72. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
  73. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
  74. ]
  75. steps:
  76. - name: Install Utilities
  77. run: |
  78. sudo apt install -y kconfig-frontends-nox genromfs
  79. pip3 install pyelftools
  80. pip3 install cxxfilt
  81. - name: Install ARM Compilers
  82. if: contains(matrix.nuttx_board_config, 'arm')
  83. run: sudo apt install -y gcc-arm-none-eabi
  84. - name: Install RISC-V Compilers
  85. if: contains(matrix.nuttx_board_config, 'risc-v')
  86. run: |
  87. 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
  88. tar xvf riscv.tar.gz
  89. echo "$PWD/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_PATH
  90. - name: Checkout NuttX
  91. uses: actions/checkout@v3
  92. with:
  93. repository: apache/incubator-nuttx
  94. path: nuttx
  95. - name: Checkout NuttX Apps
  96. uses: actions/checkout@v3
  97. with:
  98. repository: apache/incubator-nuttx-apps
  99. path: apps
  100. - name: Checkout WAMR
  101. uses: actions/checkout@v3
  102. with:
  103. repository: ${{ github.repository }}
  104. path: apps/interpreters/wamr/wamr
  105. - name: Enable WAMR for NuttX
  106. run: |
  107. find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_LF=y\n${{ matrix.wamr_config_option }}'
  108. find nuttx/boards/sim -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
  109. - name: Build
  110. run: |
  111. cd nuttx
  112. tools/configure.sh ${{ matrix.nuttx_board_config }}
  113. make -j$(nproc) EXTRAFLAGS=-Werror