compilation_on_nuttx.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. # will be triggered on push events
  21. push:
  22. branches:
  23. - main
  24. - "dev/**"
  25. paths:
  26. - ".github/workflows/compilation_on_nuttx.yml"
  27. - "build-scripts/**"
  28. - "core/**"
  29. - "!core/deps/**"
  30. - "product-mini/**"
  31. - "samples/**"
  32. - "!samples/workload/**"
  33. - "tests/wamr-test-suites/**"
  34. - "wamr-compiler/**"
  35. # allow to be triggered manually
  36. workflow_dispatch:
  37. # Cancel any in-flight jobs for the same PR/branch so there's only one active
  38. # at a time
  39. concurrency:
  40. group: ${{ github.workflow }}-${{ github.ref }}
  41. cancel-in-progress: true
  42. env:
  43. WASI_SDK_PATH: "/opt/wasi-sdk"
  44. jobs:
  45. build_iwasm_on_nuttx:
  46. runs-on: ubuntu-latest
  47. container:
  48. image: ghcr.io/apache/nuttx/apache-nuttx-ci-linux@sha256:d9261eacf6c6ebe656c571757751c803e8f04c3ae9b820320a5ea5dd57b7205a
  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. # riscv32gc
  59. "boards/risc-v/qemu-rv/rv-virt/configs/nsh",
  60. # riscv64gc
  61. "boards/risc-v/qemu-rv/rv-virt/configs/nsh64",
  62. # arm64
  63. "boards/arm64/qemu/qemu-armv8a/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: Checkout NuttX
  79. uses: actions/checkout@v4
  80. with:
  81. repository: apache/incubator-nuttx
  82. ref: releases/12.4
  83. path: nuttx
  84. - name: Checkout NuttX Apps
  85. uses: actions/checkout@v4
  86. with:
  87. repository: apache/incubator-nuttx-apps
  88. ref: releases/12.4
  89. path: apps
  90. - name: Checkout WAMR
  91. uses: actions/checkout@v4
  92. with:
  93. repository: ${{ github.repository }}
  94. path: apps/interpreters/wamr/wamr
  95. - name: Enable WAMR for NuttX
  96. run: |
  97. find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_EOL_IS_LF=y\n${{ matrix.wamr_config_option }}'
  98. find nuttx/boards/sim -name defconfig | xargs sed -i '$a\CONFIG_LIBM=y\n'
  99. - name: Build
  100. run: |
  101. cd nuttx
  102. tools/configure.sh ${{ matrix.nuttx_board_config }}
  103. make -j$(nproc) EXTRAFLAGS=-Werror
  104. - name: Checkout Bloaty
  105. uses: actions/checkout@v3
  106. with:
  107. repository: google/bloaty
  108. submodules: recursive
  109. path: bloaty
  110. - name: Build Bloaty
  111. run: |
  112. cmake -Bbuild -GNinja bloaty
  113. cmake --build build
  114. - name: Size Report
  115. run: |
  116. echo "Build target: ${{ matrix.nuttx_board_config }}"
  117. echo "WAMR build config: ${{ matrix.wamr_config_option }}"
  118. echo "WAMR size:"
  119. build/bloaty -d compileunits --source-filter wamr nuttx/nuttx
  120. echo "libc-builtin size (if enabled):"
  121. build/bloaty -d compileunits --source-filter libc-builtin nuttx/nuttx
  122. echo "libc-wasi size (if enabled):"
  123. build/bloaty -d compileunits --source-filter libc-wasi nuttx/nuttx