Fix test_resultsetmetadata failure on MariaDB 12.3 #153
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Run CI Tests | |
| on: | |
| push: | |
| branches: ['master', 'develop*', 'maintenance/*', 'feature/*', 'cpp-*'] | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| # Run weekly on Sundays at 2 AM UTC | |
| - cron: '0 2 * * 0' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| env: | |
| MYSQL_TEST_HOST: mariadb.example.com | |
| MYSQL_TEST_PORT: 3306 | |
| MYSQL_TEST_USER: testuser | |
| MYSQL_TEST_PASSWD: "heyPassw+-_20oRd" | |
| MYSQL_TEST_DB: testcpp | |
| BASE_TEST_HOST: jdbc:mariadb://mariadb.example.com:3306 | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| # Only run scheduled jobs if we're on the right branch | |
| if: github.event_name != 'schedule' || contains(fromJSON('["1.0", "1.1"]'), github.ref_name) | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.final-matrix }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - id: set-matrix | |
| name: build matrix | |
| uses: mariadb-corporation/connector-ci-build-matrix@main | |
| with: | |
| additional-matrix: '[]' | |
| ci: | |
| name: ${{ matrix.name }} | |
| needs: setup | |
| timeout-minutes: 50 | |
| strategy: | |
| matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: ${{ matrix.continue-on-error || matrix.os == 'macos-latest' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Test Environment | |
| id: setup-env | |
| uses: mariadb-corporation/connector-ci-setup@master | |
| with: | |
| db-type: ${{ matrix.db-type }} | |
| db-tag: ${{ matrix.db-tag }} | |
| test-db-password: ${{ env.MYSQL_TEST_PASSWD }} | |
| test-db-database: ${{ env.MYSQL_TEST_DB }} | |
| test-db-port: ${{ env.MYSQL_TEST_PORT }} | |
| additional-conf: ${{ matrix.additional-conf || '' }} | |
| registry-user: ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_USER || (secrets.DOCKER_TOKEN != '' && secrets.DOCKER_LOGIN || '') }} | |
| registry-password: ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_TOKEN || secrets.DOCKER_TOKEN }} | |
| os: ${{ matrix.os }} | |
| maxscale-tag: ${{ matrix.maxscale-tag || ''}} | |
| - name: make ubuntu | |
| if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| run: | | |
| sudo apt install unixodbc-dev | |
| cmake -DCONC_WITH_MSI=OFF -DCONC_WITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=OPENSSL -DTEST_HOST="${{ env.BASE_TEST_HOST }}" . | |
| cmake --build . --config RelWithDebInfo | |
| env: | |
| MARIADB_PLUGIN_DIR: ${{ github.workspace }} | |
| - name: make macos | |
| if: ${{ startsWith(matrix.os, 'mac') }} | |
| run: | | |
| brew install libiodbc openssl | |
| ls -lrt /opt/homebrew/opt/libiodbc/lib | |
| cmake -G Xcode -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=NO -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO -DWITH_SIGNCODE=OFF -DODBC_LIB_DIR=/opt/homebrew/opt/libiodbc/lib -DODBC_INCLUDE_DIR=/opt/homebrew/opt/libiodbc/include -DCONC_WITH_MSI=OFF -DCONC_WITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=OPENSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -DWITH_EXTERNAL_ZLIB=On -DTEST_HOST="${{ env.BASE_TEST_HOST }}" . | |
| cmake --build . --config RelWithDebInfo | |
| - name: make windows | |
| if: ${{ startsWith(matrix.os, 'windows') }} | |
| shell: powershell | |
| run: | | |
| cmake -DCONC_WITH_MSI=OFF -DCONC_WITH_UNIT_TESTS=OFF -DWITH_MSI=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=SCHANNEL -DTEST_HOST="${{ env.BASE_TEST_HOST }}" . | |
| cmake --build . --config RelWithDebInfo | |
| - name: Run test suite | |
| shell: bash | |
| run: | | |
| cd ./test | |
| if [ "$DB_TYPE" = "mysql" ] ; then | |
| cp ../libmariadb/caching_sha2_password.* ../ | |
| fi | |
| ctest --output-on-failure | |
| export TEST_HOST=$BASE_TEST_HOST/$TEST_SCHEMA?useServerPrepStmts=true | |
| ctest --output-on-failure | |
| env: | |
| DB_TYPE: ${{ matrix.db-type }} | |
| LOCAL_DB: ${{ steps.setup-env.outputs.database-type }} | |
| os: ${{ matrix.os }} | |
| TEST_UID: ${{ env.MYSQL_TEST_USER }} | |
| TEST_SERVER: ${{ env.MYSQL_TEST_HOST }} | |
| TEST_PASSWORD: ${{ env.MYSQL_TEST_PASSWD }} | |
| TEST_PORT: ${{ env.MYSQL_TEST_PORT }} | |
| TEST_SCHEMA: ${{ env.MYSQL_TEST_DB }} | |
| TEST_VERBOSE: true | |
| SSLCERT: ${{ matrix.db-type == 'container' && format('{0}/.github/workflows/certs/server.crt', github.workspace) || '' }} | |
| MARIADB_PLUGIN_DIR: ${{ github.workspace }} | |
| MAXSCALE_TAG: ${{ matrix.maxscale-tag || '' }} | |
| infer: | |
| name: Infer static analysis | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| INFER_VERSION: 1.3.0 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install build dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libssl-dev && sudo apt-get install -y unixodbc-dev | |
| - name: Install Infer | |
| run: | | |
| curl -fsSL "https://github.com/facebook/infer/releases/download/v${INFER_VERSION}/infer-linux-x86_64-v${INFER_VERSION}.tar.xz" \ | |
| | sudo tar -C /opt -xJ | |
| echo "/opt/infer-linux-x86_64-v${INFER_VERSION}/bin" >> "$GITHUB_PATH" | |
| - name: Configure | |
| run: cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| - name: Run Infer | |
| # run: infer run --fail-on-issue --compilation-database compile_commands.json | |
| run: infer run --compilation-database compile_commands.json | |
| - name: Upload Infer report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: infer-report | |
| path: infer-out/report.txt | |
| if-no-files-found: ignore |