compilation_on_android_ubuntu.yml 20 KB

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