linux.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. push:
  8. branches: [ main ]
  9. pull_request:
  10. branches: [ main ]
  11. jobs:
  12. build:
  13. runs-on: ${{ matrix.os }}
  14. strategy:
  15. matrix:
  16. os: [ubuntu-18.04, ubuntu-20.04]
  17. steps:
  18. - uses: actions/checkout@v2
  19. - name: Build iwasm [default]
  20. run: |
  21. cd product-mini/platforms/linux
  22. mkdir build && cd build
  23. cmake ..
  24. make
  25. cd .. && rm -rf build
  26. - name: Build iwasm [Classic interp]
  27. run: |
  28. cd product-mini/platforms/linux
  29. mkdir build && cd build
  30. cmake .. -DWAMR_BUILD_FAST_INTERP=0
  31. make
  32. cd .. && rm -rf build
  33. - name: Build iwasm [Multi module]
  34. run: |
  35. cd product-mini/platforms/linux
  36. mkdir build && cd build
  37. cmake .. -DWAMR_BUILD_MULTI_MODULE=1
  38. make
  39. cd .. && rm -rf build
  40. - name: Build iwasm [lib-pthread]
  41. run: |
  42. cd product-mini/platforms/linux
  43. mkdir build && cd build
  44. cmake .. -DWAMR_BUILD_LIB_PTHREAD=1
  45. make
  46. cd .. && rm -rf build
  47. - name: Build iwasm [aot only]
  48. run: |
  49. cd product-mini/platforms/linux
  50. mkdir build && cd build
  51. cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0
  52. make
  53. cd .. && rm -rf build
  54. - name: Build iwasm [interp only]
  55. run: |
  56. cd product-mini/platforms/linux
  57. mkdir build && cd build
  58. cmake .. -DWAMR_BUILD_AOT=0
  59. make
  60. cd .. && rm -rf build
  61. - name: Build iwasm [memory profiling]
  62. run: |
  63. cd product-mini/platforms/linux
  64. mkdir build && cd build
  65. cmake .. -DWAMR_BUILD_MEMORY_PROFILING=1
  66. make
  67. cd .. && rm -rf build
  68. - name: Build iwasm [tail call]
  69. run: |
  70. cd product-mini/platforms/linux
  71. mkdir build && cd build
  72. cmake .. -DWAMR_BUILD_TAIL_CALL=1
  73. make
  74. cd .. && rm -rf build
  75. - name: Build iwasm [custom name section]
  76. run: |
  77. cd product-mini/platforms/linux
  78. mkdir build && cd build
  79. cmake .. -DWAMR_BUILD_CUSTOM_NAME_SECTION=1
  80. make
  81. cd .. && rm -rf build
  82. - name: download and install wasi-sdk
  83. run: |
  84. cd /opt
  85. wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-8/wasi-sdk-8.0-linux.tar.gz
  86. tar -xzf wasi-sdk-8.0-linux.tar.gz
  87. mv wasi-sdk-8.0 wasi-sdk
  88. - name: download and install wabt
  89. run: |
  90. cd /opt
  91. wget https://github.com/WebAssembly/wabt/releases/download/1.0.19/wabt-1.0.19-ubuntu.tar.gz
  92. tar -xzf wabt-1.0.19-ubuntu.tar.gz
  93. mv wabt-1.0.19 wabt
  94. - name: Build Sample [wasm-c-api]
  95. run: |
  96. cd samples/wasm-c-api
  97. mkdir build && cd build
  98. cmake ..
  99. make
  100. ./hello
  101. ./global
  102. ./callback
  103. - name: Build Sample [basic]
  104. run: |
  105. cd samples/basic
  106. ./build.sh
  107. ./run.sh
  108. - name: Build Sample [multi-thread]
  109. run: |
  110. cd samples/multi-thread
  111. mkdir build && cd build
  112. cmake ..
  113. make
  114. ./iwasm wasm-apps/test.wasm
  115. - name: Build Sample [multi-module]
  116. run: |
  117. cd samples/multi-module
  118. mkdir build && cd build
  119. cmake ..
  120. make
  121. ./multi_module
  122. - name: Build Sample [spawn-thread]
  123. run: |
  124. cd samples/spawn-thread
  125. mkdir build && cd build
  126. cmake ..
  127. make
  128. ./spawn_thread