test.yml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. name: 🔬 Test
  2. run-name: 🔬 Test ${{ github.sha }}
  3. #on: workflow_call
  4. on:
  5. push:
  6. branches:
  7. - master
  8. - manticore-*
  9. paths-ignore:
  10. - 'manual/**'
  11. - '!manual/References.md'
  12. - '.translation-cache/**'
  13. - 'cmake/GetGALERA.cmake'
  14. - 'galera_packaging/**'
  15. pull_request:
  16. branches: [ master, update-buddy-version ]
  17. paths-ignore:
  18. - 'manual/**'
  19. - '!manual/References.md'
  20. - '.translation-cache/**'
  21. - 'cmake/GetGALERA.cmake'
  22. - 'galera_packaging/**'
  23. types: [opened, synchronize, reopened, labeled, unlabeled]
  24. # cancels the previous workflow run when a new one appears in the same branch (e.g. master or a PR's branch)
  25. concurrency:
  26. group: test_${{ github.ref }}
  27. cancel-in-progress: true
  28. # Note: Many build jobs skip execution for PRs targeting 'update-buddy-version' branch
  29. # as these PRs only update dependency versions and don't require full builds/tests
  30. jobs:
  31. commit_info:
  32. name: Commit info
  33. runs-on: ubuntu-22.04
  34. steps:
  35. - run: |
  36. echo "# Automated Tests of commit ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
  37. echo "* Commit URL: [${{ github.sha }}](/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_STEP_SUMMARY
  38. echo "* Initiated by: [@${{ github.actor }}](https://github.com/${{ github.actor }})" >> $GITHUB_STEP_SUMMARY
  39. echo "* Ref: ${{ github.ref_type }} \"${{ github.ref_name }}\"" >> $GITHUB_STEP_SUMMARY
  40. echo "* Attempt: ${{ github.run_attempt }}" >> $GITHUB_STEP_SUMMARY
  41. check_branch:
  42. name: Check branch existence
  43. runs-on: ubuntu-22.04
  44. outputs:
  45. columnar_locator: ${{ steps.set_locator.outputs.columnar_locator }}
  46. branch_name: ${{ steps.check_branch.outputs.branch_name }}
  47. branch_tag: ${{ steps.sanitize_branch.outputs.branch_tag }}
  48. source_hash: ${{ steps.source_hash.outputs.source_hash }}
  49. image_exists: ${{ steps.image_check.outputs.image_exists }}
  50. image_tag: ${{ steps.image_check.outputs.image_tag }}
  51. steps:
  52. - uses: actions/checkout@v4
  53. - name: Check if branch exists in manticoresoftware/columnar
  54. id: check_branch
  55. run: |
  56. # Extract the actual branch name for pull requests
  57. if [[ "${{ github.event_name }}" == "pull_request" ]]; then
  58. BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
  59. else
  60. BRANCH_NAME="${{ github.ref_name }}"
  61. fi
  62. HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://api.github.com/repos/manticoresoftware/columnar/branches/$BRANCH_NAME)
  63. if [ "$HTTP_STATUS" -eq "200" ]; then
  64. echo "branch_exists=true" >> $GITHUB_OUTPUT
  65. echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
  66. else
  67. echo "branch_exists=false" >> $GITHUB_OUTPUT
  68. echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
  69. fi
  70. - name: Sanitize branch name for tags
  71. id: sanitize_branch
  72. run: |
  73. sanitize_tag() {
  74. local name=$1
  75. name=$(echo "$name" | tr '/' '_')
  76. name=$(echo "$name" | sed 's/[^a-zA-Z0-9_.-]//g')
  77. echo "$name"
  78. }
  79. branch_name="${{ steps.check_branch.outputs.branch_name }}"
  80. branch_tag=$(sanitize_tag "$branch_name")
  81. echo "branch_tag=$branch_tag" >> $GITHUB_OUTPUT
  82. - name: Calculate source hash
  83. id: source_hash
  84. run: |
  85. set -euo pipefail
  86. if [[ "${{ steps.check_branch.outputs.branch_exists }}" == "true" ]]; then
  87. git clone --depth 1 --branch "${{ steps.check_branch.outputs.branch_name }}" \
  88. https://github.com/manticoresoftware/columnar.git columnar
  89. rm -rf columnar/.git
  90. fi
  91. HASH=$(find . -type f \
  92. ! -path "./test/clt-tests/*" \
  93. ! -path "./columnar/test/clt-tests/*" \
  94. ! -path "./.git/*" \
  95. -print0 \
  96. | sort -z \
  97. | xargs -0 md5sum \
  98. | md5sum \
  99. | awk '{print $1}')
  100. echo "source_hash=$HASH" >> $GITHUB_OUTPUT
  101. - name: Check for existing test kit image
  102. id: image_check
  103. env:
  104. REPO_OWNER: ${{ github.repository_owner }}
  105. run: |
  106. set -euo pipefail
  107. TAG="test-kit-${{ steps.sanitize_branch.outputs.branch_tag }}-${{ steps.source_hash.outputs.source_hash }}"
  108. if docker manifest inspect "ghcr.io/${REPO_OWNER}/manticoresearch:${TAG}" > /dev/null 2>&1; then
  109. echo "image_exists=true" >> $GITHUB_OUTPUT
  110. echo "* Reusing cached test-kit image tag: ${TAG}. Skipping builds/ubertests." >> $GITHUB_STEP_SUMMARY
  111. else
  112. echo "image_exists=false" >> $GITHUB_OUTPUT
  113. fi
  114. echo "image_tag=${TAG}" >> $GITHUB_OUTPUT
  115. - name: Set Columnar Locator
  116. id: set_locator
  117. run: |
  118. if [[ "${{ github.ref_name }}" != "master" && "${{ steps.check_branch.outputs.branch_exists }}" == "true" ]]; then
  119. echo "columnar_locator=GIT_REPOSITORY https://github.com/manticoresoftware/columnar.git GIT_TAG ${{ steps.check_branch.outputs.branch_name }}" >> $GITHUB_OUTPUT
  120. else
  121. echo "columnar_locator=" >> $GITHUB_OUTPUT
  122. fi
  123. changes:
  124. name: Detect changes in commit
  125. runs-on: ubuntu-22.04
  126. outputs:
  127. source: ${{ steps.filter.outputs.source }}
  128. test: ${{ steps.filter.outputs.test }}
  129. clt: ${{ steps.filter.outputs.clt }}
  130. steps:
  131. - uses: actions/checkout@v4
  132. - uses: manticoresoftware/paths-filter@v3
  133. id: filter
  134. with:
  135. filters: |
  136. source:
  137. - '**'
  138. - '!.github/**'
  139. - '!manual/**'
  140. - '!doc/**'
  141. - '!test/**'
  142. test:
  143. - 'test/**'
  144. - '!test/clt-tests/**'
  145. clt:
  146. - 'test/clt-tests/**'
  147. win_bundle:
  148. # Skip build jobs for PRs targeting 'update-buddy-version' branch (buddy version updates don't need full builds)
  149. if: (needs.changes.outputs.source == 'true') && (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true && needs.check_branch.outputs.image_exists != 'true'
  150. needs: [changes, check_branch]
  151. name: Windows supplementary files preparation
  152. runs-on: ubuntu-22.04
  153. steps:
  154. - name: Check out cache
  155. id: cache
  156. uses: actions/cache@v4
  157. with:
  158. path: |
  159. bundle
  160. boost_1_75_0
  161. enableCrossOsArchive: true
  162. key: win_bundle
  163. lookup-only: true
  164. - name: Extract Windows bundle from Windows sysroot
  165. if: steps.cache.outputs.cache-hit != 'true'
  166. run: |
  167. wget https://repo.manticoresearch.com/repository/sysroots/roots_apr15/sysroot_windows_x64.tar.xz
  168. tar -xvf sysroot_windows_x64.tar.xz
  169. mv diskc/winbundle bundle
  170. - name: Extract Boost to put it to the cache
  171. if: steps.cache.outputs.cache-hit != 'true'
  172. run: |
  173. wget https://repo.manticoresearch.com/repository/ci/boost_1_75_0.tgz
  174. tar -xf boost_1_75_0.tgz
  175. build_linux_debug:
  176. if: (needs.changes.outputs.source == 'true') && (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true && needs.check_branch.outputs.image_exists != 'true'
  177. needs: [changes, check_branch]
  178. name: Linux debug build
  179. uses: ./.github/workflows/build_template.yml
  180. with:
  181. CTEST_CONFIGURATION_TYPE: "Debug"
  182. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  183. artifact_name: debug_build
  184. cache_key: build_linux_debug_x86_64
  185. cmake_command: |
  186. export CMAKE_TOOLCHAIN_FILE=$(pwd)/dist/build_dockers/cross/linux.cmake
  187. ctest -VV -S misc/ctest/gltest.cmake --no-compress-output
  188. test_linux_debug:
  189. if: (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true
  190. name: Linux debug mode tests
  191. needs: [build_linux_debug, check_branch]
  192. uses: ./.github/workflows/test_template.yml
  193. with:
  194. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  195. build_artifact_name: debug_build
  196. artifact_name: debug_test_results
  197. results_name: "Linux debug test results"
  198. timeout: 10
  199. build_linux_release:
  200. if: (needs.changes.outputs.source == 'true') && (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true && needs.check_branch.outputs.image_exists != 'true'
  201. needs: [changes, check_branch]
  202. name: Linux release build
  203. uses: ./.github/workflows/build_template.yml
  204. with:
  205. artifact_name: release_build
  206. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  207. cache_key: build_linux_release_x86_64
  208. cmake_command: |
  209. export CMAKE_TOOLCHAIN_FILE=$(pwd)/dist/build_dockers/cross/linux.cmake
  210. ctest -VV -S misc/ctest/gltest.cmake --no-compress-output
  211. test_linux_release:
  212. if: (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true
  213. name: Linux release mode tests
  214. needs: [build_linux_release, check_branch]
  215. uses: ./.github/workflows/test_template.yml
  216. with:
  217. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  218. build_artifact_name: release_build
  219. artifact_name: release_test_results
  220. results_name: "Linux release test results"
  221. timeout: 10
  222. pack_jammy_cache_check:
  223. needs: changes
  224. name: Jammy x86_64 package [check cache]
  225. runs-on: ubuntu-22.04
  226. outputs:
  227. cache-key: ${{ steps.generate-key.outputs.cache-key }}
  228. cache-hit: ${{ steps.cache.outputs.cache-hit }}
  229. steps:
  230. - name: Checkout code
  231. uses: actions/checkout@v3
  232. - name: Generate cache key
  233. id: generate-key
  234. run: |
  235. if [ "${{ github.event_name }}" == "pull_request" ]; then
  236. branch=${{ github.head_ref }}
  237. else
  238. branch=$(git rev-parse --abbrev-ref HEAD)
  239. fi
  240. cache_key="jammy-build-${branch}"
  241. echo "cache-key=${cache_key}" >> $GITHUB_OUTPUT
  242. - name: Set up cache
  243. id: cache
  244. uses: actions/cache@v4
  245. with:
  246. path: build
  247. key: ${{ steps.generate-key.outputs.cache-key }}
  248. - name: Override cache hit
  249. id: override-cache-hit
  250. run: |
  251. if [ "${{ needs.changes.outputs.source }}" == "true" ]; then
  252. echo "cache-hit=false" >> $GITHUB_OUTPUT
  253. fi
  254. - name: Upload build artifacts from cache
  255. if: ${{ steps.override-cache-hit.outputs.cache-hit == 'true' }}
  256. uses: manticoresoftware/upload_artifact_with_retries@v4
  257. with:
  258. name: build_jammy_RelWithDebInfo_x86_64
  259. path: "build/manticore*deb"
  260. pack_jammy:
  261. needs: [pack_jammy_cache_check, changes, check_branch]
  262. if: |
  263. (needs.pack_jammy_cache_check.outputs.cache-hit != 'true' ||
  264. needs.changes.outputs.source == 'true') &&
  265. needs.check_branch.outputs.image_exists != 'true'
  266. name: Jammy x86_64 package [build]
  267. uses: ./.github/workflows/build_template.yml
  268. with:
  269. DISTR: jammy
  270. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  271. arch: x86_64
  272. cmake_command: |
  273. mkdir build
  274. cd build
  275. cmake -DPACK=1 ..
  276. export CMAKE_TOOLCHAIN_FILE=$(pwd)/dist/build_dockers/cross/linux.cmake
  277. cmake --build . --target package
  278. cache_key: pack_jammy_x86_64
  279. artifact_list: "build/manticore*deb"
  280. pack_jammy_cache_update:
  281. if: (needs.pack_jammy_cache_check.outputs.cache-hit != 'true') && (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true
  282. name: Jammy x86_64 package [update cache]
  283. needs: [pack_jammy, pack_jammy_cache_check]
  284. runs-on: ubuntu-22.04
  285. steps:
  286. - name: Checkout repository # We have to checkout to access .github/workflows/ in further steps
  287. uses: actions/checkout@v3
  288. - name: Download built x86_64 Ubuntu Jammy packages
  289. uses: manticoresoftware/download_artifact_with_retries@v3
  290. continue-on-error: true
  291. with:
  292. name: build_jammy_RelWithDebInfo_x86_64
  293. path: .
  294. - name: Save cache
  295. uses: actions/cache@v4
  296. with:
  297. path: build
  298. key: ${{ needs.pack_jammy_cache_check.outputs.cache-key }}
  299. test_kit_docker_build:
  300. name: Test Kit docker image
  301. needs:
  302. - pack_jammy
  303. - pack_jammy_cache_check
  304. - check_branch
  305. - test_linux_debug
  306. - test_linux_release
  307. - test_windows
  308. - build_aarch64
  309. - build_freebsd
  310. if: always() && needs.pack_jammy.result != 'failure'
  311. runs-on: ubuntu-22.04
  312. outputs:
  313. out-build: ${{ steps.build.outputs.build_image }}
  314. deps_success: ${{ steps.prereq_status.outputs.deps_success }}
  315. steps:
  316. - name: Evaluate prerequisite results
  317. id: prereq_status
  318. run: |
  319. set -euo pipefail
  320. results=(
  321. "${{ needs.test_linux_debug.result }}"
  322. "${{ needs.test_linux_release.result }}"
  323. "${{ needs.test_windows.result }}"
  324. "${{ needs.pack_jammy.result }}"
  325. "${{ needs.build_aarch64.result }}"
  326. "${{ needs.build_freebsd.result }}"
  327. )
  328. ok=true
  329. for result in "${results[@]}"; do
  330. if [[ "$result" != "success" ]]; then
  331. ok=false
  332. fi
  333. done
  334. echo "deps_success=$ok" >> $GITHUB_OUTPUT
  335. - name: Checkout repository # We have to checkout to access .github/workflows/ in further steps
  336. uses: actions/checkout@v3
  337. - name: Download built x86_64 Ubuntu Jammy packages
  338. if: needs.check_branch.outputs.image_exists != 'true'
  339. uses: manticoresoftware/download_artifact_with_retries@v3
  340. with:
  341. name: build_jammy_RelWithDebInfo_x86_64
  342. path: .
  343. # Uncomment this shortcut for debug to save time by not preparing the packages in the pack_jammy job
  344. # - run: |
  345. # wget http://dev2.manticoresearch.com/build_jammy_RelWithDebInfo_x86_64.zip
  346. # unzip build_jammy_RelWithDebInfo_x86_64.zip
  347. # tar -xvf artifact.tar
  348. - name: Calculate short commit hash
  349. id: sha
  350. if: needs.check_branch.outputs.image_exists != 'true'
  351. run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
  352. - name: Reuse cached test kit image
  353. if: needs.check_branch.outputs.image_exists == 'true'
  354. env:
  355. REPO_OWNER: ${{ github.repository_owner }}
  356. IMAGE_TAG: ${{ needs.check_branch.outputs.image_tag }}
  357. run: |
  358. set -euo pipefail
  359. IMAGE="ghcr.io/${REPO_OWNER}/manticoresearch:${IMAGE_TAG}"
  360. docker pull "$IMAGE"
  361. docker tag "$IMAGE" test-kit:img
  362. docker create --name manticore-test-kit-src --entrypoint /bin/sh test-kit:img -c "true"
  363. docker export manticore-test-kit-src > manticore_test_kit.img
  364. docker rm manticore-test-kit-src
  365. - name: Building docker
  366. id: build
  367. if: needs.check_branch.outputs.image_exists != 'true'
  368. run: |
  369. BUILD_COMMIT=${{ steps.sha.outputs.sha_short }} /bin/bash dist/test_kit_docker_build.sh
  370. echo "build_image=ghcr.io/$REPO_OWNER/manticoresearch:test-kit-${{ steps.sha.outputs.sha_short }}" >> $GITHUB_OUTPUT
  371. - name: Upload docker image artifact
  372. uses: manticoresoftware/upload_artifact_with_retries@v4
  373. with:
  374. name: manticore_test_kit.img
  375. path: manticore_test_kit.img
  376. clt:
  377. if: always() && needs.test_kit_docker_build.result != 'failure'
  378. name: CLT
  379. needs: test_kit_docker_build
  380. uses: ./.github/workflows/clt_tests.yml
  381. secrets:
  382. OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  383. VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
  384. JINA_API_KEY: ${{ secrets.JINA_API_KEY }}
  385. with:
  386. docker_image: test-kit:img
  387. artifact_name: manticore_test_kit.img
  388. repository: ${{ github.repository }}
  389. ref: ${{ github.sha }}
  390. test_kit_docker_push:
  391. if: always() && needs.changes.outputs.source == 'true' && needs.check_branch.outputs.image_exists != 'true'
  392. needs:
  393. - changes
  394. - clt
  395. - check_branch
  396. - test_kit_docker_build
  397. name: Push Test Kit docker image to repo
  398. runs-on: ubuntu-22.04
  399. env:
  400. GHCR_USER: ${{ vars.GHCR_USER }}
  401. GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }}
  402. REPO_OWNER: ${{ github.repository_owner }}
  403. SOURCE_HASH: ${{ needs.check_branch.outputs.source_hash }}
  404. BRANCH_TAG: ${{ needs.check_branch.outputs.branch_tag }}
  405. HASH_TAG_OK: ${{ needs.test_kit_docker_build.outputs.deps_success }}
  406. steps:
  407. - name: Checkout repository # We have to checkout to access .github/workflows/ in further steps
  408. uses: actions/checkout@v3
  409. - name: Download artifact
  410. uses: manticoresoftware/download_artifact_with_retries@main
  411. with:
  412. name: manticore_test_kit.img
  413. path: .
  414. - name: Calculate short commit hash
  415. id: sha
  416. run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
  417. - name: Pushing docker image to repo
  418. id: test-kit-push
  419. run: |
  420. TEST_RESULT=${{ needs.clt.result }} BUILD_COMMIT=${{ steps.sha.outputs.sha_short }} /bin/bash dist/test_kit_docker_push.sh
  421. build_aarch64:
  422. if: (needs.changes.outputs.source == 'true') && (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true && needs.check_branch.outputs.image_exists != 'true'
  423. needs: [changes, check_branch]
  424. name: Linux aarch64 build
  425. uses: ./.github/workflows/build_template.yml
  426. # Use -VV instead of -V below for more verbose output
  427. with:
  428. arch: aarch64
  429. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  430. cmake_command: |
  431. mkdir build
  432. cd build
  433. export CMAKE_TOOLCHAIN_FILE=$(pwd)/../dist/build_dockers/cross/linux.cmake
  434. ctest -V -S ../misc/ctest/justbuild.cmake -DCTEST_SOURCE_DIRECTORY=.. --no-compress-output
  435. cache_key: build_jammy_aarch64
  436. build_freebsd:
  437. if: (needs.changes.outputs.source == 'true') && (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true && needs.check_branch.outputs.image_exists != 'true'
  438. needs: [changes, check_branch]
  439. name: FreeBSD x86_64 build
  440. uses: ./.github/workflows/build_template.yml
  441. with:
  442. DISTR: freebsd13
  443. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  444. boost_url_key: none
  445. cmake_command: |
  446. mkdir build
  447. cd build
  448. export CMAKE_TOOLCHAIN_FILE=$(pwd)/../dist/build_dockers/cross/freebsd.cmake
  449. ctest -VV -S ../misc/ctest/justbuild.cmake -DCTEST_SOURCE_DIRECTORY=.. --no-compress-output
  450. cache_key: build_freebsd_x86_64
  451. build_windows:
  452. if: (needs.changes.outputs.source == 'true') && (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true && needs.check_branch.outputs.image_exists != 'true'
  453. needs: [changes, check_branch]
  454. name: Windows x64 build
  455. uses: ./.github/workflows/build_template.yml
  456. with:
  457. DISTR: windows
  458. arch: x64
  459. sysroot_url_key: roots_mysql83_jan17
  460. boost_url_key: boost_80
  461. CTEST_CMAKE_GENERATOR: "Ninja Multi-Config"
  462. CTEST_CONFIGURATION_TYPE: Debug
  463. cache_key: build_windows_x64
  464. artifact_list: "build/xml build/src/Debug/indexer.exe build/src/Debug/indexer.pdb build/src/Debug/searchd.exe build/src/Debug/searchd.pdb build/src/gtests/Debug/gmanticoretest.exe build/src/gtests/Debug/gmanticoretest.pdb build/src/Debug/*.dll build/src/gtests/Debug/*.dll build/config/*.c build/config/*.h"
  465. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  466. test_windows:
  467. if: (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'update-buddy-version') != true
  468. name: Windows tests
  469. needs: [build_windows, win_bundle, check_branch]
  470. uses: ./.github/workflows/win_test_template.yml
  471. strategy:
  472. fail-fast: false
  473. matrix:
  474. name: [1_400, 401_650, 651_and_on]
  475. include:
  476. - name: 1_400
  477. start: 1
  478. end: 400
  479. - name: 401_650
  480. start: 401
  481. end: 650
  482. - name: 651_and_on
  483. start: 651
  484. end: 999999
  485. with:
  486. CTEST_START: ${{ matrix.start }}
  487. CTEST_END: ${{ matrix.end }}
  488. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  489. artifact_name: windows_test_${{ matrix.name }}
  490. windows_tests_report:
  491. name: Windows tests summary and report
  492. needs: test_windows
  493. runs-on: ubuntu-22.04
  494. container:
  495. image: manticoresearch/ubertests_public:331
  496. steps:
  497. - name: Checkout repository
  498. uses: actions/checkout@v3
  499. - name: Download test report artifacts 1_400
  500. uses: manticoresoftware/download_artifact_with_retries@v3
  501. continue-on-error: true
  502. with:
  503. name: windows_test_1_400
  504. path: .
  505. - name: Download test report artifacts 401_650
  506. uses: manticoresoftware/download_artifact_with_retries@v3
  507. continue-on-error: true
  508. with:
  509. name: windows_test_401_650
  510. path: .
  511. - name: Download test report artifacts 651_and_on
  512. uses: manticoresoftware/download_artifact_with_retries@v3
  513. continue-on-error: true
  514. with:
  515. name: windows_test_651_and_on
  516. path: .
  517. - name: Convert the XML to JUnit format
  518. run: |
  519. shopt -s nullglob
  520. for dir in build/xml_*; do
  521. if [ -d "$dir" ] && [ -f "$dir/Test.xml" ]; then
  522. xsltproc -o "$dir/junit_tests.xml" misc/junit/ctest2junit.xsl "$dir/Test.xml"
  523. fi
  524. done
  525. shell: bash
  526. - name: Publish test results
  527. uses: manticoresoftware/publish-unit-test-result-action@v2
  528. with:
  529. check_name: Windows test results
  530. compare_to_earlier_commit: false
  531. files: build/xml_*/junit_tests.xml
  532. comment_mode: failures
  533. - name: Per-test results
  534. # IMPORTANT: The value of 3 below should correspond to the test shard count, needs.<job_name>.strategy.job-total doesn't work
  535. run: |
  536. for file in build/status*; do echo -n "$file: "; cat "$file"; done
  537. grep -o "success" build/status* | wc -l | awk '{if ($1==3) exit 0; else {print "Found only "$1" successful runs out of 3"; exit 1}}'
  538. shell: bash
  539. - name: Upload combined artifacts
  540. if: always()
  541. continue-on-error: true
  542. uses: manticoresoftware/upload_artifact_with_retries@v4
  543. with:
  544. name: windows_test_resuls
  545. path: build