linux.yml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. name: Linux
  4. # Controls when the action will run. Triggers the workflow on push or pull request
  5. # events but only for the main branch
  6. on:
  7. # triggers on every branch
  8. push:
  9. paths-ignore:
  10. - 'doc/**'
  11. # triggers on every PR
  12. pull_request:
  13. paths-ignore:
  14. - 'doc/**'
  15. jobs:
  16. build:
  17. runs-on: ${{ matrix.os }}
  18. strategy:
  19. matrix:
  20. os: [ubuntu-18.04, ubuntu-20.04]
  21. steps:
  22. - uses: actions/checkout@v2
  23. - name: Build iwasm [default]
  24. run: |
  25. cd product-mini/platforms/linux
  26. mkdir build && cd build
  27. cmake ..
  28. make -j $(nproc)
  29. cd .. && rm -rf build
  30. - name: Build iwasm [classic interp]
  31. run: |
  32. cd product-mini/platforms/linux
  33. mkdir build && cd build
  34. cmake .. -DWAMR_BUILD_FAST_INTERP=0
  35. make -j $(nproc)
  36. cd .. && rm -rf build
  37. - name: Build iwasm [multi module]
  38. run: |
  39. cd product-mini/platforms/linux
  40. mkdir build && cd build
  41. cmake .. -DWAMR_BUILD_MULTI_MODULE=1
  42. make -j $(nproc)
  43. cd .. && rm -rf build
  44. - name: Build iwasm [lib-pthread]
  45. run: |
  46. cd product-mini/platforms/linux
  47. mkdir build && cd build
  48. cmake .. -DWAMR_BUILD_LIB_PTHREAD=1
  49. make -j $(nproc)
  50. cd .. && rm -rf build
  51. - name: Build iwasm [aot only]
  52. run: |
  53. cd product-mini/platforms/linux
  54. mkdir build && cd build
  55. cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0
  56. make -j $(nproc)
  57. cd .. && rm -rf build
  58. - name: Build iwasm [interp only]
  59. run: |
  60. cd product-mini/platforms/linux
  61. mkdir build && cd build
  62. cmake .. -DWAMR_BUILD_AOT=0
  63. make -j $(nproc)
  64. cd .. && rm -rf build
  65. - name: Build iwasm [memory profiling]
  66. run: |
  67. cd product-mini/platforms/linux
  68. mkdir build && cd build
  69. cmake .. -DWAMR_BUILD_MEMORY_PROFILING=1
  70. make -j $(nproc)
  71. cd .. && rm -rf build
  72. - name: Build iwasm [tail call]
  73. run: |
  74. cd product-mini/platforms/linux
  75. mkdir build && cd build
  76. cmake .. -DWAMR_BUILD_TAIL_CALL=1
  77. make -j $(nproc)
  78. cd .. && rm -rf build
  79. - name: Build iwasm [custom name section]
  80. run: |
  81. cd product-mini/platforms/linux
  82. mkdir build && cd build
  83. cmake .. -DWAMR_BUILD_CUSTOM_NAME_SECTION=1
  84. make -j $(nproc)
  85. cd .. && rm -rf build
  86. - name: Build iwasm [disable hardware boundary check]
  87. run: |
  88. cd product-mini/platforms/linux
  89. mkdir build && cd build
  90. cmake .. -DWAMR_DISABLE_HW_BOUND_CHECK=1
  91. make -j $(nproc)
  92. cd .. && rm -rf build
  93. - name: Build iwasm [reference types]
  94. run: |
  95. cd product-mini/platforms/linux
  96. mkdir build && cd build
  97. cmake .. -DWAMR_BUILD_REF_TYPES=1
  98. make -j $(nproc)
  99. cd .. && rm -rf build
  100. - name: Build iwasm [128-bit SIMD]
  101. run: |
  102. cd product-mini/platforms/linux
  103. mkdir build && cd build
  104. cmake .. -DWAMR_BUILD_SIMD=1
  105. make -j $(nproc)
  106. cd .. && rm -rf build
  107. - name: Cache LLVM libraries
  108. uses: actions/cache@v2
  109. id: cache_llvm
  110. env:
  111. cache-name: llvm_libraries
  112. with:
  113. path: ./core/deps/llvm
  114. key: ${{ runner.os }}-build-${{env.cache-name}}
  115. restore-keys: ${{ runner.os }}-build-${{env.cache-name}}
  116. - name: Build llvm and clang from source
  117. if: steps.cache_llvm.outputs.cache-hit != 'true'
  118. run: |
  119. cd wamr-compiler
  120. ./build_llvm.sh
  121. - name: Build wamrc
  122. run: |
  123. cd wamr-compiler
  124. mkdir build && cd build
  125. cmake ..
  126. make -j $(nproc)
  127. cd ..
  128. - name: download and install wasi-sdk
  129. run: |
  130. cd /opt
  131. wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  132. tar -xzf wasi-sdk-12.0-linux.tar.gz
  133. mv wasi-sdk-12.0 wasi-sdk
  134. rm wasi-sdk-12.0-linux.tar.gz
  135. - name: download and install wabt
  136. run: |
  137. cd /opt
  138. wget https://github.com/WebAssembly/wabt/releases/download/1.0.23/wabt-1.0.23-ubuntu.tar.gz
  139. tar -xzf wabt-1.0.23-ubuntu.tar.gz
  140. mv wabt-1.0.23 wabt
  141. rm wabt-1.0.23-ubuntu.tar.gz
  142. - name: Build Sample [wasm-c-api]
  143. run: |
  144. cd samples/wasm-c-api
  145. mkdir build && cd build
  146. cmake ..
  147. make -j $(nproc)
  148. ./callback
  149. ./callback_chain
  150. ./global
  151. ./hello
  152. ./hostref
  153. ./memory
  154. ./reflect
  155. ./table
  156. ./trap
  157. cd .. && rm -r build
  158. - name: Build Sample [wasm-c-api] [Jit]
  159. run: |
  160. cd samples/wasm-c-api
  161. mkdir build && cd build
  162. cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1 ..
  163. make -j $(nproc)
  164. ./callback
  165. ./callback_chain
  166. ./global
  167. ./hello
  168. ./hostref
  169. ./memory
  170. ./reflect
  171. ./table
  172. ./trap
  173. cd .. && rm -r build
  174. - name: Build Sample [wasm-c-api] [Aot]
  175. run: |
  176. cd samples/wasm-c-api
  177. mkdir build && cd build
  178. cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=1 ..
  179. make -j $(nproc)
  180. ./callback
  181. ./callback_chain
  182. ./global
  183. ./hello
  184. ./hostref
  185. ./memory
  186. ./reflect
  187. ./table
  188. ./trap
  189. cd .. && rm -r build
  190. - name: Build Sample [basic]
  191. run: |
  192. cd samples/basic
  193. ./build.sh
  194. ./run.sh
  195. - name: Build Sample [multi-thread]
  196. run: |
  197. cd samples/multi-thread
  198. mkdir build && cd build
  199. cmake ..
  200. make -j $(nproc)
  201. ./iwasm wasm-apps/test.wasm
  202. - name: Build Sample [multi-module]
  203. run: |
  204. cd samples/multi-module
  205. mkdir build && cd build
  206. cmake ..
  207. make -j $(nproc)
  208. ./multi_module
  209. - name: Build Sample [spawn-thread]
  210. run: |
  211. cd samples/spawn-thread
  212. mkdir build && cd build
  213. cmake ..
  214. make -j $(nproc)
  215. ./spawn_thread
  216. - name: Build Sample [ref-types]
  217. run: |
  218. cd samples/ref-types
  219. mkdir build && cd build
  220. cmake ..
  221. make -j $(nproc)
  222. ./hello