1
+ ---
2
+ name : Run CI Tests
3
+
4
+ on :
5
+ push :
6
+ branches : ['1.1', '1.0']
7
+ pull_request :
8
+ workflow_dispatch :
9
+ schedule :
10
+ # Run weekly on Sundays at 2 AM UTC
11
+ - cron : ' 0 2 * * 0'
12
+
13
+ concurrency :
14
+ group : ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress : false
16
+
17
+ env :
18
+ MYSQL_TEST_HOST : mariadb.example.com
19
+ MYSQL_TEST_PORT : 3306
20
+ MYSQL_TEST_USER : root
21
+ MYSQL_TEST_PASSWD : " heyPassw-!*20oRd"
22
+ MYSQL_TEST_DB : testp
23
+
24
+ jobs :
25
+
26
+ setup :
27
+ runs-on : ubuntu-latest
28
+ if : |
29
+ github.event_name != 'schedule' ||
30
+ github.ref == 'refs/heads/3.4' ||
31
+ github.ref == 'refs/heads/3.1' ||
32
+ github.ref == 'refs/heads/3.2'
33
+ outputs :
34
+ matrix : ${{ steps.set-matrix.outputs.final-matrix }}
35
+ steps :
36
+ - uses : actions/checkout@v4
37
+ - id : set-matrix
38
+ name : build matrix
39
+ uses : rusher/mariadb-test-build-matrix@main
40
+ with :
41
+ additional-matrix : ' [{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.9"},{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.10"},{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.11"},{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.12"},{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "pypy3.11", "continue-on-error": true}]'
42
+
43
+ ci :
44
+ name : ${{ matrix.name }} ${{ matrix.python != '' && format(' - python {0}', matrix.python) || '' }}
45
+ needs : setup
46
+ timeout-minutes : 50
47
+ strategy :
48
+ matrix : ${{ fromJSON(needs.setup.outputs.matrix) }}
49
+
50
+ runs-on : ${{ matrix.os }}
51
+ continue-on-error : ${{ matrix.continue-on-error || false }}
52
+ steps :
53
+ - uses : actions/checkout@v4
54
+
55
+ - name : Setup Test Environment
56
+ id : setup-env
57
+ uses : rusher/mariadb-test-setup@master
58
+ with :
59
+ node-version : ${{ matrix.node }}
60
+ db-type : ${{ matrix.db-type }}
61
+ db-tag : ${{ matrix.db-tag }}
62
+ test-db-password : ${{ env.MYSQL_TEST_PASSWD }}
63
+ test-db-database : ${{ env.MYSQL_TEST_DB }}
64
+ test-db-port : ${{ env.MYSQL_TEST_PORT }}
65
+ additional-conf : ${{ matrix.additional-conf || '' }}
66
+ registry-user : ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_USER || (secrets.DOCKER_PWD != '' && 'mariadbtest' || '') }}
67
+ registry-password : ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_TOKEN || secrets.DOCKER_PWD }}
68
+ os : ${{ matrix.os }}
69
+
70
+ - uses : actions/setup-python@v5
71
+ id : setup-python
72
+ with :
73
+ python-version : ${{ matrix.python || '3.13' }}
74
+
75
+ - name : Clone C/C
76
+ uses : GuillaumeFalourd/clone-github-repo-action@v2.3
77
+ with :
78
+ branch : ' 3.4'
79
+ owner : ' mariadb-corporation'
80
+ repository : ' mariadb-connector-c'
81
+
82
+ - name : c/c make ubuntu
83
+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
84
+ run : |
85
+ cd ${{ github.workspace }}/mariadb-connector-c
86
+ cmake . -DCMAKE_BUILD_TYPE=Release -DWITH_EXTERNAL_ZLIB=On -DCMAKE_INSTALL_PREFIX=/usr
87
+ make -j4
88
+ sudo make install
89
+ echo "MARIADB_PLUGIN_DIR=`mariadb_config --plugindir`" >> $GITHUB_ENV
90
+ echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/mariadb" >> $GITHUB_ENV
91
+
92
+ - name : c/c make macos
93
+ if : ${{ startsWith(matrix.os, 'mac') }}
94
+ run : |
95
+ cd ${{ github.workspace }}/mariadb-connector-c
96
+ cmake . -DCMAKE_BUILD_TYPE=Release -DWITH_EXTERNAL_ZLIB=On
97
+ make -j4
98
+ sudo make install
99
+ ls -lrt /usr/local/lib/mariadb/plugin
100
+ echo "MARIADB_PLUGIN_DIR=`mariadb_config --plugindir`" >> $GITHUB_ENV
101
+ echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/mariadb" >> $GITHUB_ENV
102
+ echo "DYLD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/mariadb:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
103
+ echo "DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/mariadb" >> $GITHUB_ENV
104
+
105
+ - name : c/c make windows
106
+ if : ${{ startsWith(matrix.os, 'windows') }}
107
+ shell : powershell
108
+ run : |
109
+ cd ${{ github.workspace }}/mariadb-connector-c
110
+ $MARIADB_CC_INSTALL_DIR = "$env:USERPROFILE/conc"
111
+ cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_CURL=ON -DCMAKE_INSTALL_PREFIX="$MARIADB_CC_INSTALL_DIR"
112
+ cmake --build . --config RelWithDebInfo
113
+ cmake --install . --config RelWithDebInfo
114
+ echo "MARIADB_CC_INSTALL_DIR=$MARIADB_CC_INSTALL_DIR" >> $env:GITHUB_ENV
115
+ echo "MARIADB_PLUGIN_DIR=$MARIADB_CC_INSTALL_DIR/lib/mariadb/plugin" >> $env:GITHUB_ENV
116
+
117
+ - name : Run test suite
118
+ shell : bash
119
+ run : |
120
+ python --version
121
+ python -m pip install .
122
+ cd testing
123
+ python -m unittest discover -v
124
+ env :
125
+ TEST_DB_USER : ${{ env.MYSQL_TEST_USER }}
126
+ TEST_DB_HOST : ${{ env.MYSQL_TEST_HOST }}
127
+ TEST_DB_DATABASE : ${{ env.MYSQL_TEST_DB }}
128
+ TEST_DB_PORT : ${{ env.MYSQL_TEST_PORT }}
129
+ TEST_DB_PASSWORD : ${{ env.MYSQL_TEST_PASSWD }}
130
+ LOCAL_DB : ${{ steps.setup-env.outputs.database-type }}
131
+ PYTHON_VERSION : ${{ steps.setup-python.outputs.python-version }}
0 commit comments