Skip to content

CONC-816: CMake modernization for the 3.12 baseline #217

CONC-816: CMake modernization for the 3.12 baseline

CONC-816: CMake modernization for the 3.12 baseline #217

Workflow file for this run

---
name: Run CI Tests
on:
push:
branches: ['3.*']
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
jobs:
setup:
runs-on: ubuntu-latest
if: |
github.event_name != 'schedule' ||
github.ref == 'refs/heads/3.4' ||
github.ref == 'refs/heads/3.1' ||
github.ref == 'refs/heads/3.2'
outputs:
matrix: ${{ steps.set-matrix.outputs.final-matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
name: build matrix
uses: mariadb-corporation/connector-ci-build-matrix@main
with:
additional-matrix: '[{"name": "MariaDB 11.4 (local) - windows 2025", "os": "windows-2025", "db-type": "community", "db-tag": "11.4"},{"name": "MariaDB 11.4 32bits (local) - windows 2025", "os": "windows-2025", "db-type": "community", "db-tag": "11.4", "arch": "32"}]'
ci-server:
name: server ${{ matrix.server.version }} test suite ${{ matrix.server.env && format(' {0}', matrix.server.env) || '' }}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
server:
- version: '11.4'
- version: '11.8'
env: TEST_OPTION=--ps-protocol
steps:
- name: Retrieve server ${{ matrix.server.version }}
shell: bash
run: |
# get latest server
git clone -b ${server_branch} https://github.com/mariadb/server ./workdir-server --depth=1
env:
server_branch: ${{ matrix.server.version }}
- name: Update libmariadb submodule for PR
if: github.event_name == 'pull_request'
shell: bash
run: |
cd ./workdir-server
git submodule update --init --remote libmariadb
cd libmariadb
git fetch origin ${{ github.event.pull_request.head.sha }}
git checkout -qf FETCH_HEAD
- name: Update libmariadb submodule for non-PR
if: github.event_name != 'pull_request'
shell: bash
run: |
cd ./workdir-server
git submodule set-branch -b ${{ github.ref_name }} libmariadb
git submodule sync
git submodule update --init --remote libmariadb
cd libmariadb
git checkout ${{ github.sha }}
- name: install ubuntu/macos requirement
run: |
sudo apt install libio-socket-ssl-perl
- name: Make server
shell: bash
run: |
cd ./workdir-server
git add libmariadb
mkdir bld
cd bld
cmake .. -DPLUGIN_MROONGA=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_SPIDER=NO -DPLUGIN_TOKUDB=NO
make -j9
- name: Run test suite
shell: bash
run: |
ls -lrt
cd ./workdir-server/bld/mysql-test/
ls -lrt
./mysql-test-run.pl --suite=main,unit ${TEST_OPTION} --parallel=auto --skip-test=session_tracker_last_gtid
env:
TEST_OPTION: ${{ matrix.server.env.TEST_OPTION }}
MYSQL_TEST_HOST: 127.0.0.1
- name: Archive error logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
retention-days: 5
name: log-files-${{ matrix.server.version }}
path: |
${{ github.workspace }}/workdir-server/bld/mysql-test/var/**/log/*.err
ci:
name: ${{ matrix.name }}
needs: setup
timeout-minutes: 50
env:
MYSQL_TEST_HOST: mariadb.example.com
MYSQL_TEST_PORT: 3306
MYSQL_TEST_USER: root
MYSQL_TEST_PASSWD: "heyPassw-!*20oRd"
MYSQL_TEST_DB: testc
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@v4
- name: Setup Test Environment
id: setup-env
uses: mariadb-corporation/connector-ci-setup@master
with:
node-version: ${{ matrix.node }}
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 }}
- name: make ubuntu/macos
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_EXTERNAL_ZLIB=On
make
- name: make windows 64bits
if: ${{ startsWith(matrix.os, 'windows') && (matrix.arch != '32' || !matrix.arch) }}
run: |
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_CURL=ON -DWITH_MSI=ON
cmake --build . --config RelWithDebInfo
- name: make windows 32bits
if: ${{ startsWith(matrix.os, 'windows') && startsWith(matrix.arch, '32') }}
run: |
cmake -A Win32 . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_CURL=ON -DWITH_MSI=ON
cmake --build . --config RelWithDebInfo
- name: Run test suite
shell: bash
run: |
cd unittest/libmariadb
ctest -V
env:
MARIADB_CC_TEST: 1
MYSQL_TEST_TLS: 0
srv: ${{ matrix.db-type }}
MARIADB_PLUGIN_DIR: ${{ github.workspace }}