spec_test.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. name: Spec tests on non-windows
  4. on:
  5. # will be triggered on PR events
  6. pull_request:
  7. paths:
  8. - "core/config.h"
  9. - "core/iwasm/**"
  10. - "core/shared/**"
  11. - "wamr-compiler/**"
  12. - "product-mini/**"
  13. - "tests/wamr-test-suites/spec-test-script/**"
  14. - "tests/wamr-test-suites/test_wamr.sh"
  15. - ".github/workflows/spec_test.yml"
  16. # will be triggered on push events
  17. push:
  18. paths:
  19. - "core/config.h"
  20. - "core/iwasm/**"
  21. - "core/shared/**"
  22. - "wamr-compiler/**"
  23. - "product-mini/**"
  24. - "tests/wamr-test-suites/spec-test-script/**"
  25. - "tests/wamr-test-suites/test_wamr.sh"
  26. - ".github/workflows/spec_test.yml"
  27. # allow to be triggered manually
  28. workflow_dispatch:
  29. # Cancel any in-flight jobs for the same PR/branch so there's only one active
  30. # at a time
  31. concurrency:
  32. group: ${{ github.workflow }}-${{ github.ref }}
  33. cancel-in-progress: true
  34. env:
  35. DEFAULT_TEST_OPTIONS: "-s spec -P"
  36. LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
  37. MULTI_MODULES_TEST_OPTIONS: "-s spec -M -P"
  38. SIMD_TEST_OPTIONS: "-s spec -S -P"
  39. THREADS_TEST_OPTIONS: "-s spec -p -P"
  40. X86_32_TARGET_TEST_OPTIONS: "-m x86_32 -P"
  41. jobs:
  42. cancel_previous:
  43. runs-on: ubuntu-20.04
  44. steps:
  45. - name: Cancel Workflow Action
  46. uses: styfle/cancel-workflow-action@0.6.0
  47. with:
  48. access_token: ${{ github.token }}
  49. spec_test_default:
  50. needs: cancel_previous
  51. runs-on: ubuntu-20.04
  52. strategy:
  53. matrix:
  54. test_option: [$DEFAULT_TEST_OPTIONS, $SIMD_TEST_OPTIONS]
  55. steps:
  56. - name: checkout
  57. uses: actions/checkout@v2
  58. - name: Get LLVM libraries
  59. id: cache_llvm
  60. uses: actions/cache@v2
  61. with:
  62. path: |
  63. ./core/deps/llvm/build/bin
  64. ./core/deps/llvm/build/include
  65. ./core/deps/llvm/build/lib
  66. ./core/deps/llvm/build/libexec
  67. ./core/deps/llvm/build/share
  68. key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  69. - name: install Ninja
  70. run: sudo apt install -y ninja-build
  71. - name: run spec tests
  72. run: ./test_wamr.sh ${{ matrix.test_option }}
  73. working-directory: ./tests/wamr-test-suites
  74. spec_test_extra:
  75. needs: cancel_previous
  76. if: ${{ endsWith(github.repository, 'wasm-micro-runtime') }}
  77. runs-on: ubuntu-20.04
  78. strategy:
  79. matrix:
  80. test_option: [$MULTI_MODULES_TEST_OPTIONS, $THREADS_TEST_OPTIONS]
  81. steps:
  82. - name: checkout
  83. uses: actions/checkout@v2
  84. - name: Get LLVM libraries
  85. id: cache_llvm
  86. uses: actions/cache@v2
  87. with:
  88. path: |
  89. ./core/deps/llvm/build/bin
  90. ./core/deps/llvm/build/include
  91. ./core/deps/llvm/build/lib
  92. ./core/deps/llvm/build/libexec
  93. ./core/deps/llvm/build/share
  94. key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  95. - name: Quit if cache miss
  96. if: steps.cache_llvm.outputs.cache-hit != 'true'
  97. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  98. - name: install Ninja
  99. run: sudo apt install -y ninja-build
  100. - name: run spec tests
  101. run: ./test_wamr.sh ${{ matrix.test_option }}
  102. working-directory: ./tests/wamr-test-suites
  103. spec_test_x86_32:
  104. if: ${{ endsWith(github.repository, 'wasm-micro-runtime') }}
  105. needs: cancel_previous
  106. runs-on: ubuntu-20.04
  107. strategy:
  108. matrix:
  109. test_option: [$DEFAULT_TEST_OPTIONS, $THREADS_TEST_OPTIONS]
  110. steps:
  111. - name: checkout
  112. uses: actions/checkout@v2
  113. - name: Get LLVM libraries
  114. id: cache_llvm
  115. uses: actions/cache@v2
  116. with:
  117. path: |
  118. ./core/deps/llvm/build/bin
  119. ./core/deps/llvm/build/include
  120. ./core/deps/llvm/build/lib
  121. ./core/deps/llvm/build/libexec
  122. ./core/deps/llvm/build/share
  123. key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  124. - name: Quit if cache miss
  125. if: steps.cache_llvm.outputs.cache-hit != 'true'
  126. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  127. - name: install Ninja and x32 support libraries
  128. run:
  129. # Add another apt repository as some packages cannot
  130. # be downloaded with the github default repository
  131. sudo curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc &&
  132. sudo apt-add-repository https://packages.microsoft.com/ubuntu/20.04/prod &&
  133. sudo apt-get update &&
  134. sudo apt install -y g++-multilib lib32gcc-9-dev ninja-build
  135. - name: run spec tests
  136. run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }}
  137. working-directory: ./tests/wamr-test-suites