test_template.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. name: Test Template
  2. on:
  3. workflow_call:
  4. inputs:
  5. WITH_COVERAGE:
  6. required: false
  7. type: number
  8. default: 0
  9. CTEST_START:
  10. required: false
  11. type: number
  12. default: 1
  13. CTEST_END:
  14. required: false
  15. type: number
  16. default: 999999
  17. UNITY_BUILD:
  18. required: false
  19. type: number
  20. default: 1
  21. artifact_name:
  22. required: true
  23. type: string
  24. build_artifact_name:
  25. required: true
  26. type: string
  27. results_name:
  28. required: true
  29. type: string
  30. timeout:
  31. required: false
  32. type: number
  33. default: 60
  34. xml_command:
  35. required: false
  36. type: string
  37. default: "cd build; cp -r Testing/2*/Test.xml .; xsltproc -o junit_tests.xml ../misc/junit/ctest2junit.xsl Test.xml"
  38. COLUMNAR_LOCATOR:
  39. required: false
  40. type: string
  41. default: ""
  42. jobs:
  43. test:
  44. name: ${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}
  45. runs-on: ubuntu-22.04
  46. timeout-minutes: ${{ inputs.timeout }}
  47. continue-on-error: true
  48. defaults:
  49. run:
  50. shell: bash
  51. container:
  52. image: manticoresearch/ubertests_public:331
  53. env:
  54. DIAGNOSTIC: 1
  55. CACHEB: ../cache
  56. NO_BUILD: 1
  57. CTEST_START: ${{ inputs.CTEST_START }}
  58. CTEST_END: ${{ inputs.CTEST_END }}
  59. # The following is useful to test a specific test, just uncomment it, no need to disable CTEST_START/END
  60. # CTEST_REGEX: test_234
  61. WITH_COVERAGE: ${{ inputs.WITH_COVERAGE }}
  62. LIBS_BUNDLE:
  63. UNITY_BUILD: ${{ inputs.UNITY_BUILD }}
  64. COLUMNAR_LOCATOR: ${{ inputs.COLUMNAR_LOCATOR }}
  65. steps:
  66. - name: Checkout repository
  67. uses: actions/checkout@v3
  68. - name: Tests container entrypoint
  69. run: bash /entry_point.sh &
  70. - name: Check out cache before building
  71. uses: actions/cache@v4
  72. with:
  73. path: cache
  74. enableCrossOsArchive: true
  75. key: build_linux_debug_x86_64
  76. - name: Download build artifacts
  77. uses: manticoresoftware/download_artifact_with_retries@v3
  78. with:
  79. name: ${{ inputs.build_artifact_name }}
  80. path: .
  81. - name: List files
  82. run: find .
  83. - name: 🚀 Test
  84. id: test
  85. # --timeout may be not working https://gitlab.kitware.com/cmake/cmake/-/issues/23979
  86. # use -VV instead of -V to get more verbose output
  87. run: |
  88. ctest -V -S misc/ctest/gltest.cmake --no-compress-output --timeout 600
  89. continue-on-error: true
  90. - name: Check test results
  91. if: always()
  92. run: |
  93. if [ "${{ steps.test.outcome }}" == "failure" ]; then
  94. echo "❌ Tests failed ❌"
  95. exit 1
  96. fi
  97. - name: List build files
  98. if: always()
  99. run: find build
  100. continue-on-error: true
  101. - name: Prepare test report xmls
  102. if: always()
  103. continue-on-error: true
  104. run: ${{ inputs.xml_command }}
  105. - name: Upload test artifacts
  106. if: always()
  107. continue-on-error: true
  108. uses: manticoresoftware/upload_artifact_with_retries@v4
  109. with:
  110. name: ${{ inputs.artifact_name }}
  111. path: "build/xml build/junit*.xml build/status* build/test/error*.txt build/test/*log build/test/test_*/report* build/test/rt_*/report* build/test/col_*/report*"
  112. - name: Publish test results
  113. if: always()
  114. continue-on-error: true
  115. uses: manticoresoftware/publish-unit-test-result-action@v2
  116. with:
  117. check_name: ${{ inputs.results_name }}
  118. files: build/junit*.xml
  119. compare_to_earlier_commit: false
  120. comment_mode: failures