compilation_on_android_ubuntu_macos.yml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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. 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"
  31. 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"
  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: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
  111. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  112. restore-keys: ${{ matrix.os }}-${{env.LLVM_CACHE_SUFFIX }}
  113. - name: Build llvm and clang from source on ubuntu
  114. id: build_llvm_ubuntu
  115. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os != 'macos-latest' }}
  116. run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly --project clang lldb
  117. working-directory: build-scripts
  118. - name: Build llvm and clang from source on macos
  119. id: build_llvm_macos
  120. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' }}
  121. run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly
  122. working-directory: build-scripts
  123. - name: package LLVM
  124. if: ${{ matrix.light == 'green' && (steps.build_llvm_ubuntu.conclusion == 'success' || steps.build_llvm_macos.conclusion == 'success')}}
  125. run: mv LLVM-13.0.0-*.tar.gz LLVM-13.0.0.tar.gz
  126. working-directory: core/deps/llvm/build/
  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: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
  152. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  153. restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  154. - name: Quit if cache miss
  155. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
  156. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  157. - name: Extract the LLVM package
  158. if: ${{ matrix.light == 'green' }}
  159. run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
  160. working-directory: ./core/deps/llvm/build
  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. $JIT_BUILD_OPTIONS,
  178. $LAZY_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. - os: macos-latest
  215. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  216. # uncompatiable mode and feature
  217. # MULTI_MODULE only on INTERP mode
  218. - make_options_run_mode: $JIT_BUILD_OPTIONS
  219. make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
  220. - make_options_run_mode: $AOT_BUILD_OPTIONS
  221. make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
  222. - make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
  223. make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
  224. # SIMD only on JIT/AOT mode
  225. - make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
  226. make_options_feature: "-DWAMR_BUILD_SIMD=1"
  227. - make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
  228. make_options_feature: "-DWAMR_BUILD_SIMD=1"
  229. # DEBUG_INTERP only on CLASSIC INTERP mode
  230. - make_options_run_mode: $AOT_BUILD_OPTIONS
  231. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  232. - make_options_run_mode: $JIT_BUILD_OPTIONS
  233. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  234. - make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
  235. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  236. - make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
  237. make_options_feature: "-DWAMR_BUILD_DEBUG_INTERP=1"
  238. # DEBUG_AOT only on JIT/AOT mode
  239. - make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
  240. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  241. - make_options_run_mode: $FAST_INTERP_BUILD_OPTIONS
  242. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  243. # TODO: DEBUG_AOT on JIT
  244. - make_options_run_mode: $JIT_BUILD_OPTIONS
  245. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  246. - make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
  247. make_options_feature: "-DWAMR_BUILD_DEBUG_AOT=1"
  248. # MINI_LOADER only on INTERP mode
  249. - make_options_run_mode: $AOT_BUILD_OPTIONS
  250. make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
  251. - make_options_run_mode: $JIT_BUILD_OPTIONS
  252. make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
  253. - make_options_run_mode: $LAZY_JIT_BUILD_OPTIONS
  254. make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"
  255. include:
  256. - os: ubuntu-18.04
  257. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
  258. - os: ubuntu-20.04
  259. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
  260. - os: macos-latest
  261. light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
  262. steps:
  263. - name: light status
  264. run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
  265. - name: checkout
  266. if: ${{ matrix.light == 'green' }}
  267. uses: actions/checkout@v2
  268. - name: Get LLVM libraries
  269. id: cache_llvm
  270. if: ${{ matrix.light == 'green' }}
  271. uses: actions/cache@v2
  272. with:
  273. path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
  274. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  275. restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  276. - name: Quit if cache miss
  277. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
  278. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  279. - name: Extract the LLVM package
  280. if: ${{ matrix.light == 'green' }}
  281. run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
  282. working-directory: ./core/deps/llvm/build
  283. - name: Build iwasm
  284. if: ${{ matrix.light == 'green' }}
  285. run: |
  286. mkdir build && cd build
  287. cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
  288. cmake --build . --config Release --parallel 4
  289. working-directory: product-mini/platforms/${{ matrix.platform }}
  290. build_samples_wasm_c_api:
  291. needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
  292. runs-on: ${{ matrix.os }}
  293. strategy:
  294. matrix:
  295. make_options: [
  296. # Running mode
  297. $CLASSIC_INTERP_BUILD_OPTIONS,
  298. $FAST_INTERP_BUILD_OPTIONS,
  299. $JIT_BUILD_OPTIONS,
  300. $LAZY_JIT_BUILD_OPTIONS,
  301. $AOT_BUILD_OPTIONS,
  302. ]
  303. os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
  304. include:
  305. - os: ubuntu-18.04
  306. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
  307. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  308. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
  309. - os: ubuntu-20.04
  310. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
  311. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  312. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
  313. - os: macos-latest
  314. light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
  315. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
  316. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz
  317. exclude:
  318. # TODO: a .aot compatiable problem
  319. - os: macos-latest
  320. make_options: $JIT_BUILD_OPTIONS
  321. - os: macos-latest
  322. make_options: $AOT_BUILD_OPTIONS
  323. - os: macos-latest
  324. make_options: $LAZY_JIT_BUILD_OPTIONS
  325. steps:
  326. - name: light status
  327. run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
  328. - name: checkout
  329. if: ${{ matrix.light == 'green' }}
  330. uses: actions/checkout@v2
  331. - name: Get LLVM libraries
  332. id: cache_llvm
  333. if: ${{ matrix.light == 'green' }}
  334. uses: actions/cache@v2
  335. with:
  336. path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
  337. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  338. restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  339. - name: Quit if cache miss
  340. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
  341. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  342. - name: Extract the LLVM package
  343. if: ${{ matrix.light == 'green' }}
  344. run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
  345. working-directory: ./core/deps/llvm/build
  346. - name: download and install wabt
  347. if: ${{ matrix.light == 'green' }}
  348. run: |
  349. cd /opt
  350. sudo wget ${{ matrix.wabt_release }}
  351. sudo tar -xzf wabt-1.0.24-*.tar.gz
  352. sudo mv wabt-1.0.24 wabt
  353. - name: Build wamrc
  354. if: ${{ matrix.light == 'green' }}
  355. run: |
  356. mkdir build && cd build
  357. cmake ..
  358. cmake --build . --config Release --parallel 4
  359. working-directory: wamr-compiler
  360. - name: Build Sample [wasm-c-api]
  361. if: ${{ matrix.light == 'green' }}
  362. run: |
  363. mkdir build && cd build
  364. cmake .. ${{ matrix.make_options }}
  365. cmake --build . --config Release --parallel 4
  366. ./callback
  367. ./callback_chain
  368. ./empty_imports
  369. ./global
  370. ./hello
  371. ./hostref
  372. ./memory
  373. ./reflect
  374. ./table
  375. ./trap
  376. working-directory: samples/wasm-c-api
  377. build_samples_others:
  378. needs: [build_iwasm, build_llvm_libraries, build_wamrc, check_repo]
  379. runs-on: ${{ matrix.os }}
  380. strategy:
  381. matrix:
  382. include:
  383. - os: ubuntu-18.04
  384. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_1804 }}
  385. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  386. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
  387. - os: ubuntu-20.04
  388. light: ${{ needs.check_repo.outputs.traffic_light_on_ubuntu_2004 }}
  389. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
  390. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-ubuntu.tar.gz
  391. - os: macos-latest
  392. light: ${{ needs.check_repo.outputs.traffic_light_on_macos_latest }}
  393. wasi_sdk_release: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-macos.tar.gz
  394. wabt_release: https://github.com/WebAssembly/wabt/releases/download/1.0.24/wabt-1.0.24-macos.tar.gz
  395. steps:
  396. - name: light status
  397. run: echo "matrix.os=${{ matrix.os }}, light=${{ matrix.light }}"
  398. - name: checkout
  399. if: ${{ matrix.light == 'green' }}
  400. uses: actions/checkout@v2
  401. - name: Get LLVM libraries
  402. id: cache_llvm
  403. if: ${{ matrix.light == 'green' }}
  404. uses: actions/cache@v2
  405. with:
  406. path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
  407. key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  408. restore-keys: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
  409. - name: Quit if cache miss
  410. if: ${{ matrix.light == 'green' && steps.cache_llvm.outputs.cache-hit != 'true' }}
  411. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  412. - name: Extract the LLVM package
  413. if: ${{ matrix.light == 'green' }}
  414. run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
  415. working-directory: ./core/deps/llvm/build
  416. - name: download and install wasi-sdk
  417. if: ${{ matrix.light == 'green' }}
  418. run: |
  419. cd /opt
  420. sudo wget ${{ matrix.wasi_sdk_release }}
  421. sudo tar -xzf wasi-sdk-12.0-*.tar.gz
  422. sudo mv wasi-sdk-12.0 wasi-sdk
  423. - name: download and install wabt
  424. if: ${{ matrix.light == 'green' }}
  425. run: |
  426. cd /opt
  427. sudo wget ${{ matrix.wabt_release }}
  428. sudo tar -xzf wabt-1.0.24-*.tar.gz
  429. sudo mv wabt-1.0.24 wabt
  430. - name: Build wamrc
  431. if: ${{ matrix.light == 'green' }}
  432. run: |
  433. mkdir build && cd build
  434. cmake ..
  435. cmake --build . --config Release --parallel 4
  436. working-directory: wamr-compiler
  437. - name: Build Sample [basic]
  438. if: ${{ matrix.light == 'green' }}
  439. run: |
  440. cd samples/basic
  441. ./build.sh
  442. ./run.sh
  443. - name: Build Sample [multi-thread]
  444. if: ${{ matrix.light == 'green' }}
  445. run: |
  446. cd samples/multi-thread
  447. mkdir build && cd build
  448. cmake ..
  449. cmake --build . --config Release --parallel 4
  450. ./iwasm wasm-apps/test.wasm
  451. - name: Build Sample [multi-module]
  452. if: ${{ matrix.light == 'green' }}
  453. run: |
  454. cd samples/multi-module
  455. mkdir build && cd build
  456. cmake ..
  457. cmake --build . --config Release --parallel 4
  458. ./multi_module
  459. - name: Build Sample [spawn-thread]
  460. if: ${{ matrix.light == 'green' }}
  461. run: |
  462. cd samples/spawn-thread
  463. mkdir build && cd build
  464. cmake ..
  465. cmake --build . --config Release --parallel 4
  466. ./spawn_thread
  467. - name: Build Sample [ref-types]
  468. if: ${{ matrix.light == 'green' }}
  469. run: |
  470. cd samples/ref-types
  471. mkdir build && cd build
  472. cmake ..
  473. cmake --build . --config Release --parallel 4
  474. ./hello