compilation_on_windows.yml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. name: compilation on windows-latest
  4. on:
  5. # will be triggered on PR events
  6. pull_request:
  7. types:
  8. - opened
  9. - synchronize
  10. paths:
  11. - ".github/workflows/compilation_on_windows.yml"
  12. - "build-scripts/**"
  13. - "core/**"
  14. - "!core/deps/**"
  15. - "product-mini/**"
  16. - "samples/**"
  17. - "!samples/workload/**"
  18. - "tests/wamr-test-suites/**"
  19. - "wamr-compiler/**"
  20. # will be triggered on push events
  21. push:
  22. branches:
  23. - main
  24. - "dev/**"
  25. paths:
  26. - ".github/workflows/compilation_on_windows.yml"
  27. - "build-scripts/**"
  28. - "core/**"
  29. - "!core/deps/**"
  30. - "product-mini/**"
  31. - "samples/**"
  32. - "!samples/workload/**"
  33. - "tests/wamr-test-suites/**"
  34. - "wamr-compiler/**"
  35. # allow to be triggered manually
  36. workflow_dispatch:
  37. env:
  38. # For Spec Test
  39. DEFAULT_TEST_OPTIONS: "-s spec -b"
  40. MULTI_MODULES_TEST_OPTIONS: "-s spec -b -M"
  41. THREADS_TEST_OPTIONS: "-s spec -b -p"
  42. WASI_TEST_OPTIONS: "-s wasi_certification -w"
  43. WASI_TEST_FILTER: ${{ github.workspace }}/product-mini/platforms/windows/wasi_filtered_tests.json
  44. # Used when building the WASI socket and thread tests
  45. CC: ${{ github.workspace }}/wasi-sdk/bin/clang
  46. # Cancel any in-flight jobs for the same PR/branch so there's only one active
  47. # at a time
  48. concurrency:
  49. group: ${{ github.workflow }}-${{ github.ref }}
  50. cancel-in-progress: true
  51. permissions:
  52. contents: read
  53. jobs:
  54. build_llvm_libraries_on_windows:
  55. permissions:
  56. contents: read
  57. actions: write
  58. uses: ./.github/workflows/build_llvm_libraries.yml
  59. with:
  60. os: "windows-latest"
  61. arch: "AArch64 ARM Mips RISCV X86"
  62. build_iwasm:
  63. runs-on: windows-latest
  64. strategy:
  65. matrix:
  66. build_options:
  67. [
  68. "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0",
  69. "-DWAMR_BUILD_AOT=0",
  70. "-DWAMR_BUILD_TAIL_CALL=1",
  71. "-DWAMR_BUILD_CUSTOM_NAME_SECTION=1",
  72. "-DWAMR_DISABLE_HW_BOUND_CHECK=1",
  73. "-DWAMR_BUILD_REF_TYPES=1",
  74. "-DWAMR_BUILD_SIMD=1",
  75. "-DWAMR_BUILD_DEBUG_INTERP=1",
  76. "-DWAMR_BUILD_LIB_PTHREAD=1",
  77. "-DWAMR_BUILD_LIB_WASI_THREADS=1",
  78. "-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1",
  79. ]
  80. steps:
  81. - uses: actions/checkout@v4
  82. - name: clone uvwasi library
  83. if: ${{ !contains(matrix.build_options, '-DWAMR_BUILD_LIBC_UVWASI=0') }}
  84. run: |
  85. cd core/deps
  86. git clone https://github.com/nodejs/uvwasi.git
  87. - name: Build iwasm
  88. run: |
  89. cd product-mini/platforms/windows
  90. mkdir build && cd build
  91. cmake .. ${{ matrix.build_options }}
  92. cmake --build . --config Release --parallel 4
  93. build_wamrc:
  94. needs: [build_llvm_libraries_on_windows]
  95. runs-on: ${{ matrix.os }}
  96. strategy:
  97. matrix:
  98. include:
  99. - os: windows-latest
  100. llvm_cache_key: ${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}
  101. steps:
  102. - name: checkout
  103. uses: actions/checkout@v4
  104. # since jobs.id can't contain the dot character
  105. # it is hard to use `format` to assemble the cache key
  106. - name: Get LLVM libraries
  107. id: retrieve_llvm_libs
  108. uses: actions/cache@v4
  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.llvm_cache_key }}
  117. - name: Quit if cache miss
  118. if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
  119. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  120. - name: Build wamrc
  121. run: |
  122. cmake -S . -B build
  123. cmake --build build --config Release --parallel 4
  124. working-directory: wamr-compiler
  125. test:
  126. runs-on: windows-latest
  127. needs: [build_iwasm, build_wamrc]
  128. strategy:
  129. fail-fast: false
  130. matrix:
  131. running_mode: ["classic-interp", "fast-interp"]
  132. test_option:
  133. [
  134. $DEFAULT_TEST_OPTIONS,
  135. $MULTI_MODULES_TEST_OPTIONS,
  136. $THREADS_TEST_OPTIONS,
  137. $WASI_TEST_OPTIONS,
  138. ]
  139. steps:
  140. - name: checkout
  141. uses: actions/checkout@v4
  142. - name: download and install wasi-sdk
  143. if: matrix.test_option == '$WASI_TEST_OPTIONS'
  144. run: |
  145. curl "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0.m-mingw.tar.gz" -o wasi-sdk.tar.gz -L
  146. mkdir wasi-sdk
  147. tar -xzf wasi-sdk.tar.gz -C wasi-sdk --strip-components 1
  148. - name: build socket api tests
  149. shell: bash
  150. if: matrix.test_option == '$WASI_TEST_OPTIONS'
  151. run: ./build.sh
  152. working-directory: ./core/iwasm/libraries/lib-socket/test/
  153. - name: Build WASI thread tests
  154. shell: bash
  155. if: matrix.test_option == '$WASI_TEST_OPTIONS'
  156. run: ./build.sh
  157. working-directory: ./core/iwasm/libraries/lib-wasi-threads/test/
  158. - name: run tests
  159. shell: bash
  160. timeout-minutes: 20
  161. run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
  162. working-directory: ./tests/wamr-test-suites