compilation_on_android_ubuntu_macos.yml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. name: compilation on android, ubuntu-18.04, ubuntu-20.04, macos-latest
  4. on:
  5. # will be triggered on PR events
  6. pull_request:
  7. paths-ignore:
  8. - "assembly-script/**"
  9. - "ci/**"
  10. - "doc/**"
  11. - "test-tools/**"
  12. # will be triggered on push events
  13. push:
  14. paths-ignore:
  15. - "assembly-script/**"
  16. - "ci/**"
  17. - "doc/**"
  18. - "test-tools/**"
  19. # allow to be triggered manually
  20. workflow_dispatch:
  21. # Cancel any in-flight jobs for the same PR/branch so there's only one active
  22. # at a time
  23. concurrency:
  24. group: ${{ github.workflow }}-${{ github.ref }}
  25. cancel-in-progress: true
  26. env:
  27. AOT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
  28. CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
  29. FAST_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
  30. LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
  31. MC_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
  32. LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
  33. jobs:
  34. # Cancel any in-flight jobs for the same PR/branch so there's only one active
  35. # at a time
  36. cancel_previous:
  37. runs-on: ${{ matrix.os }}
  38. strategy:
  39. matrix:
  40. os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
  41. steps:
  42. - name: Cancel Workflow Action
  43. uses: styfle/cancel-workflow-action@0.6.0
  44. with:
  45. access_token: ${{ github.token }}
  46. # set different traffic lights based on the current repo and the running OS.
  47. # according to light colors, the workflow will run different jobs
  48. check_repo:
  49. needs: cancel_previous
  50. runs-on: ${{ matrix.os }}
  51. strategy:
  52. matrix:
  53. os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
  54. outputs:
  55. traffic_light_on_ubuntu_1804: ${{ steps.do_check_on_ubuntu_1804.outputs.light }}
  56. traffic_light_on_ubuntu_2004: ${{ steps.do_check_on_ubuntu_2004.outputs.light }}
  57. traffic_light_on_macos_latest: ${{ steps.do_check_on_macos_latest.outputs.light }}
  58. steps:
  59. - name: do_check_on_ubuntu_1804
  60. id: do_check_on_ubuntu_1804
  61. if: ${{ matrix.os == 'ubuntu-18.04' }}
  62. run: |
  63. if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
  64. echo "::set-output name=light::green"
  65. else
  66. echo "::set-output name=light::red"
  67. fi
  68. - name: do_check_on_ubuntu_2004
  69. id: do_check_on_ubuntu_2004
  70. if: ${{ matrix.os == 'ubuntu-20.04' }}
  71. run: |
  72. if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
  73. echo "::set-output name=light::green"
  74. else
  75. echo "::set-output name=light::green"
  76. fi
  77. - name: do_check_on_macos_latest
  78. id: do_check_on_macos_latest
  79. if: ${{ matrix.os == 'macos-latest' }}
  80. run: |
  81. if [[ ${{ github.repository }} == */wasm-micro-runtime ]]; then
  82. echo "::set-output name=light::green"
  83. else
  84. echo "::set-output name=light::red"
  85. fi
  86. build_llvm_libraries:
  87. needs: check_repo
  88. runs-on: ${{ matrix.os }}
  89. strategy:
  90. matrix:
  91. os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
  92. include:
  93. - os: ubuntu-18.04
  94. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
  95. - os: ubuntu-20.04
  96. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
  97. - os: macos-latest
  98. light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
  99. steps:
  100. - name: light status
  101. run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
  102. - name: checkout
  103. if: ${{ matrix.light == 'green' }}
  104. uses: actions/checkout@v2
  105. - name: Cache LLVM libraries
  106. id: cache_llvm
  107. if: ${{ matrix.light == 'green' }}
  108. uses: actions/cache@v2
  109. with:
  110. path: |
  111. ./core/deps/llvm/build/bin
  112. ./core/deps/llvm/build/include
  113. ./core/deps/llvm/build/lib
  114. ./core/deps/llvm/build/libexec
  115. ./core/deps/llvm/build/share
  116. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  117. - name: Build llvm and clang from source on ubuntu
  118. id: build_llvm_ubuntu
  119. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os != 'macos-latest' }}
  120. run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly --project clang lldb
  121. working-directory: build-scripts
  122. - name: Build llvm and clang from source on macos
  123. id: build_llvm_macos
  124. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' }}
  125. run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly
  126. working-directory: build-scripts
  127. build_wamrc:
  128. needs: [build_llvm_libraries, check_repo]
  129. runs-on: ${{ matrix.os }}
  130. strategy:
  131. matrix:
  132. os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
  133. include:
  134. - os: ubuntu-18.04
  135. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
  136. - os: ubuntu-20.04
  137. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
  138. - os: macos-latest
  139. light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
  140. steps:
  141. - name: light status
  142. run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
  143. - name: checkout
  144. if: ${{ matrix.light == 'green' }}
  145. uses: actions/checkout@v2
  146. - name: Get LLVM libraries
  147. id: cache_llvm
  148. if: ${{ matrix.light == 'green' }}
  149. uses: actions/cache@v2
  150. with:
  151. path: |
  152. ./core/deps/llvm/build/bin
  153. ./core/deps/llvm/build/include
  154. ./core/deps/llvm/build/lib
  155. ./core/deps/llvm/build/libexec
  156. ./core/deps/llvm/build/share
  157. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  158. - name: Quit if cache miss
  159. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
  160. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  161. - name: Build wamrc
  162. if: ${{ matrix.light == 'green' }}
  163. run: |
  164. mkdir build && cd build
  165. cmake ..
  166. cmake --build . --config Release --parallel 4
  167. working-directory: wamr-compiler
  168. build_iwasm:
  169. needs: [build_llvm_libraries, check_repo]
  170. runs-on: ${{ matrix.os }}
  171. strategy:
  172. matrix:
  173. make_options_run_mode: [
  174. # Running mode
  175. $CLASSIC_INTERP_BUILD_OPTIONS,
  176. $FAST_INTERP_BUILD_OPTIONS,
  177. $LAZY_JIT_BUILD_OPTIONS,
  178. $MC_JIT_BUILD_OPTIONS,
  179. $AOT_BUILD_OPTIONS,
  180. ]
  181. make_options_feature: [
  182. # Features
  183. "-DWAMR_BUILD_CUSTOM_NAME_SECTION=1",
  184. "-DWAMR_BUILD_DEBUG_AOT=1",
  185. "-DWAMR_BUILD_DEBUG_INTERP=1",
  186. "-DWAMR_BUILD_DUMP_CALL_STACK=1",
  187. "-DWAMR_BUILD_LIB_PTHREAD=1",
  188. "-DWAMR_BUILD_MINI_LOADER=1",
  189. "-DWAMR_BUILD_MEMORY_PROFILING=1",
  190. "-DWAMR_BUILD_MULTI_MODULE=1",
  191. "-DWAMR_BUILD_PERF_PROFILING=1",
  192. "-DWAMR_BUILD_REF_TYPES=1",
  193. "-DWAMR_BUILD_SIMD=1",
  194. "-DWAMR_BUILD_TAIL_CALL=1",
  195. "-DWAMR_DISABLE_HW_BOUND_CHECK=1",
  196. ]
  197. os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
  198. platform: [android, linux, darwin]
  199. exclude:
  200. # uncompatiable os and platform
  201. # ubuntu can not go with darwin
  202. - os: ubuntu-18.04
  203. platform: darwin
  204. - os: ubuntu-20.04
  205. platform: darwin
  206. # macos can not go with android, linux
  207. - os: macos-latest
  208. platform: android
  209. - os: macos-latest
  210. platform: linux
  211. # uncompatiable feature and platform
  212. - os: macos-latest
  213. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  214. # uncompatiable mode and feature
  215. # MULTI_MODULE only on INTERP mode
  216. - make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
  217. make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
  218. - make_options_run_mode: $AOT_BUILD_OPTIONS
  219. make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
  220. - make_options_run_mode: $MC_JIT_BUILD_OPTIONS
  221. make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
  222. # SIMD only on JIT/AOT mode
  223. - make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
  224. make_options_feature: "-DWAMR_BUILD_SIMD=1"
  225. - make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
  226. make_options_feature: "-DWAMR_BUILD_SIMD=1"
  227. # DEBUG_INTERP only on CLASSIC INTERP mode
  228. - make_options_run_mode: $AOT_BUILD_OPTIONS
  229. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  230. - make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
  231. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  232. - make_options_run_mode: $MC_JIT_BUILD_OPTIONS
  233. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  234. - make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
  235. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  236. # DEBUG_AOT only on JIT/AOT mode
  237. - make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
  238. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  239. - make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
  240. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  241. # TODO: DEBUG_AOT on JIT
  242. - make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
  243. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  244. - make_options_run_mode: $MC_JIT_BUILD_OPTIONS
  245. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  246. # MINI_LOADER only on INTERP mode
  247. - make_options_run_mode: $AOT_BUILD_OPTIONS
  248. make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
  249. - make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
  250. make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
  251. - make_options_run_mode: $MC_JIT_BUILD_OPTIONS
  252. make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
  253. include:
  254. - os: ubuntu-18.04
  255. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
  256. - os: ubuntu-20.04
  257. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
  258. - os: macos-latest
  259. light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
  260. steps:
  261. - name: light status
  262. run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
  263. - name: checkout
  264. if: ${{ matrix.light == 'green' }}
  265. uses: actions/checkout@v2
  266. - name: Get LLVM libraries
  267. id: cache_llvm
  268. if: ${{ matrix.light == 'green' }}
  269. uses: actions/cache@v2
  270. with:
  271. path: |
  272. ./core/deps/llvm/build/bin
  273. ./core/deps/llvm/build/include
  274. ./core/deps/llvm/build/lib
  275. ./core/deps/llvm/build/libexec
  276. ./core/deps/llvm/build/share
  277. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  278. - name: Quit if cache miss
  279. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
  280. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  281. - name: Build iwasm
  282. if: ${{ matrix.light == 'green' }}
  283. run: |
  284. mkdir build && cd build
  285. cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
  286. cmake --build . --config Release --parallel 4
  287. working-directory: product-mini/platforms/${{ matrix.platform }}
  288. build_samples_wasm_c_api:
  289. needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
  290. runs-on: ${{ matrix.os }}
  291. strategy:
  292. matrix:
  293. make_options: [
  294. # Running mode
  295. $CLASSIC_INTERP_BUILD_OPTIONS,
  296. $FAST_INTERP_BUILD_OPTIONS,
  297. $LAZY_JIT_BUILD_OPTIONS,
  298. $MC_JIT_BUILD_OPTIONS,
  299. $AOT_BUILD_OPTIONS,
  300. ]
  301. os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
  302. include:
  303. - os: ubuntu-18.04
  304. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
  305. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  306. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
  307. - os: ubuntu-20.04
  308. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
  309. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  310. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
  311. - os: macos-latest
  312. light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
  313. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
  314. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz
  315. exclude:
  316. # TODO: a .aot compatiable problem
  317. - os: macos-latest
  318. make_options: $LAZY_JIT_BUILD_OPTIONS
  319. - os: macos-latest
  320. make_options: $AOT_BUILD_OPTIONS
  321. - os: macos-latest
  322. make_options: $MC_JIT_BUILD_OPTIONS
  323. steps:
  324. - name: light status
  325. run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
  326. - name: checkout
  327. if: ${{ matrix.light == 'green' }}
  328. uses: actions/checkout@v2
  329. - name: Get LLVM libraries
  330. id: cache_llvm
  331. if: ${{ matrix.light == 'green' }}
  332. uses: actions/cache@v2
  333. with:
  334. path: |
  335. ./core/deps/llvm/build/bin
  336. ./core/deps/llvm/build/include
  337. ./core/deps/llvm/build/lib
  338. ./core/deps/llvm/build/libexec
  339. ./core/deps/llvm/build/share
  340. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  341. - name: Quit if cache miss
  342. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
  343. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  344. - name: download and install wabt
  345. if: ${{ matrix.light == 'green' }}
  346. run: |
  347. cd /opt
  348. sudo wget ${{ matrix.wabt_release }}
  349. sudo tar -xzf wabt-1.0.24-*.tar.gz
  350. sudo mv wabt-1.0.24 wabt
  351. - name: Build wamrc
  352. if: ${{ matrix.light == 'green' }}
  353. run: |
  354. mkdir build && cd build
  355. cmake ..
  356. cmake --build . --config Release --parallel 4
  357. working-directory: wamr-compiler
  358. - name: Build Sample [wasm-c-api]
  359. if: ${{ matrix.light == 'green' }}
  360. run: |
  361. mkdir build && cd build
  362. cmake .. ${{ matrix.make_options }}
  363. cmake --build . --config Release --parallel 4
  364. ./callback
  365. ./callback_chain
  366. ./empty_imports
  367. ./global
  368. ./hello
  369. ./hostref
  370. ./memory
  371. ./reflect
  372. ./table
  373. ./trap
  374. working-directory: samples/wasm-c-api
  375. build_samples_others:
  376. needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
  377. runs-on: ${{ matrix.os }}
  378. strategy:
  379. matrix:
  380. include:
  381. - os: ubuntu-18.04
  382. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
  383. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  384. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
  385. - os: ubuntu-20.04
  386. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
  387. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  388. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
  389. - os: macos-latest
  390. light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
  391. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
  392. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz
  393. steps:
  394. - name: light status
  395. run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
  396. - name: checkout
  397. if: ${{ matrix.light == 'green' }}
  398. uses: actions/checkout@v2
  399. - name: Get LLVM libraries
  400. id: cache_llvm
  401. if: ${{ matrix.light == 'green' }}
  402. uses: actions/cache@v2
  403. with:
  404. path: |
  405. ./core/deps/llvm/build/bin
  406. ./core/deps/llvm/build/include
  407. ./core/deps/llvm/build/lib
  408. ./core/deps/llvm/build/libexec
  409. ./core/deps/llvm/build/share
  410. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  411. - name: Quit if cache miss
  412. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
  413. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  414. - name: download and install wasi-sdk
  415. if: ${{ matrix.light == 'green' }}
  416. run: |
  417. cd /opt
  418. sudo wget ${{ matrix.wasi_sdk_release }}
  419. sudo tar -xzf wasi-sdk-12.0-*.tar.gz
  420. sudo mv wasi-sdk-12.0 wasi-sdk
  421. - name: download and install wabt
  422. if: ${{ matrix.light == 'green' }}
  423. run: |
  424. cd /opt
  425. sudo wget ${{ matrix.wabt_release }}
  426. sudo tar -xzf wabt-1.0.24-*.tar.gz
  427. sudo mv wabt-1.0.24 wabt
  428. - name: Build wamrc
  429. if: ${{ matrix.light == 'green' }}
  430. run: |
  431. mkdir build && cd build
  432. cmake ..
  433. cmake --build . --config Release --parallel 4
  434. working-directory: wamr-compiler
  435. - name: Build Sample [basic]
  436. if: ${{ matrix.light == 'green' }}
  437. run: |
  438. cd samples/basic
  439. ./build.sh
  440. ./run.sh
  441. - name: Build Sample [multi-thread]
  442. if: ${{ matrix.light == 'green' }}
  443. run: |
  444. cd samples/multi-thread
  445. mkdir build && cd build
  446. cmake ..
  447. cmake --build . --config Release --parallel 4
  448. ./iwasm wasm-apps/test.wasm
  449. - name: Build Sample [multi-module]
  450. if: ${{ matrix.light == 'green' }}
  451. run: |
  452. cd samples/multi-module
  453. mkdir build && cd build
  454. cmake ..
  455. cmake --build . --config Release --parallel 4
  456. ./multi_module
  457. - name: Build Sample [spawn-thread]
  458. if: ${{ matrix.light == 'green' }}
  459. run: |
  460. cd samples/spawn-thread
  461. mkdir build && cd build
  462. cmake ..
  463. cmake --build . --config Release --parallel 4
  464. ./spawn_thread
  465. - name: Build Sample [ref-types]
  466. if: ${{ matrix.light == 'green' }}
  467. run: |
  468. cd samples/ref-types
  469. mkdir build && cd build
  470. cmake ..
  471. cmake --build . --config Release --parallel 4
  472. ./hello