Fix bool*/my_bool* type mismatch in MySQL/MariaDB driver; CI builds both #173
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - windows-latest | |
| - macos-latest | |
| config: | |
| - qt_version: "6.4.2" | |
| include: | |
| # Two Linux builds: one against libmysqlclient (MySQL 8+) and one | |
| # against libmariadb (MariaDB Connector/C) to catch type-mismatch | |
| # errors like the my_bool*/bool* incompatibility. | |
| - os: ubuntu-latest | |
| config: | |
| qt_version: "6.4.2" | |
| mysql_lib: libmysqlclient-dev | |
| - os: ubuntu-latest | |
| config: | |
| qt_version: "6.4.2" | |
| mysql_lib: libmariadb-dev | |
| steps: | |
| - name: Install dependencies on Ubuntu | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt update -qq | |
| sudo apt install -y doxygen graphviz postgresql-server-dev-16 unixodbc-dev libsqlite3-dev | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 | |
| # Install the requested MySQL/MariaDB client development library. | |
| # libmariadb-dev conflicts with libmysqlclient-dev (both provide | |
| # mysql/mysql.h), so remove the MySQL packages first when building | |
| # against MariaDB. | |
| if [ "${{ matrix.mysql_lib }}" = "libmariadb-dev" ]; then | |
| sudo apt remove -y libmysqlclient-dev libmysqlclient21 || true | |
| fi | |
| sudo apt install -y ${{ matrix.mysql_lib }} | |
| - name: Install dependencies on macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install postgresql@16 | |
| - name: Install PostgreSQL 16 with Chocolatey | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install postgresql --version=16.0 -y | |
| - name: Install Qt with options and default aqtversion | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| aqtversion: null # use whatever the default is | |
| version: ${{ matrix.config.qt_version }} | |
| cache: true | |
| - name: Install ninja-build tool (must be after Qt due PATH changes) | |
| uses: turtlesec-no/get-ninja@main | |
| - name: Make sure MSVC is found when Ninja generator is in use | |
| if: ${{ runner.os == 'Windows' }} | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Configure project (Shared Link) | |
| run: > | |
| cmake -S . -B ./build-shared -G Ninja | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/postgresql@16;C:\Program Files\PostgreSQL\16" | |
| -DENABLE_MAINTAINER_CFLAGS=${{ matrix.build_type == 'Debug' }} | |
| -DBUILD_SHARED_LIBS=ON | |
| -DASQL_DRIVER_MYSQL=${{ runner.os == 'Linux' }} | |
| -DASQL_DRIVER_ODBC=${{ runner.os == 'Linux' }} | |
| - name: Build project | |
| run: cmake --build ./build-shared | |
| - name: Run tests | |
| id: ctest_shared | |
| run: ctest --test-dir ./build-shared -C Debug --output-on-failure | |
| - name: Read tests log when it fails | |
| uses: andstor/file-reader-action@v1 | |
| if: ${{ steps.ctest_shared.conclusion == 'failure' }} | |
| with: | |
| path: "./build-shared/Testing/Temporary/LastTest.log" | |
| # Installing PostgreSQL on Windows takes too much time, so better reuse it here | |
| - name: Configure project (Static Link) | |
| run: > | |
| cmake -S . -B ./build-static -G Ninja | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/postgresql@16;C:\Program Files\PostgreSQL\16" | |
| -DBUILD_SHARED_LIBS=OFF | |
| -DASQL_DRIVER_MYSQL=${{ runner.os == 'Linux' }} | |
| -DASQL_DRIVER_ODBC=${{ runner.os == 'Linux' }} | |
| - name: Build project | |
| run: cmake --build ./build-static | |
| - name: Run tests | |
| id: ctest_static | |
| run: ctest --test-dir ./build-static -C Debug --output-on-failure | |
| - name: Read tests log when it fails | |
| uses: andstor/file-reader-action@v1 | |
| if: ${{ steps.ctest_static.conclusion == 'failure' }} | |
| with: | |
| path: "./build-static/Testing/Temporary/LastTest.log" |