linux.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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
  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
  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
  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
  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
  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
  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
  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
  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
  85. cd .. && rm -rf build
  86. - name: Cache LLVM libraries
  87. uses: actions/cache@v2
  88. id: cache_llvm
  89. env:
  90. cache-name: llvm_libraries
  91. with:
  92. path: ./core/deps/llvm
  93. key: ${{ runner.os }}-build-${{env.cache-name}}
  94. restore-keys: ${{ runner.os }}-build-${{env.cache-name}}
  95. - name: Build llvm and clang from source
  96. if: steps.cache_llvm.outputs.cache-hit != 'true'
  97. run: |
  98. cd wamr-compiler
  99. ./build_llvm.sh
  100. - name: Build wamrc
  101. run: |
  102. cd wamr-compiler
  103. mkdir build && cd build
  104. cmake ..
  105. make
  106. cd ..
  107. - name: download and install wasi-sdk
  108. run: |
  109. cd /opt
  110. wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  111. tar -xzf wasi-sdk-12.0-linux.tar.gz
  112. mv wasi-sdk-12.0 wasi-sdk
  113. rm wasi-sdk-12.0-linux.tar.gz
  114. - name: download and install wabt
  115. run: |
  116. cd /opt
  117. wget https://github.com/WebAssembly/wabt/releases/download/1.0.23/wabt-1.0.23-ubuntu.tar.gz
  118. tar -xzf wabt-1.0.23-ubuntu.tar.gz
  119. mv wabt-1.0.23 wabt
  120. rm wabt-1.0.23-ubuntu.tar.gz
  121. - name: Build Sample [wasm-c-api]
  122. run: |
  123. cd samples/wasm-c-api
  124. mkdir build && cd build
  125. cmake ..
  126. make
  127. ./callback
  128. ./callback_chain
  129. ./global
  130. ./hello
  131. ./reflect
  132. ./trap
  133. cd .. && rm -r build
  134. - name: Build Sample [wasm-c-api] [Jit]
  135. run: |
  136. cd samples/wasm-c-api
  137. mkdir build && cd build
  138. cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1 ..
  139. make
  140. ./callback
  141. ./callback_chain
  142. ./global
  143. ./hello
  144. ./reflect
  145. ./trap
  146. cd .. && rm -r build
  147. - name: Build Sample [wasm-c-api] [Aot]
  148. run: |
  149. cd samples/wasm-c-api
  150. mkdir build && cd build
  151. cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=1 ..
  152. make
  153. ./callback
  154. ./callback_chain
  155. ./global
  156. ./hello
  157. ./reflect
  158. ./trap
  159. cd .. && rm -r build
  160. - name: Build Sample [basic]
  161. run: |
  162. cd samples/basic
  163. ./build.sh
  164. ./run.sh
  165. - name: Build Sample [multi-thread]
  166. run: |
  167. cd samples/multi-thread
  168. mkdir build && cd build
  169. cmake ..
  170. make
  171. ./iwasm wasm-apps/test.wasm
  172. - name: Build Sample [multi-module]
  173. run: |
  174. cd samples/multi-module
  175. mkdir build && cd build
  176. cmake ..
  177. make
  178. ./multi_module
  179. - name: Build Sample [spawn-thread]
  180. run: |
  181. cd samples/spawn-thread
  182. mkdir build && cd build
  183. cmake ..
  184. make
  185. ./spawn_thread