diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79f7d10f..90d122bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,12 @@ jobs: strategy: matrix: include: - # Ruby 3.x on Ubuntu 22.04 LTS (latest at this time) - - {os: ubuntu-22.04, ruby: 'head', db: mysql80} + # Ruby 3.x on Ubuntu 24.04 LTS + - {os: ubuntu-24.04, ruby: 'head', db: mysql84} + - {os: ubuntu-24.04, ruby: '3.4', db: mysql84} + + # Ruby 3.x on Ubuntu 22.04 LTS + - {os: ubuntu-22.04, ruby: '3.4', db: mysql80} - {os: ubuntu-22.04, ruby: '3.3', db: mysql80} - {os: ubuntu-22.04, ruby: '3.2', db: mysql80} - {os: ubuntu-22.04, ruby: '3.1', db: mysql80} @@ -26,15 +30,18 @@ jobs: - {os: ubuntu-20.04, ruby: '2.1', db: mysql80} - {os: ubuntu-20.04, ruby: '2.0', db: mysql80} + # MySQL 5.7 packages stopped after Ubuntu 18.04 Bionic + # - {os: ubuntu-18.04, ruby: '2.7', db: mysql57} + + # MariaDB LTS versions # db: on Linux, ci/setup.sh installs the specified packages # db: on MacOS, installs a Homebrew package use "name@X.Y" to specify a version + - {os: ubuntu-24.04, ruby: '3.4', db: mariadb11.4} - {os: ubuntu-22.04, ruby: '3.0', db: mariadb10.11} - {os: ubuntu-22.04, ruby: '2.7', db: mariadb10.11} - {os: ubuntu-22.04, ruby: '3.0', db: mariadb10.6} - {os: ubuntu-20.04, ruby: '2.7', db: mariadb10.6} - - {os: ubuntu-20.04, ruby: '2.7', db: mysql80} - - {os: ubuntu-20.04, ruby: '2.7', db: mysql57} # TODO - Windows CI # - {os: windows-2022, ruby: '3.2', db: mysql80} @@ -42,8 +49,10 @@ jobs: # Allow failure due to this issue: # https://github.com/brianmario/mysql2/issues/1194 - - {os: macos-latest, ruby: '2.6', db: mariadb, ssl: openssl@1.1, allow-failure: true} - - {os: macos-latest, ruby: '2.6', db: mysql, ssl: openssl@1.1, allow-failure: true} + - {os: macos-latest, ruby: '3.4', db: mariadb@11.4, ssl: openssl@3, allow-failure: true} + - {os: macos-latest, ruby: '3.4', db: mysql@8.4, ssl: openssl@3, allow-failure: true} + - {os: macos-latest, ruby: '2.6', db: mysql@8.0, ssl: openssl@1.1, allow-failure: true} + # On the fail-fast: true, it cancels all in-progress jobs # if any matrix job fails, which we don't want. fail-fast: false diff --git a/ci/mariadb114.sh b/ci/mariadb114.sh new file mode 100644 index 00000000..6225972a --- /dev/null +++ b/ci/mariadb114.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -eux + +apt purge -qq '^mysql*' '^libmysql*' +rm -fr /etc/mysql +rm -fr /var/lib/mysql + +apt-key add support/C74CD1D8.asc +add-apt-repository "deb https://deb.mariadb.org/11.4/ubuntu $(lsb_release -cs) main" +apt install -y -o Dpkg::Options::='--force-confnew' mariadb-server libmariadb-dev diff --git a/ci/mysql57.sh b/ci/mysql57.sh index 8c892831..9cd681ff 100644 --- a/ci/mysql57.sh +++ b/ci/mysql57.sh @@ -7,7 +7,7 @@ rm -fr /etc/mysql rm -fr /var/lib/mysql apt-key add support/5072E1F5.asc # old signing key apt-key add support/3A79BD29.asc # 5.7.37 and higher -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C +apt-key add support/B7B3B788A8D3785C.asc # 8.1 and higher # Verify the repository as add-apt-repository does not. wget -q --spider http://repo.mysql.com/apt/ubuntu/dists/$(lsb_release -cs)/mysql-5.7 add-apt-repository 'http://repo.mysql.com/apt/ubuntu mysql-5.7' diff --git a/ci/mysql80.sh b/ci/mysql80.sh index ae7e8831..814412c6 100644 --- a/ci/mysql80.sh +++ b/ci/mysql80.sh @@ -7,7 +7,7 @@ rm -fr /etc/mysql rm -fr /var/lib/mysql apt-key add support/5072E1F5.asc # old signing key apt-key add support/3A79BD29.asc # 8.0.28 and higher -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C +apt-key add support/B7B3B788A8D3785C.asc # 8.1 and higher # Verify the repository as add-apt-repository does not. wget -q --spider http://repo.mysql.com/apt/ubuntu/dists/$(lsb_release -cs)/mysql-8.0 add-apt-repository 'http://repo.mysql.com/apt/ubuntu mysql-8.0' diff --git a/ci/mysql84.sh b/ci/mysql84.sh new file mode 100644 index 00000000..5c78da55 --- /dev/null +++ b/ci/mysql84.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -eux + +apt-get purge -qq '^mysql*' '^libmysql*' +rm -fr /etc/mysql +rm -fr /var/lib/mysql +apt-key add support/B7B3B788A8D3785C.asc # 8.1 and higher +# Verify the repository as add-apt-repository does not. +wget -q --spider http://repo.mysql.com/apt/ubuntu/dists/$(lsb_release -cs)/mysql-8.4-lts +add-apt-repository 'http://repo.mysql.com/apt/ubuntu mysql-8.4-lts' +apt-get update -qq +apt-get install -qq mysql-server libmysqlclient-dev diff --git a/ci/setup.sh b/ci/setup.sh index 938f0c8d..0089a384 100644 --- a/ci/setup.sh +++ b/ci/setup.sh @@ -4,6 +4,7 @@ set -eux # Change the password to be empty. CHANGED_PASSWORD=false +CHANGED_PASSWORD_SHA2=false # Change the password to be empty, recreating the root user on mariadb < 10.2 # where ALTER USER is not available. # https://stackoverflow.com/questions/56052177/ @@ -45,7 +46,13 @@ fi # Install MySQL 8.0 if DB=mysql80 if [[ -n ${DB-} && x$DB =~ ^xmysql80 ]]; then sudo bash ci/mysql80.sh - CHANGED_PASSWORD=true + CHANGED_PASSWORD_SHA2=true +fi + +# Install MySQL 8.4 if DB=mysql84 +if [[ -n ${DB-} && x$DB =~ ^xmysql84 ]]; then + sudo bash ci/mysql84.sh + CHANGED_PASSWORD_SHA2=true fi # Install MariaDB 10.6 if DB=mariadb10.6 @@ -60,6 +67,12 @@ if [[ -n ${GITHUB_ACTIONS-} && -n ${DB-} && x$DB =~ ^xmariadb10.11 ]]; then CHANGED_PASSWORD_BY_RECREATE=true fi +# Install MariaDB 11.4 if DB=mariadb11.4 +if [[ -n ${GITHUB_ACTIONS-} && -n ${DB-} && x$DB =~ ^xmariadb11.4 ]]; then + sudo bash ci/mariadb114.sh + CHANGED_PASSWORD_BY_RECREATE=true +fi + # Install MySQL/MariaDB if OS=darwin if [[ x$OSTYPE =~ ^xdarwin ]]; then brew update > /dev/null @@ -71,6 +84,7 @@ if [[ x$OSTYPE =~ ^xdarwin ]]; then brew info "$DB" brew install "$DB" zstd + brew link "$DB" # explicitly activate in case of kegged LTS versions DB_PREFIX="$(brew --prefix "${DB}")" export PATH="${DB_PREFIX}/bin:${PATH}" export LDFLAGS="-L${DB_PREFIX}/lib" @@ -108,6 +122,11 @@ if [ "${CHANGED_PASSWORD}" = true ]; then # https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/ sudo mysql ${MYSQL_OPTS} -u "${DB_SYS_USER}" \ -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''" +elif [ "${CHANGED_PASSWORD_SHA2}" = true ]; then + # In MySQL 5.7, the default authentication plugin is mysql_native_password. + # As of MySQL 8.0, the default authentication plugin is changed to caching_sha2_password. + sudo mysql ${MYSQL_OPTS} -u "${DB_SYS_USER}" \ + -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY ''" elif [ "${CHANGED_PASSWORD_BY_RECREATE}" = true ]; then sudo mysql ${MYSQL_OPTS} -u "${DB_SYS_USER}" <