compilation_on_nuttx.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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/workflows/compilation_on_nuttx.yml"
  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/workflows/compilation_on_nuttx.yml"
  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. env:
  45. WASI_SDK_PATH: "/opt/wasi-sdk"
  46. jobs:
  47. build_iwasm_on_nuttx:
  48. runs-on: ubuntu-22.04
  49. strategy:
  50. matrix:
  51. nuttx_board_config: [
  52. # x64
  53. "boards/sim/sim/sim/configs/nsh",
  54. # cortex-m0
  55. "boards/arm/rp2040/raspberrypi-pico/configs/nsh",
  56. # cortex-m7
  57. "boards/arm/stm32h7/nucleo-h743zi/configs/nsh",
  58. # riscv32imac
  59. "boards/risc-v/qemu-rv/rv-virt/configs/nsh",
  60. # riscv64imac
  61. "boards/risc-v/qemu-rv/rv-virt/configs/nsh64",
  62. # riscv64gc
  63. "boards/risc-v/k210/maix-bit/configs/nsh",
  64. ]
  65. wamr_config_option: [
  66. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
  67. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
  68. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
  69. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
  70. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_WASI=y\\n",
  71. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
  72. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\\n",
  73. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_AOT=y\\n",
  74. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_FAST=y\\n",
  75. "CONFIG_INTERPRETERS_WAMR=y\\nCONFIG_INTERPRETERS_WAMR_CLASSIC=y\\n",
  76. ]
  77. steps:
  78. - name: Install Utilities
  79. run: |
  80. sudo apt install -y kconfig-frontends-nox genromfs
  81. pip3 install pyelftools
  82. pip3 install cxxfilt
  83. - name: Install ARM Compilers
  84. if: contains(matrix.nuttx_board_config, 'arm')
  85. run: sudo apt install -y gcc-arm-none-eabi
  86. - name: Install RISC-V Compilers
  87. if: contains(matrix.nuttx_board_config, 'risc-v')
  88. run: |
  89. curl -L -k 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
  90. tar xvf riscv.tar.gz
  91. echo "$PWD/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_PATH
  92. - name: Install WASI-SDK
  93. run: |
  94. curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz > wasi-sdk.tar.gz
  95. tar xvf wasi-sdk.tar.gz
  96. sudo mv wasi-sdk-* /opt/wasi-sdk
  97. - name: Checkout NuttX
  98. uses: actions/checkout@v3
  99. with:
  100. repository: apache/incubator-nuttx
  101. path: nuttx
  102. - name: Checkout NuttX Apps
  103. uses: actions/checkout@v3
  104. with:
  105. repository: apache/incubator-nuttx-apps
  106. path: apps
  107. - name: Checkout WAMR
  108. uses: actions/checkout@v3
  109. with:
  110. repository: ${{ github.repository }}
  111. path: apps/interpreters/wamr/wamr
  112. - name: Enable WAMR for NuttX
  113. run: |
  114. find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_LF=y\nCONFIG_PSEUDOFS_SOFTLINKS=y\n${{ matrix.wamr_config_option }}'
  115. find nuttx/boards/sim -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
  116. - name: Build
  117. run: |
  118. cd nuttx
  119. tools/configure.sh ${{ matrix.nuttx_board_config }}
  120. make -j$(nproc) EXTRAFLAGS=-Werror