spec_test.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. # will be triggered on push events
  16. push:
  17. paths:
  18. - "core/config.h"
  19. - "core/iwasm/**"
  20. - "core/shared/**"
  21. - "wamr-compiler/**"
  22. - "product-mini/**"
  23. - "tests/wamr-test-suites/spec-test-script/**"
  24. - "tests/wamr-test-suites/test_wamr.sh"
  25. # allow to be triggered manually
  26. workflow_dispatch:
  27. # Cancel any in-flight jobs for the same PR/branch so there's only one active
  28. # at a time
  29. concurrency:
  30. group: ${{ github.workflow }}-${{ github.ref }}
  31. cancel-in-progress: true
  32. env:
  33. DEFAULT_TEST_OPTIONS: "-s spec"
  34. LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
  35. MULTI_MODULES_TEST_OPTIONS: "-s spec -M"
  36. SIMD_TEST_OPTIONS: "-s spec -S"
  37. THREADS_TEST_OPTIONS: "-s spec -p"
  38. X86_32_TARGET_TEST_OPTIONS: "-m x86_32"
  39. jobs:
  40. cancel_previous:
  41. runs-on: ubuntu-20.04
  42. steps:
  43. - name: Cancel Workflow Action
  44. uses: styfle/cancel-workflow-action@0.6.0
  45. with:
  46. access_token: ${{ github.token }}
  47. spec_test_default:
  48. needs: cancel_previous
  49. runs-on: ubuntu-20.04
  50. strategy:
  51. matrix:
  52. test_option: [$DEFAULT_TEST_OPTIONS, $SIMD_TEST_OPTIONS]
  53. steps:
  54. - name: checkout
  55. uses: actions/checkout@v2
  56. - name: Get LLVM libraries
  57. id: cache_llvm
  58. uses: actions/cache@v2
  59. with:
  60. path: |
  61. ./core/deps/llvm/build/bin
  62. ./core/deps/llvm/build/include
  63. ./core/deps/llvm/build/lib
  64. ./core/deps/llvm/build/libexec
  65. ./core/deps/llvm/build/share
  66. key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  67. - name: install Ninja
  68. run: sudo apt install -y ninja-build
  69. - name: run spec tests
  70. run: ./test_wamr.sh ${{ matrix.test_option }}
  71. working-directory: ./tests/wamr-test-suites
  72. spec_test_extra:
  73. needs: cancel_previous
  74. if: ${{ endsWith(github.repository, 'wasm-micro-runtime') }}
  75. runs-on: ubuntu-20.04
  76. strategy:
  77. matrix:
  78. test_option: [$MULTI_MODULES_TEST_OPTIONS, $THREADS_TEST_OPTIONS]
  79. steps:
  80. - name: checkout
  81. uses: actions/checkout@v2
  82. - name: Get LLVM libraries
  83. id: cache_llvm
  84. uses: actions/cache@v2
  85. with:
  86. path: |
  87. ./core/deps/llvm/build/bin
  88. ./core/deps/llvm/build/include
  89. ./core/deps/llvm/build/lib
  90. ./core/deps/llvm/build/libexec
  91. ./core/deps/llvm/build/share
  92. key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  93. - name: Quit if cache miss
  94. if: steps.cache_llvm.outputs.cache-hit != 'true'
  95. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  96. - name: install Ninja
  97. run: sudo apt install -y ninja-build
  98. - name: run spec tests
  99. run: ./test_wamr.sh ${{ matrix.test_option }}
  100. working-directory: ./tests/wamr-test-suites
  101. spec_test_x86_32:
  102. if: ${{ endsWith(github.repository, 'wasm-micro-runtime') }}
  103. needs: cancel_previous
  104. runs-on: ubuntu-20.04
  105. strategy:
  106. matrix:
  107. test_option: [$DEFAULT_TEST_OPTIONS, $THREADS_TEST_OPTIONS]
  108. steps:
  109. - name: checkout
  110. uses: actions/checkout@v2
  111. - name: Get LLVM libraries
  112. id: cache_llvm
  113. uses: actions/cache@v2
  114. with:
  115. path: |
  116. ./core/deps/llvm/build/bin
  117. ./core/deps/llvm/build/include
  118. ./core/deps/llvm/build/lib
  119. ./core/deps/llvm/build/libexec
  120. ./core/deps/llvm/build/share
  121. key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  122. - name: Quit if cache miss
  123. if: steps.cache_llvm.outputs.cache-hit != 'true'
  124. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  125. - name: install Ninja and x32 support libraries
  126. run: sudo apt install -y g++-multilib libgcc-9-dev lib32gcc-9-dev ninja-build
  127. - name: run spec tests
  128. run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }}
  129. working-directory: ./tests/wamr-test-suites