compilation_on_windows.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. jobs:
  52. build:
  53. runs-on: windows-latest
  54. strategy:
  55. matrix:
  56. build_options: [
  57. "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0",
  58. "-DWAMR_BUILD_AOT=0",
  59. "-DWAMR_BUILD_TAIL_CALL=1",
  60. "-DWAMR_BUILD_CUSTOM_NAME_SECTION=1",
  61. "-DWAMR_DISABLE_HW_BOUND_CHECK=1",
  62. "-DWAMR_BUILD_REF_TYPES=1",
  63. "-DWAMR_BUILD_SIMD=1",
  64. "-DWAMR_BUILD_DEBUG_INTERP=1",
  65. "-DWAMR_BUILD_LIB_PTHREAD=1",
  66. "-DWAMR_BUILD_LIB_WASI_THREADS=1",
  67. "-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1"
  68. ]
  69. steps:
  70. - uses: actions/checkout@v4
  71. - name: clone uvwasi library
  72. if: ${{ !contains(matrix.build_options, '-DWAMR_BUILD_LIBC_UVWASI=0') }}
  73. run: |
  74. cd core/deps
  75. git clone https://github.com/nodejs/uvwasi.git
  76. - name: Build iwasm
  77. run: |
  78. cd product-mini/platforms/windows
  79. mkdir build && cd build
  80. cmake .. ${{ matrix.build_options }}
  81. cmake --build . --config Release --parallel 4
  82. test:
  83. runs-on: windows-latest
  84. needs: [build]
  85. strategy:
  86. fail-fast: false
  87. matrix:
  88. running_mode:
  89. [
  90. "classic-interp",
  91. "fast-interp",
  92. ]
  93. test_option:
  94. [
  95. $DEFAULT_TEST_OPTIONS,
  96. $MULTI_MODULES_TEST_OPTIONS,
  97. $THREADS_TEST_OPTIONS,
  98. $WASI_TEST_OPTIONS,
  99. ]
  100. steps:
  101. - name: checkout
  102. uses: actions/checkout@v4
  103. - name: download and install wasi-sdk
  104. if: matrix.test_option == '$WASI_TEST_OPTIONS'
  105. run: |
  106. 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
  107. mkdir wasi-sdk
  108. tar -xzf wasi-sdk.tar.gz -C wasi-sdk --strip-components 1
  109. - name: build socket api tests
  110. shell: bash
  111. if: matrix.test_option == '$WASI_TEST_OPTIONS'
  112. run: ./build.sh
  113. working-directory: ./core/iwasm/libraries/lib-socket/test/
  114. - name: Build WASI thread tests
  115. shell: bash
  116. if: matrix.test_option == '$WASI_TEST_OPTIONS'
  117. run: ./build.sh
  118. working-directory: ./core/iwasm/libraries/lib-wasi-threads/test/
  119. - name: run tests
  120. shell: bash
  121. timeout-minutes: 20
  122. run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
  123. working-directory: ./tests/wamr-test-suites