win_test_template.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: Windows Test Template
  2. on:
  3. workflow_call:
  4. inputs:
  5. CTEST_START:
  6. required: false
  7. type: number
  8. default: 1
  9. CTEST_END:
  10. required: false
  11. type: number
  12. default: 999999
  13. artifact_name:
  14. required: true
  15. type: string
  16. COLUMNAR_LOCATOR:
  17. required: false
  18. type: string
  19. default: ""
  20. jobs:
  21. test_windows:
  22. name: ${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}
  23. runs-on: windows-2022
  24. env:
  25. CACHEB: "../cache"
  26. LIBS_BUNDLE: "../bundle"
  27. BOOST_ROOT: "../boost_1_75_0"
  28. CTEST_CMAKE_GENERATOR: "Visual Studio 17 2022"
  29. CTEST_CONFIGURATION_TYPE: Debug
  30. CTEST_START: ${{ inputs.CTEST_START }}
  31. CTEST_END: ${{ inputs.CTEST_END }}
  32. # The following is useful to test a specific test, just uncomment it, no need to disable CTEST_START/END
  33. # CTEST_REGEX: test_234
  34. NO_BUILD: 1
  35. COLUMNAR_LOCATOR: ${{ inputs.COLUMNAR_LOCATOR }}
  36. steps:
  37. - name: Checkout repository # We have to checkout to access .github/workflows/ in further steps
  38. uses: actions/checkout@v3
  39. - name: Download build artifacts
  40. uses: manticoresoftware/download_artifact_with_retries@v3
  41. with:
  42. name: build_windows_Debug_x64
  43. path: .
  44. - name: Check out Windows bundle cache
  45. uses: actions/cache@v4
  46. with:
  47. path: |
  48. bundle
  49. boost_1_75_0
  50. enableCrossOsArchive: true
  51. key: win_bundle
  52. - name: Remove ZSTD # since it wasn't used to save the cache and if we don't remove it here the cache won't be found. TODO: install zstd in our images, so we don't have to do these hacks
  53. run: rm C:\tools\zstd\zstd.exe
  54. - name: Check out cache
  55. uses: actions/cache@v4
  56. with:
  57. path: cache
  58. enableCrossOsArchive: true
  59. key: build_windows_x64
  60. - name: Run mysql
  61. run: |
  62. C:\PROGRA~1\MySQL\"MySQL Server 8.0"\bin\mysqld.exe --initialize-insecure
  63. C:\PROGRA~1\MySQL\"MySQL Server 8.0"\bin\mysqld.exe --install mysql
  64. net start mysql
  65. mysql -e "create user 'test'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; create database test; grant all on test.* to 'test'@'localhost'; flush privileges;" -uroot
  66. # TODO: Uncomment the below if there's no more OpenSSL in the runner like it happened in Sep 2023 (https://github.com/actions/runner-images/issues/8344)
  67. # - name: Install OpenSSL
  68. # run: powershell.exe ./.github/workflows/Install-OpenSSL.ps1
  69. - name: Setup PHP and mysqli
  70. uses: shivammathur/setup-php@v2
  71. with:
  72. php-version: '8.2'
  73. extensions: mysqli
  74. - name: 🚀 Test
  75. id: test
  76. # --timeout may be not working https://gitlab.kitware.com/cmake/cmake/-/issues/23979
  77. # Add -VV to ctest to display extra debug info
  78. run: ctest -VV -S misc/ctest/gltest.cmake --no-compress-output --timeout 600
  79. continue-on-error: true
  80. - name: Remember status
  81. if: always()
  82. run: echo "${{ steps.test.outcome }}" > build/status_${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}
  83. continue-on-error: true
  84. - name: Prepare test results
  85. if: always()
  86. run: |
  87. mkdir build/xml_${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}
  88. cp -r build/Testing/2*/*.xml build/xml_${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}/
  89. cp -r build/test build/test_${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}
  90. continue-on-error: true
  91. - name: Upload test artifacts
  92. if: always()
  93. continue-on-error: true
  94. uses: manticoresoftware/upload_artifact_with_retries@v4
  95. with:
  96. name: ${{ inputs.artifact_name }}
  97. path: "build/xml* build/test_*/test_*/report* build/test_*/error*.txt build/test_*/*log build/status* build/test_*/*mdmp"