2
0

meson-wasm.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: Meson WebAssembly
  2. on:
  3. push:
  4. branches: [ "master" ]
  5. pull_request:
  6. branches: [ "master" ]
  7. env:
  8. wasmtime_version: v7.0.0
  9. wasmer_version: v3.1.1
  10. jobs:
  11. build_emsdk:
  12. strategy:
  13. matrix:
  14. BUILD_TYPE: [debug, debugoptimized, release, minsize]
  15. C_FLAGS: ['', '-msimd128', '-msse -msse2 -msimd128', '-msse -msse2 -msse3 -msse4 -msimd128']
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Setup emsdk
  20. uses: mymindstorm/setup-emsdk@v13
  21. - name: Verify emsdk
  22. run: emcc -v
  23. - name: Creating cross file
  24. run: |
  25. cat << EOF > ${{github.workspace}}/meson_cross_emsdk.txt
  26. [binaries]
  27. c = '`which emcc`'
  28. cpp = '`which em++`'
  29. ar = '`which emar`'
  30. [built-in options]
  31. c_args = ['-Wno-unused-parameter']
  32. c_link_args = ['-s', 'STANDALONE_WASM']
  33. cpp_args = ['-Wno-unused-parameter']
  34. cpp_link_args = ['-s', 'STANDALONE_WASM']
  35. [host_machine]
  36. system = 'emscripten'
  37. cpu_family = 'wasm32'
  38. cpu = 'wasm32'
  39. endian = 'little'
  40. EOF
  41. cat ${{github.workspace}}/meson_cross_emsdk.txt
  42. - uses: actions/setup-python@v4
  43. - name: Install meson
  44. run: |
  45. sudo python3 -m pip install meson ninja
  46. - name: Build with meson
  47. run: |
  48. meson setup build -Dbuildtype=${{matrix.BUILD_TYPE}} --cross-file ${{github.workspace}}/meson_cross_emsdk.txt --default-library=static -Dbuild_tests=true
  49. meson test -C build
  50. - name: Test with wasmtime
  51. run: |
  52. cd ${{github.workspace}}
  53. ls -lh ${{github.workspace}}/build/
  54. wget --no-verbose https://github.com/bytecodealliance/wasmtime/releases/download/${{env.wasmtime_version}}/wasmtime-${{env.wasmtime_version}}-x86_64-linux.tar.xz
  55. tar xf wasmtime-${{env.wasmtime_version}}-x86_64-linux.tar.xz
  56. ./wasmtime-${{env.wasmtime_version}}-x86_64-linux/wasmtime run --wasm-features simd ${{github.workspace}}/build/tests.wasm
  57. - name: Test with wasmer
  58. run: |
  59. cd ${{github.workspace}}
  60. mkdir wasmer
  61. cd wasmer
  62. wget --no-verbose https://github.com/wasmerio/wasmer/releases/download/${{env.wasmer_version}}/wasmer-linux-amd64.tar.gz
  63. tar xf wasmer-linux-amd64.tar.gz
  64. ./bin/wasmer run --enable-simd ${{github.workspace}}/build/tests.wasm