Update CI, fix Embedded server, improve tests, adjust to MySQL 8 #106
Workflow file for this run
This file contains 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: '*' | |
pull_request: | |
branches: '*' | |
jobs: | |
build-matrix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: mikefarah/yq@master | |
- name: Build matrix | |
id: set-matrix | |
run: | | |
# For each perl-version, dbi-version, server-version and client-version from below list | |
# create build matrix with tupples filled up with default versions of other field. Plus | |
# include combinations specified in include list. Default version is the last specified | |
# in every field. This reduced number of jobs because full build matrix is too big. | |
{ printf "matrix="; yq -o=json '.' | jq -M -c '{ "include" : [ . as $top | del(.include) | map_values(last) as $defaults | ( $top | (keys | map(select(. != "include"))[] | { (.) : $top[.][] }) , .include[] ) | . = $defaults * . ] }'; } << EOF >> $GITHUB_OUTPUT | |
perl-version: | |
- 5.8.1 | |
- 5.8.2 | |
- 5.8.8 | |
- 5.8.9 | |
- 5.10.0 | |
- 5.12.0 | |
- 5.14.0 | |
- 5.16.0 | |
- 5.18.0 | |
- 5.20.0 | |
- 5.22.0 | |
- 5.24.0 | |
- 5.26.0 | |
- 5.28.0 | |
- 5.30.0 | |
- 5.32.0 | |
- 5.34.0 | |
- 5.36.0 | |
- 5.38.0 | |
- system | |
dbi-version: | |
- 1.627 | |
- 1.641 | |
- latest | |
server-version: | |
- mysql-4.1.22 | |
- mysql-5.0.15 | |
- mysql-5.0.96 | |
- mysql-5.1.30 | |
- mysql-5.1.72 | |
- mysql-5.1.73 | |
- mysql-5.5.8 | |
- mysql-5.5.47 | |
- mysql-5.5.49 | |
- mysql-5.5.54 | |
- mysql-5.5.55 | |
- mysql-5.5.56 | |
- mysql-5.5.57 | |
- mysql-5.5.58 | |
- mysql-5.5.60 | |
- mysql-5.5.62 | |
- mysql-5.6.10 | |
- mysql-5.6.30 | |
- mysql-5.6.35 | |
- mysql-5.6.36 | |
- mysql-5.6.37 | |
- mysql-5.6.38 | |
- mysql-5.6.39 | |
- mysql-5.6.40 | |
- mysql-5.6.41 | |
- mysql-5.6.43 | |
- mysql-5.6.45 | |
- mysql-5.6.51 | |
- mysql-5.7.8-rc | |
- mysql-5.7.11 | |
- mysql-5.7.12 | |
- mysql-5.7.17 | |
- mysql-5.7.18 | |
- mysql-5.7.19 | |
- mysql-5.7.20 | |
- mysql-5.7.21 | |
- mysql-5.7.22 | |
- mysql-5.7.23 | |
- mysql-5.7.25 | |
- mysql-5.7.27 | |
- mysql-5.7.43 | |
- mysql-8.0.0-dmr | |
- mysql-8.0.1-dmr | |
- mysql-8.0.2-dmr | |
- mysql-8.0.3-rc | |
- mysql-8.0.4-rc | |
- mysql-8.0.11 | |
- mysql-8.0.12 | |
- mysql-8.0.13 | |
- mysql-8.0.14 | |
- mysql-8.0.15 | |
- mysql-8.0.16 | |
- mysql-8.0.17 | |
- mysql-8.0.20 | |
- mysql-8.0.21 | |
- mysql-8.0.22 | |
- mysql-8.0.33 | |
- mysql-8.0.34 | |
- mysql-8.0.35 | |
- mariadb-5.5.40 | |
- mariadb-5.5.44 | |
- mariadb-5.5.47 | |
- mariadb-5.5.52 | |
- mariadb-5.5.54 | |
- mariadb-5.5.55 | |
- mariadb-5.5.56 | |
- mariadb-5.5.57 | |
- mariadb-5.5.58 | |
- mariadb-5.5.59 | |
- mariadb-5.5.60 | |
- mariadb-5.5.61 | |
- mariadb-5.5.63 | |
- mariadb-5.5.65 | |
- mariadb-5.5.68 | |
- mariadb-10.0.14 | |
- mariadb-10.0.20 | |
- mariadb-10.0.23 | |
- mariadb-10.0.29 | |
- mariadb-10.0.30 | |
- mariadb-10.0.31 | |
- mariadb-10.0.32 | |
- mariadb-10.0.34 | |
- mariadb-10.0.36 | |
- mariadb-10.0.38 | |
- mariadb-10.1.2 | |
- mariadb-10.1.8 | |
- mariadb-10.1.11 | |
- mariadb-10.1.20 | |
- mariadb-10.1.22 | |
- mariadb-10.1.24 | |
- mariadb-10.1.30 | |
- mariadb-10.1.31 | |
- mariadb-10.1.33 | |
- mariadb-10.1.36 | |
- mariadb-10.1.37 | |
- mariadb-10.1.38 | |
- mariadb-10.1.41 | |
- mariadb-10.1.48 | |
- mariadb-10.2.0 | |
- mariadb-10.2.1 | |
# Incompatible, broken mysql_config | |
# - mariadb-10.2.2 | |
# - mariadb-10.2.3 | |
- mariadb-10.2.4 | |
- mariadb-10.2.5 | |
- mariadb-10.2.6 | |
- mariadb-10.2.7 | |
- mariadb-10.2.8 | |
- mariadb-10.2.9 | |
- mariadb-10.2.10 | |
- mariadb-10.2.11 | |
- mariadb-10.2.12 | |
- mariadb-10.2.13 | |
- mariadb-10.2.15 | |
- mariadb-10.2.18 | |
- mariadb-10.2.19 | |
- mariadb-10.2.20 | |
- mariadb-10.2.21 | |
- mariadb-10.2.22 | |
- mariadb-10.2.26 | |
- mariadb-10.2.44 | |
- mariadb-10.3.0 | |
- mariadb-10.3.1 | |
- mariadb-10.3.2 | |
- mariadb-10.3.3 | |
- mariadb-10.3.4 | |
- mariadb-10.3.6 | |
- mariadb-10.3.7 | |
- mariadb-10.3.8 | |
- mariadb-10.3.10 | |
- mariadb-10.3.11 | |
- mariadb-10.3.12 | |
- mariadb-10.3.17 | |
- mariadb-10.3.39 | |
- mariadb-10.4.0 | |
- mariadb-10.4.1 | |
- mariadb-10.4.2 | |
# Incompatible, unsupported by MySQL::Sandbox | |
# - mariadb-10.4.3 | |
# - mariadb-10.4.4 | |
# - mariadb-10.4.5 | |
# - mariadb-10.4.6 | |
# - mariadb-10.4.7 | |
- system | |
client-version: | |
- mysqlconc-6.0.0-beta | |
- mysqlconc-6.0.2 | |
- mysqlconc-6.1.0 | |
- mysqlconc-6.1.9 | |
- mysqlconc-6.1.10 | |
- mysqlconc-6.1.11 | |
- mysqlconc-6.2.0-labs | |
# Incompatible, broken buffer for prepared statements | |
# - mariadbconc-2.2.0 | |
# - mariadbconc-2.2.3 | |
# - mariadbconc-2.3.0 | |
- mariadbconc-2.3.1 | |
- mariadbconc-2.3.2 | |
- mariadbconc-2.3.3 | |
- mariadbconc-2.3.4 | |
- mariadbconc-2.3.5 | |
- mariadbconc-2.3.6 | |
- mariadbconc-2.3.7 | |
# Incompatible, client library freeze | |
# - mariadbconc-3.0.0-alpha | |
# Incompatible, missing header files | |
# - mariadbconc-3.0.1-beta | |
- mariadbconc-3.0.2 | |
# Incompatible, broken buffer for prepared statements | |
# - mariadbconc-3.0.3 | |
- mariadbconc-3.0.4 | |
- mariadbconc-3.0.5 | |
- mariadbconc-3.0.6 | |
- mariadbconc-3.0.7 | |
- mariadbconc-3.0.8 | |
- mariadbconc-3.0.9 | |
- mariadbconc-3.0.10 | |
- mariadbconc-3.1.0 | |
- mariadbconc-3.1.1 | |
- mariadbconc-3.1.2 | |
- mariadbconc-3.1.3 | |
- mariadbconc-3.1.10 | |
- mariadbconc-3.1.21 | |
- mariadbconc-3.2.0 | |
- mariadbconc-3.2.7 | |
- mariadbconc-3.3.0-rc1 | |
- mariadbconc-3.3.5 | |
- system | |
- same-as-server | |
include: | |
- server-version: mysql-5.0.96 | |
client-version: mariadbconc-2.3.4 | |
- server-version: mysql-5.1.72 | |
client-version: mariadbconc-3.0.2 | |
- server-version: mariadb-5.5.40 | |
client-version: mysqlconc-6.1.11 | |
- server-version: mysql-8.0.3-rc | |
client-version: mariadbconc-2.3.0 | |
- server-version: mariadb-10.3.3 | |
client-version: mysqlconc-6.0.0-beta | |
- server-version: mariadb-10.3.3 | |
client-version: mysqlconc-6.1.11 | |
- server-version: mysql-8.0.3-rc | |
client-version: mariadbconc-3.0.2 | |
- server-version: mysql-5.6.38 | |
client-version: mysqlconc-6.1.11 | |
- server-version: mariadb-10.1.30 | |
client-version: mariadbconc-3.0.2 | |
- server-version: mysql-4.1.22 | |
client-version: mariadbconc-3.0.6 | |
# MySQL client versions 8.0.4 - 8.0.34 and 8.1.0 have bug which | |
# prevents connection to MySQL server versions prior 5.5.7 | |
- server-version: mysql-4.1.22 | |
client-version: mysql-8.0.35 | |
- server-version: mysql-5.1.72 | |
client-version: mysql-8.0.3-rc | |
- server-version: system-pic | |
client-version: system-pic | |
- server-version: mysql-5.7.43 | |
client-version: system-pic | |
- server-version: mysql-8.0.35 | |
client-version: system-pic | |
- server-version: mariadb-5.5.40 | |
client-version: system-pic | |
- server-version: mariadb-10.0.38 | |
client-version: system-pic | |
- server-version: mariadb-10.2.44 | |
client-version: system-pic | |
- server-version: mariadb-10.4.2 | |
client-version: system-pic | |
- server-version: none | |
client-version: system | |
- perl-version: 5.12.0 | |
dbi-version: 1.608 | |
EOF | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
build-n-test: | |
name: perl-${{ matrix.perl-version }}/${{ matrix.server-version }}/${{ matrix.client-version }}/dbi-${{ matrix.dbi-version }} | |
needs: build-matrix | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} | |
steps: | |
- name: Checkout git commit ${{ github.sha }} | |
if: github.event_name != 'pull_request' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.sha }} | |
- name: Checkout git commit ${{ github.event.pull_request.head.sha }} (fixup for pull request) | |
if: github.event_name == 'pull_request' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Setup cpan sources cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cpan/sources | |
key: cache-cpan | |
- name: Uninstall system MySQL/MariaDB | |
run: | | |
sudo apt purge `{ dpkg --get-selections '*mysql*'; dpkg --get-selections '*mariadb*'; } | sed 's/[:\t].*//'` | |
- name: Install client dependences (1) | |
if: ${{ matrix.client-version != 'system' && matrix.client-version != 'system-pic' && ( matrix.server-version != 'system' || matrix.client-version != 'same-as-server' ) }} | |
run: | | |
sudo apt install libgnutls28-dev libncurses5 libncursesw5 libstdc++5 | |
- name: Install client dependences (2) | |
if: ${{ matrix.client-version != 'system' && matrix.client-version != 'system-pic' && ( matrix.server-version != 'system' || matrix.client-version != 'same-as-server' ) }} | |
run: | | |
wget --progress=bar:force http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb -O /tmp/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb | |
wget --progress=bar:force http://security.ubuntu.com/ubuntu/pool/universe/j/jemalloc/libjemalloc1_3.6.0-11_amd64.deb -O /tmp/libjemalloc1_3.6.0-11_amd64.deb | |
sudo dpkg -i /tmp/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb /tmp/libjemalloc1_3.6.0-11_amd64.deb | |
- name: Install MariaDB client system | |
if: ${{ matrix.client-version == 'system' || ( matrix.server-version == 'system' && matrix.client-version == 'same-as-server' ) }} | |
run: | | |
sudo apt install libmariadb-dev | |
- name: Install MariaDB server system | |
if: ${{ matrix.server-version == 'system' }} | |
run: | | |
sudo apt install mariadb-server | |
sudo systemctl start mariadb.service | |
sudo mariadb -e "GRANT ALL PRIVILEGES ON test.* TO 'test'@'localhost' IDENTIFIED BY 'test'" | |
- name: Install MySQL embedded PIC library | |
if: ${{ matrix.client-version == 'system-pic' || matrix.server-version == 'system-pic' }} | |
run: | | |
wget --progress=bar:force http://archive.ubuntu.com/ubuntu/pool/universe/m/mysql-5.5/libmysqld-pic_5.5.62-0ubuntu0.14.04.1_amd64.deb -O /tmp/libmysqld-pic_5.5.62-0ubuntu0.14.04.1_amd64.deb | |
wget --progress=bar:force http://archive.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/libmysqlclient-dev_5.5.62-0ubuntu0.14.04.1_amd64.deb -O /tmp/libmysqlclient-dev_5.5.62-0ubuntu0.14.04.1_amd64.deb | |
wget --progress=bar:force http://archive.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/libmysqlclient18_5.5.62-0ubuntu0.14.04.1_amd64.deb -O /tmp/libmysqlclient18_5.5.62-0ubuntu0.14.04.1_amd64.deb | |
wget --progress=bar:force http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.6_amd64.deb -O /tmp/multiarch-support_2.27-3ubuntu1.6_amd64.deb | |
sudo apt install libaio-dev | |
sudo apt install /tmp/libmysqld-pic_5.5.62-0ubuntu0.14.04.1_amd64.deb /tmp/libmysqlclient-dev_5.5.62-0ubuntu0.14.04.1_amd64.deb /tmp/libmysqlclient18_5.5.62-0ubuntu0.14.04.1_amd64.deb /tmp/multiarch-support_2.27-3ubuntu1.6_amd64.deb | |
- name: Install Perl system | |
if: ${{ matrix.perl-version == 'system' }} | |
run: | | |
sudo apt install perl cpanminus liblocal-lib-perl | |
mkdir -p "$HOME"/perl5 | |
- name: Install Perl ${{ matrix.perl-version }} | |
if: ${{ matrix.perl-version != 'system' }} | |
uses: shogo82148/actions-setup-perl@v1 | |
with: | |
perl-version: ${{ matrix.perl-version }} | |
- name: Download and Install MariaDB/MySQL server ${{ matrix.server-version }} and client ${{ matrix.client-version }} | |
run: | | |
if [ "${{ matrix.perl-version }}" = "system" ]; then | |
eval $(perl -I"$HOME/perl5/lib/perl5" -Mlocal::lib) | |
fi | |
mkdir -p "$HOME/cache" | |
case "${{ matrix.server-version }}" in | |
mysql*) DB=MySQL ;; | |
mariadb*) DB=MariaDB ;; | |
none) DB=""; ;; | |
system) DB=""; ;; | |
system-pic) DB=""; ;; | |
*) DB=unknown ;; | |
esac | |
case "${{ matrix.client-version }}" in | |
mysql-*) CLIENT_DB=MySQL-Server ;; | |
mysqlconc-*) CLIENT_DB=MySQL-ConC ;; | |
mariadbconc-*) CLIENT_DB=MariaDB-ConC ;; | |
system) CLIENT_DB=""; ;; | |
system-pic) CLIENT_DB=""; ;; | |
same-as-server) CLIENT_DB=""; ;; | |
*) CLIENT_DB=unknown ;; | |
esac | |
VERSION=`echo "${{ matrix.server-version }}" | sed 's/^[^-]*-//'` | |
CLIENT_VERSION=`echo "${{ matrix.client-version }}" | sed 's/^[^-]*-//'` | |
if [ "$DB" = "MySQL" ]; then | |
case "$VERSION" in | |
4.1.*) SANDBOX_URL=https://mysql.linux.cz/Downloads/MySQL-4.1/mysql-standard-$VERSION-unknown-linux-gnu-x86_64-glibc23.tar.gz ;; | |
5.0.[012]*) SANDBOX_URL=https://downloads.mysql.com/archives/get/p/23/file/mysql-standard-$VERSION-linux-x86_64-glibc23.tar.gz ;; | |
5.[01].*) SANDBOX_URL=https://downloads.mysql.com/archives/get/p/23/file/mysql-$VERSION-linux-x86_64-glibc23.tar.gz ;; | |
5.5.?) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux2.6-x86_64.tar.gz ;; | |
5.5.[1234]*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux2.6-x86_64.tar.gz ;; | |
5.5.5[012345]*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux2.6-x86_64.tar.gz ;; | |
5.5.56*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.5-x86_64.tar.gz ;; | |
5.5.*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.12-x86_64.tar.gz ;; | |
5.6.[12]*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.5-x86_64.tar.gz ;; | |
5.6.3[0123456]*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.5-x86_64.tar.gz ;; | |
5.6.*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.12-x86_64.tar.gz ;; | |
5.7.19*|5.7.[234]*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.12-x86_64.tar.gz ;; | |
5.7.*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.5-x86_64.tar.gz ;; | |
8.0.?-*|8.0.11) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.12-x86_64.tar.gz ;; | |
8.0.*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.12-x86_64.tar.xz ;; | |
8.1.*) SANDBOX_URL=https://dev.mysql.com/get/mysql-$VERSION-linux-glibc2.28-x86_64.tar.xz ;; | |
*) echo "Unsupported MySQL version '$VERSION'"; exit 1 ;; | |
esac | |
SANDBOX_CACHE_FILE="$HOME/cache/$(basename "$SANDBOX_URL")" | |
elif [ "$DB" = "MariaDB" ]; then | |
case "$VERSION" in | |
5.*|10.[012].*) SANDBOX_URL=https://downloads.mariadb.com/MariaDB/mariadb-$VERSION/bintar-linux-x86_64/mariadb-$VERSION-linux-x86_64.tar.gz ;; | |
10.[34].*) SANDBOX_URL=https://downloads.mariadb.com/MariaDB/mariadb-$VERSION/bintar-linux-glibc_214-x86_64/mariadb-$VERSION-linux-glibc_214-x86_64.tar.gz ;; | |
*) echo "Unsupported MariaDB version '$VERSION'"; exit 1 ;; | |
esac | |
SANDBOX_CACHE_FILE="$HOME/cache/$(basename "$SANDBOX_URL")" | |
elif [ -n "$DB" ]; then | |
echo "Unsupported DB '$DB'"; exit 1 | |
fi | |
if [ -n "$DB" ]; then | |
export SANDBOX_HOME="$HOME/sandbox" | |
export SANDBOX_BINARY="$SANDBOX_HOME/binary" | |
export SANDBOX_FILE="$SANDBOX_HOME/$(basename "$SANDBOX_CACHE_FILE")" | |
if [ ! -f "$SANDBOX_CACHE_FILE" ]; then wget --progress=bar:force "$SANDBOX_URL" -O "$SANDBOX_CACHE_FILE" || exit 1; fi | |
mkdir -p "$SANDBOX_HOME" || exit 1 | |
ln -s "$SANDBOX_CACHE_FILE" "$SANDBOX_FILE" || exit 1 | |
if [ `echo "$VERSION" | sed 's/\.//;s/\..*//'` -ge 55 ]; then | |
SANDBOX_OPTIONS="$SANDBOX_OPTIONS --init_options=--innodb_use_native_aio=0 --my_clause=innodb_use_native_aio=0 --my_clause=performance_schema=ON" | |
fi | |
fi | |
if [ "$CLIENT_DB" = "MySQL-ConC" ]; then | |
case "$CLIENT_VERSION" in | |
*-labs) CLIENT_URL=https://downloads.mysql.com/snapshots/pb/mysql-connector-c-$CLIENT_VERSION/mysql-connector-c-$CLIENT_VERSION-linux-glibc2.5-x86_64.tar.gz ;; | |
6.0.*) CLIENT_URL=https://dev.mysql.com/get/mysql-connector-c-$CLIENT_VERSION-linux-glibc2.3-x86-64bit.tar.gz ;; | |
6.1.[0123456789]) CLIENT_URL=https://dev.mysql.com/get/mysql-connector-c-$CLIENT_VERSION-linux-glibc2.5-x86_64.tar.gz ;; | |
6.1.*) CLIENT_URL=https://dev.mysql.com/get/mysql-connector-c-$CLIENT_VERSION-linux-glibc2.12-x86_64.tar.gz ;; | |
*) echo "Unsupported MySQL Connector/C version '$CLIENT_VERSION'"; exit 1 ;; | |
esac | |
CLIENT_FILE="$HOME/cache/$(basename "$CLIENT_URL")" | |
elif [ "$CLIENT_DB" = "MariaDB-ConC" ]; then | |
case "$CLIENT_VERSION" in | |
3.0.*) CLIENT_URL=https://downloads.mariadb.com/Connectors/c/connector-c-${CLIENT_VERSION/-*/}/mariadb-connector-c-$CLIENT_VERSION-linux-x86_64.tar.gz ;; | |
3.1.[01234567]) CLIENT_URL=https://downloads.mariadb.com/Connectors/c/connector-c-${CLIENT_VERSION/-*/}/mariadb-connector-c-$CLIENT_VERSION-linux-x86_64.tar.gz ;; | |
3.*) CLIENT_URL=https://downloads.mariadb.com/Connectors/c/connector-c-${CLIENT_VERSION/-*/}/mariadb-connector-c-$CLIENT_VERSION-ubuntu-focal-amd64.tar.gz ;; | |
*) CLIENT_URL=https://downloads.mariadb.com/Connectors/c/connector-c-${CLIENT_VERSION/-*/}/mariadb-connector-c-$CLIENT_VERSION-linux-x86_64.tar.gz ;; | |
esac | |
CLIENT_FILE="$HOME/cache/$(basename "$CLIENT_URL")" | |
elif [ "$CLIENT_DB" = "MySQL-Server" ]; then | |
case "$CLIENT_VERSION" in | |
# FIXME: Only MySQL 8.x server versions are defined here for usage as client library for now | |
8.0.?-*|8.0.11) CLIENT_URL=https://dev.mysql.com/get/mysql-$CLIENT_VERSION-linux-glibc2.12-x86_64.tar.gz ;; | |
8.0.*) CLIENT_URL=https://dev.mysql.com/get/mysql-$CLIENT_VERSION-linux-glibc2.12-x86_64.tar.xz ;; | |
8.1.*) CLIENT_URL=https://dev.mysql.com/get/mysql-$CLIENT_VERSION-linux-glibc2.28-x86_64.tar.xz ;; | |
*) echo "Unsupported MySQL version '$CLIENT_VERSION'"; exit 1 ;; | |
esac | |
CLIENT_FILE="$HOME/cache/$(basename "$CLIENT_URL")" | |
elif [ -n "$CLIENT_DB" ]; then | |
echo "Unsupported Connector/C '$CLIENT_DB'"; exit 1 | |
fi | |
if [ -n "$CLIENT_DB" ]; then | |
if [ ! -f "$CLIENT_FILE" ]; then wget --progress=bar:force "$CLIENT_URL" -O "$CLIENT_FILE" || exit 1; fi | |
fi | |
if [ "${{ matrix.client-version }}" = "system-pic" ]; then | |
sed 's/-L\$pkglibdir *-lmysqld/-L\/usr\/lib\/mysql -lmysqld_pic /' `which mysql_config_pic` > "$HOME/mysql_config_pic" | |
chmod +x $HOME/mysql_config_pic | |
fi | |
if [ "${{ matrix.server-version }}" = "system-pic" ]; then | |
wget --progress=bar:force http://archive.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/mysql-server-core-5.5_5.5.62-0ubuntu0.14.04.1_amd64.deb -O /tmp/mysql-server-core-5.5_5.5.62-0ubuntu0.14.04.1_amd64.deb | |
dpkg -x /tmp/mysql-server-core-5.5_5.5.62-0ubuntu0.14.04.1_amd64.deb $HOME/mysql-server-core-5.5 | |
fi | |
if [ -n "$DB" ]; then | |
cpanm --quiet --notest --skip-satisfied MySQL::Sandbox || exit 1 | |
if [[ $SANDBOX_FILE =~ .xz$ ]]; then | |
unxz < "$SANDBOX_FILE" | gzip -1 > "${SANDBOX_FILE%.xz}.gz" | |
SANDBOX_FILE="${SANDBOX_FILE%.xz}.gz" | |
fi | |
make_sandbox --export_binaries "$SANDBOX_FILE" -- --sandbox_port 3310 --sandbox_directory msb --no_confirm --verbose $SANDBOX_OPTIONS || exit 1 | |
sed 's/-lzlib //g' -i $SANDBOX_HOME/*/bin/mysql_config | |
rm -f $SANDBOX_HOME/*/bin/mariadb_config | |
printf '#!/bin/sh\nexec %s/msb/my sql_config "$@"\n' $SANDBOX_HOME > "$HOME/mysql_config" | |
chmod +x $HOME/mysql_config | |
fi | |
if [ -n "$CLIENT_DB" ]; then | |
mkdir -p "$HOME/client" | |
tar --strip-components=1 --directory="$HOME/client" -xf "$CLIENT_FILE" || exit 1 | |
if $HOME/client/bin/mysql_config 2>&1 | grep -q /usr/local; then | |
rm -f $HOME/client/bin/mysql_config | |
fi | |
if [ -x $HOME/client/bin/mysql_config ]; then | |
sed 's/-l "/-lmysqlclient "/g' -i "$HOME/client/bin/mysql_config" || exit 1 | |
fi | |
fi | |
- name: Setup DBD_MARIADB_* env | |
run: | | |
if [ "${{ matrix.perl-version }}" = "system" ]; then | |
eval $(perl -I"$HOME/perl5/lib/perl5" -Mlocal::lib) | |
fi | |
if [ "${{ matrix.server-version }}" = "system" ]; then | |
export DBD_MARIADB_TESTUSER=test | |
export DBD_MARIADB_TESTPASSWORD=test | |
export DBD_MARIADB_TESTHOST=127.0.0.1 | |
export DBD_MARIADB_TESTPORT=3306 | |
elif [ "${{ matrix.server-version }}" = "system-pic" ]; then | |
export DBD_MARIADB_TESTHOST=embedded | |
export DBD_MARIADB_TESTEMBDATADIR="$HOME/datadir" | |
export DBD_MARIADB_TESTEMBOPTIONS="--language=$HOME/mysql-server-core-5.5/usr/share/mysql/,--log-error=/dev/null" | |
elif [ "${{ matrix.server-version }}" = "none" ]; then | |
export DBD_MARIADB_TESTHOST=0.0.0.0 | |
export DBD_MARIADB_TESTPORT=0 | |
else | |
export DBD_MARIADB_TESTUSER=msandbox | |
export DBD_MARIADB_TESTPASSWORD=msandbox | |
export DBD_MARIADB_TESTHOST=127.0.0.1 | |
export DBD_MARIADB_TESTPORT=3310 | |
export DBD_MARIADB_TESTEMBOPTIONS="--language=`find $HOME/sandbox/* -name english | head -1 | sed 's/english//'`,--log-error=/dev/null" | |
fi | |
if [[ ${{ matrix.client-version }} =~ mysql-8 ]]; then | |
export DBD_MARIADB_TESTAUTHPLUGIN=mysql_native_password | |
fi | |
if [ "${{ matrix.client-version }}" != "system" ] && [ "${{ matrix.client-version }}" != "system-pic" ] && [ "${{ matrix.client-version }}" != "same-as-server" ]; then | |
if [ -x $HOME/client/bin/mysql_config ]; then | |
export DBD_MARIADB_CONFIG="$HOME/client/bin/mysql_config" | |
else | |
INCLUDE_PATH=`find "$HOME/client" -name "mysql.h" | sort | head -1` | |
if [ -z "$INCLUDE_PATH" ]; then echo "File mysql.h was not found"; exit 1; fi | |
LIB_PATH=`find "$HOME/client" -name "lib*.so" | sort | head -1` | |
if [ -z "$INCLUDE_PATH" ]; then echo "File lib*.so was not found"; exit 1; fi | |
export DBD_MARIADB_CFLAGS="-I`dirname $INCLUDE_PATH`" | |
export DBD_MARIADB_LIBS="-L`dirname $LIB_PATH` -l`echo $LIB_PATH | sed 's/.*\/lib//;s/\.so//'`" | |
export DBD_MARIADB_CONFIG="skip" | |
fi | |
elif [ "${{ matrix.client-version }}" = "same-as-server" ] && [ "${{ matrix.server-version }}" != "system" ]; then | |
export DBD_MARIADB_CONFIG="$HOME/mysql_config" | |
elif [ "${{ matrix.client-version }}" = "system-pic" ]; then | |
export DBD_MARIADB_CONFIG="$HOME/mysql_config_pic" | |
fi | |
export | sed 's/^declare -x //;s/="/=/;s/"$//' | grep '^DBD_MARIADB_' >> $GITHUB_ENV | |
- name: Install dependences | |
run: | | |
if [ "${{ matrix.perl-version }}" = "system" ]; then | |
eval $(perl -I"$HOME/perl5/lib/perl5" -Mlocal::lib) | |
fi | |
perl '-MExtUtils::MakeMaker 7.00' -e '' || cpanm --quiet --notest ExtUtils::MakeMaker@7.00 | |
perl '-MCPAN::Meta 2.112580' -e '' || cpanm --quiet --notest CPAN::Meta@2.112580 | |
perl '-Mv5.12' -e '' || cpanm --quiet --notest Test::Deep@1.130 | |
if [ "${{ matrix.dbi-version }}" != "latest" ]; then cpanm --quiet --notest DBI@${{ matrix.dbi-version }}; fi | |
cpanm --quiet --notest --skip-satisfied DBI~1.608 Devel::CheckLib~1.12 | |
cpanm --quiet --notest --skip-satisfied --installdeps --with-configure --with-develop --with-recommends --with-suggests . &> $HOME/cpanm_fail || { cat "$HOME"/cpanm_fail ; cat `grep -o '/home/runner.*log' "$HOME"/cpanm_fail` ; exit 1; } | |
- name: Configure | |
run: | | |
if [ "${{ matrix.perl-version }}" = "system" ]; then | |
eval $(perl -I"$HOME/perl5/lib/perl5" -Mlocal::lib) | |
fi | |
make realclean || true | |
perl Makefile.PL | |
- name: Build | |
run: | | |
if [ "${{ matrix.perl-version }}" = "system" ]; then | |
eval $(perl -I"$HOME/perl5/lib/perl5" -Mlocal::lib) | |
fi | |
make | |
- name: Test | |
run: | | |
if [ "${{ matrix.perl-version }}" = "system" ]; then | |
eval $(perl -I"$HOME/perl5/lib/perl5" -Mlocal::lib) | |
fi | |
if [ "${{ matrix.server-version }}" != "system-pic" ]; then | |
export HARNESS_OPTIONS=j4 | |
fi | |
export RELEASE_TESTING=1 | |
if [ "${{ matrix.server-version }}" != "none" ]; then | |
export CONNECTION_TESTING=1 | |
fi | |
make test |