| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- name: Windows Test Template
- on:
- workflow_call:
- inputs:
- CTEST_START:
- required: false
- type: number
- default: 1
- CTEST_END:
- required: false
- type: number
- default: 999999
- artifact_name:
- required: true
- type: string
- COLUMNAR_LOCATOR:
- required: false
- type: string
- default: ""
- jobs:
- test_windows:
- name: ${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}
- runs-on: windows-2022
- env:
- CACHEB: "../cache"
- LIBS_BUNDLE: "../bundle"
- BOOST_ROOT: "../boost_1_75_0"
- CTEST_CMAKE_GENERATOR: "Visual Studio 17 2022"
- CTEST_CONFIGURATION_TYPE: Debug
- CTEST_START: ${{ inputs.CTEST_START }}
- CTEST_END: ${{ inputs.CTEST_END }}
- CTEST_RESOURCE: ${{ github.workspace }}\\misc\\ctest\\ubertests\\ubertests_docker_image\\resource.json
- # The following is useful to test a specific test, just uncomment it, no need to disable CTEST_START/END
- # CTEST_REGEX: test_234
- NO_BUILD: 1
- COLUMNAR_LOCATOR: ${{ inputs.COLUMNAR_LOCATOR }}
- steps:
- - name: Checkout repository # We have to checkout to access .github/workflows/ in further steps
- uses: actions/checkout@v3
- - name: Download build artifacts
- uses: manticoresoftware/download_artifact_with_retries@v3
- with:
- name: build_windows_Debug_x64
- path: .
- - name: Check out Windows bundle cache
- uses: actions/cache@v4
- with:
- path: |
- bundle
- boost_1_75_0
- enableCrossOsArchive: true
- key: win_bundle
- - 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
- run: rm C:\tools\zstd\zstd.exe
- - name: Check out cache
- uses: actions/cache@v4
- with:
- path: cache
- enableCrossOsArchive: true
- key: build_windows_x64
- - name: Run mysql
- run: |
- C:\PROGRA~1\MySQL\"MySQL Server 8.0"\bin\mysqld.exe --initialize-insecure
- C:\PROGRA~1\MySQL\"MySQL Server 8.0"\bin\mysqld.exe --install mysql
- net start mysql
- mysql -e "create user 'test'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; create database test; create database test1; create database test2; create database test3; create database test4; create database test5; create database test6; create database test7; create database test8; create database test9; grant all on test.* to 'test'@'localhost'; grant all on test1.* to 'test'@'localhost'; grant all on test2.* to 'test'@'localhost'; grant all on test3.* to 'test'@'localhost'; grant all on test4.* to 'test'@'localhost'; grant all on test5.* to 'test'@'localhost'; grant all on test6.* to 'test'@'localhost'; grant all on test7.* to 'test'@'localhost'; grant all on test8.* to 'test'@'localhost'; grant all on test9.* to 'test'@'localhost'; flush privileges;" -uroot
- # 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)
- # - name: Install OpenSSL
- # run: powershell.exe ./.github/workflows/Install-OpenSSL.ps1
- - name: Setup PHP and mysqli
- uses: shivammathur/setup-php@v2
- with:
- php-version: '8.2'
- extensions: mysqli
- - name: 🚀 Test
- id: test
- # --timeout may be not working https://gitlab.kitware.com/cmake/cmake/-/issues/23979
- # Add -VV to ctest to display extra debug info
- run: ctest -VV -S misc/ctest/gltest.cmake --no-compress-output --timeout 600
- continue-on-error: true
- - name: Prepare test results
- if: always()
- run: |
- mkdir build/xml_${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}
- cp -r build/Testing/2*/*.xml build/xml_${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}/
- cp -r build/test build/test_${{ inputs.CTEST_START }}_${{ inputs.CTEST_END }}
- continue-on-error: true
- - name: Upload test artifacts
- if: always()
- continue-on-error: true
- uses: manticoresoftware/upload_artifact_with_retries@v4
- with:
- name: ${{ inputs.artifact_name }}
- path: "build/xml* build/test_*/test_*/report* build/test_*/error*.txt build/test_*/*log build/status* build/test_*/*mdmp"
- report_windows:
- name: Windows tests summary and report
- needs: test_windows
- runs-on: ubuntu-22.04
- container:
- image: manticoresearch/ubertests_public:331
- steps:
- - name: Checkout repository
- uses: actions/checkout@v3
- - name: Download test report artifacts
- uses: manticoresoftware/download_artifact_with_retries@v3
- continue-on-error: true
- with:
- name: ${{ inputs.artifact_name }}
- path: .
- - name: Convert the XML to JUnit format
- run: |
- shopt -s nullglob
- for dir in build/xml_*; do
- if [ -d "$dir" ] && [ -f "$dir/Test.xml" ]; then
- xsltproc -o "$dir/junit_tests.xml" misc/junit/ctest2junit.xsl "$dir/Test.xml"
- fi
- done
- shell: bash
- - name: Publish test results
- uses: manticoresoftware/publish-unit-test-result-action@v2
- with:
- check_name: Windows test results
- compare_to_earlier_commit: false
- files: build/xml_*/junit_tests.xml
- comment_mode: failures
- - name: Verify test job result
- run: |
- if [[ "${{ needs.test_windows.result }}" != "success" ]]; then
- echo "Windows tests job failed (result: ${{ needs.test_windows.result }})"
- exit 1
- fi
- shell: bash
- - name: Upload combined artifacts
- if: always()
- continue-on-error: true
- uses: manticoresoftware/upload_artifact_with_retries@v4
- with:
- name: ${{ inputs.artifact_name }}
- path: build
|