spec_test.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. # will be triggered on push events
  14. push:
  15. paths:
  16. - "core/config.h"
  17. - "core/iwasm/**"
  18. - "core/shared/**"
  19. - "wamr-compiler/**"
  20. - "product-mini/**"
  21. # allow to be triggered manually
  22. workflow_dispatch:
  23. # Cancel any in-flight jobs for the same PR/branch so there's only one active
  24. # at a time
  25. concurrency:
  26. group: ${{ github.workflow }}-${{ github.ref }}
  27. cancel-in-progress: true
  28. env:
  29. LLVM_CACHE_SUFFIX: "build-llvm_libraries"
  30. jobs:
  31. cancel_previous:
  32. runs-on: ubuntu-20.04
  33. steps:
  34. - name: Cancel Workflow Action
  35. uses: styfle/cancel-workflow-action@0.6.0
  36. with:
  37. access_token: ${{ github.token }}
  38. build_llvm_libraries:
  39. needs: cancel_previous
  40. runs-on: ubuntu-20.04
  41. steps:
  42. - name: checkout
  43. uses: actions/checkout@v2
  44. - name: Cache LLVM libraries
  45. id: cache_llvm
  46. uses: actions/cache@v2
  47. with:
  48. path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
  49. key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  50. restore-keys: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  51. - name: Build llvm and clang from source
  52. id: build_llvm
  53. if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }}
  54. run: /usr/bin/env python3 ./build_llvm.py --arch X86 WebAssembly
  55. working-directory: build-scripts
  56. - name: package LLVM
  57. if: ${{ steps.build_llvm.conclusion == 'success' }}
  58. run: mv LLVM-13.0.0-*.tar.gz LLVM-13.0.0.tar.gz
  59. working-directory: core/deps/llvm/build/
  60. spec_test_on_ubuntu_2004:
  61. needs: build_llvm_libraries
  62. runs-on: ubuntu-20.04
  63. strategy:
  64. matrix:
  65. test_option: [
  66. # DEFAULT
  67. "-s spec",
  68. # SIMD
  69. "-s spec -S",
  70. # THREAD
  71. "-s spec -p",
  72. # MULTI_MODULES
  73. "-s spec -M",
  74. ]
  75. steps:
  76. - name: checkout
  77. uses: actions/checkout@v2
  78. - name: Get LLVM libraries
  79. id: cache_llvm
  80. uses: actions/cache@v2
  81. with:
  82. path: ./core/deps/llvm/build/LLVM-13.0.0.tar.gz
  83. key: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  84. restore-keys: ubuntu-20.04-${{ env.LLVM_CACHE_SUFFIX }}
  85. - name: Quit if cache miss
  86. if: steps.cache_llvm.outputs.cache-hit != 'true'
  87. run: echo "::error::can not get prebuilt llvm libraries" && exit 1
  88. - name: Extract the LLVM package
  89. run: tar xf LLVM-13.0.0.tar.gz --strip-components=1
  90. working-directory: ./core/deps/llvm/build
  91. - name: install Ninja
  92. run: sudo apt install -y ninja-build
  93. - name: run spec tests
  94. run: ./test_wamr.sh ${{ matrix.test_option }}
  95. working-directory: ./tests/wamr-test-suites