Skip to content

Commit

Permalink
Merge pull request brianmario#1387 from sodabrew/ci-ruby-3.4
Browse files Browse the repository at this point in the history
CI: Add Ruby 3.4, MySQL 8.4, MariaDB 11.4, Ubuntu 24.04 and other updates
  • Loading branch information
sodabrew authored Dec 27, 2024
2 parents 58f8d00 + 078067a commit e37e180
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 15 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -26,24 +30,29 @@ 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 "[email protected]" 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}
# - {os: windows-2022, ruby: '2.7', db: mysql80}

# Allow failure due to this issue:
# https://github.com/brianmario/mysql2/issues/1194
- {os: macos-latest, ruby: '2.6', db: mariadb, ssl: [email protected], allow-failure: true}
- {os: macos-latest, ruby: '2.6', db: mysql, ssl: [email protected], allow-failure: true}
- {os: macos-latest, ruby: '3.4', db: [email protected], ssl: openssl@3, allow-failure: true}
- {os: macos-latest, ruby: '3.4', db: [email protected], ssl: openssl@3, allow-failure: true}
- {os: macos-latest, ruby: '2.6', db: [email protected], ssl: [email protected], 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
Expand Down
10 changes: 10 additions & 0 deletions ci/mariadb114.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion ci/mysql57.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion ci/mysql80.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
13 changes: 13 additions & 0 deletions ci/mysql84.sh
Original file line number Diff line number Diff line change
@@ -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
21 changes: 20 additions & 1 deletion ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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}" <<SQL
DROP USER 'root'@'localhost';
Expand Down
12 changes: 6 additions & 6 deletions spec/mysql2/result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
it "should return correct types" do
expected_types = %w[
mediumint(9)
varchar(10)
varchar(13)
bit(64)
bit(1)
tinyint(4)
Expand All @@ -152,16 +152,16 @@
timestamp
time
year(4)
char(10)
varchar(10)
char(13)
varchar(13)
binary(10)
varbinary(10)
tinyblob
tinytext
text(1020)
blob
text
text(262140)
mediumblob
mediumtext
text(67108860)
longblob
longtext
enum
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
RSpec.configure do |config|
config.disable_monkey_patching!

config.expect_with :rspec do |expectations|
expectations.max_formatted_output_length = 1200
end

def with_internal_encoding(encoding)
old_enc = Encoding.default_internal
old_verbose = $VERBOSE
Expand Down
66 changes: 66 additions & 0 deletions support/B7B3B788A8D3785C.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: Hostname:
Version: Hockeypuck 2.2

xsFNBGU2rNoBEACSi5t0nL6/Hj3d0PwsbdnbY+SqLUIZ3uWZQm6tsNhvTnahvPPZ
BGdl99iWYTt2KmXp0KeN2s9pmLKkGAbacQP1RqzMFnoHawSMf0qTUVjAvhnI4+qz
MDjTNSBq9fa3nHmOYxownnrRkpiQUM/yD7/JmVENgwWb6akZeGYrXch9jd4XV3t8
OD6TGzTedTki0TDNr6YZYhC7jUm9fK9Zs299pzOXSxRRNGd+3H9gbXizrBu4L/3l
UrNf//rM7OvV9Ho7u9YYyAQ3L3+OABK9FKHNhrpi8Q0cbhvWkD4oCKJ+YZ54XrOG
0YTg/YUAs5/3//FATI1sWdtLjJ5pSb0onV3LIbarRTN8lC4Le/5kd3lcot9J8b3E
MXL5p9OGW7wBfmNVRSUI74Vmwt+v9gyp0Hd0keRCUn8lo/1V0YD9i92KsE+/IqoY
Tjnya/5kX41jB8vr1ebkHFuJ404+G6ETd0owwxq64jLIcsp/GBZHGU0RKKAo9DRL
H7rpQ7PVlnw8TDNlOtWt5EJlBXFcPL+NgWbqkADAyA/XSNeWlqonvPlYfmasnAHA
pMd9NhPQhC7hJTjCiAwG8UyWpV8Dj07DHFQ5xBbk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heB
-----END PGP PUBLIC KEY BLOCK-----

0 comments on commit e37e180

Please sign in to comment.