Skip to content

Commit

Permalink
Test mysql80-community-release-fc39-2.noarch.rpm on Fedora 39
Browse files Browse the repository at this point in the history
  • Loading branch information
YukiJikumaru committed Jun 23, 2024
1 parent b2b6d7b commit 044e072
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 106 deletions.
142 changes: 71 additions & 71 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
name: Build
on: [push, pull_request]
jobs:
build:
name: >-
${{ matrix.os }} ruby ${{ matrix.ruby }} ${{ matrix.db }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow-failure || false }}
strategy:
matrix:
include:
# Ruby 3.x on Ubuntu 22.04 LTS (latest at this time)
- {os: ubuntu-22.04, ruby: 'head', 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}
- {os: ubuntu-22.04, ruby: '3.0', db: mysql80}

# Ruby 2.x on Ubuntu 20.04 LTS
- {os: ubuntu-20.04, ruby: '2.7', db: mysql80}
- {os: ubuntu-20.04, ruby: '2.6', db: mysql80}
- {os: ubuntu-20.04, ruby: '2.5', db: mysql80}
- {os: ubuntu-20.04, ruby: '2.4', db: mysql80}
- {os: ubuntu-20.04, ruby: '2.3', db: mysql80}
- {os: ubuntu-20.04, ruby: '2.2', db: mysql80}
- {os: ubuntu-20.04, ruby: '2.1', db: mysql80}
- {os: ubuntu-20.04, ruby: '2.0', db: mysql80}

# 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-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-18.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: openssl@1.1, allow-failure: true}
- {os: macos-latest, ruby: '2.6', db: mysql, 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
env:
BUNDLE_WITHOUT: development
# reduce MacOS CI time, don't need to clean a runtime that isn't saved
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- if: runner.os == 'Linux' || runner.os == 'macOS'
run: sudo echo "127.0.0.1 mysql2gem.example.com" | sudo tee -a /etc/hosts
- if: runner.os == 'Windows'
run: echo "127.0.0.1 mysql2gem.example.com" | tee -a C:/Windows/System32/drivers/etc/hosts
- run: echo 'DB=${{ matrix.db }}' >> $GITHUB_ENV
- run: bash ci/setup.sh
# Set the verbose option in the Makefile to print compiling command lines.
- run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
- if: matrix.ssl
run: echo "rake_spec_opts=--with-openssl-dir=$(brew --prefix ${{ matrix.ssl }})" >> $GITHUB_ENV
- run: bundle exec rake spec -- $rake_spec_opts
#name: Buil
#on: [push, pull_request]
#jobs:
# build:
# name: >-
# ${{ matrix.os }} ruby ${{ matrix.ruby }} ${{ matrix.db }}
# runs-on: ${{ matrix.os }}
# continue-on-error: ${{ matrix.allow-failure || false }}
# strategy:
# matrix:
# include:
# # Ruby 3.x on Ubuntu 22.04 LTS (latest at this time)
# - {os: ubuntu-22.04, ruby: 'head', 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}
# - {os: ubuntu-22.04, ruby: '3.0', db: mysql80}
#
# # Ruby 2.x on Ubuntu 20.04 LTS
# - {os: ubuntu-20.04, ruby: '2.7', db: mysql80}
# - {os: ubuntu-20.04, ruby: '2.6', db: mysql80}
# - {os: ubuntu-20.04, ruby: '2.5', db: mysql80}
# - {os: ubuntu-20.04, ruby: '2.4', db: mysql80}
# - {os: ubuntu-20.04, ruby: '2.3', db: mysql80}
# - {os: ubuntu-20.04, ruby: '2.2', db: mysql80}
# - {os: ubuntu-20.04, ruby: '2.1', db: mysql80}
# - {os: ubuntu-20.04, ruby: '2.0', db: mysql80}
#
# # 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-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-18.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: openssl@1.1, allow-failure: true}
# - {os: macos-latest, ruby: '2.6', db: mysql, 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
# env:
# BUNDLE_WITHOUT: development
# # reduce MacOS CI time, don't need to clean a runtime that isn't saved
# HOMEBREW_NO_INSTALL_CLEANUP: 1
# HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
# steps:
# - uses: actions/checkout@v3
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: ${{ matrix.ruby }}
# bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# - if: runner.os == 'Linux' || runner.os == 'macOS'
# run: sudo echo "127.0.0.1 mysql2gem.example.com" | sudo tee -a /etc/hosts
# - if: runner.os == 'Windows'
# run: echo "127.0.0.1 mysql2gem.example.com" | tee -a C:/Windows/System32/drivers/etc/hosts
# - run: echo 'DB=${{ matrix.db }}' >> $GITHUB_ENV
# - run: bash ci/setup.sh
# # Set the verbose option in the Makefile to print compiling command lines.
# - run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
# - if: matrix.ssl
# run: echo "rake_spec_opts=--with-openssl-dir=$(brew --prefix ${{ matrix.ssl }})" >> $GITHUB_ENV
# - run: bundle exec rake spec -- $rake_spec_opts
4 changes: 2 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
matrix:
include:
# CentOS 7 system Ruby is the fixed version 2.0.0.
- {distro: centos, image: 'centos:7', name_extra: 'ruby 2.0.0'}
# - {distro: centos, image: 'centos:7', name_extra: 'ruby 2.0.0'}
# Fedora latest stable version
- {distro: fedora, image: 'fedora:latest'}
# Fedora development version
- {distro: fedora, image: 'fedora:rawhide', ssl_cert_dir: '/tmp/mysql2'}
# - {distro: fedora, image: 'fedora:rawhide', ssl_cert_dir: '/tmp/mysql2'}
# On the fail-fast: true, it cancels all in-progress jobs
# if any matrix job fails unlike Travis fast_finish.
fail-fast: false
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: RuboCop

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development
steps:
- uses: actions/checkout@v3
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run RuboCop
run: bundle exec rubocop
#name: RuboCop
#
#on: [push, pull_request]
#
#jobs:
# build:
# runs-on: ubuntu-latest
# env:
# BUNDLE_WITHOUT: development
# steps:
# - uses: actions/checkout@v3
# - name: Set up Ruby 2.6
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 2.6
# bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# - name: Run RuboCop
# run: bundle exec rubocop
7 changes: 4 additions & 3 deletions ci/Dockerfile_fedora
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG IMAGE=fedora:latest
ARG IMAGE=fedora:39
FROM ${IMAGE}

WORKDIR /build
Expand All @@ -16,12 +16,13 @@ RUN dnf -yq install \
git \
libyaml-devel \
make \
mariadb-connector-c-devel \
mariadb-server \
redhat-rpm-config \
ruby-devel \
rubygem-bigdecimal \
rubygem-bundler \
rubygem-json

RUN rpm -ivh https://dev.mysql.com/get/mysql80-community-release-fc39-2.noarch.rpm && \
yum --enablerepo=mysql80-community install -y mysql-community-devel mysql-community-common mysql-community-server mysql-community-client

CMD bash ci/container.sh
23 changes: 11 additions & 12 deletions ci/setup_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@

set -eux

MYSQL_TEST_LOG="$(pwd)/mysql.log"
MYSQL_TEST_LOG="/var/log/mysqld_error.log"

bash ci/ssl.sh

mysql_install_db \
--log-error="${MYSQL_TEST_LOG}"
/usr/libexec/mysqld \
--user="$(id -un)" \
--log-error="${MYSQL_TEST_LOG}" \
--ssl &
/usr/sbin/mysqld --user=mysql --initialize
INITIAL_PASSWD=$(tail -n 1 /var/log/mysqld.log | awk '{print $13}')
/usr/sbin/mysqld --user=mysql --log-error="/var/log/mysqld.log" --ssl &
sleep 3
cat ${MYSQL_TEST_LOG}

/usr/libexec/mysqld --version
cat <<SQL | mysql -uroot -p"$INITIAL_PASSWD" --connect-expired-password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'auth_string';
mysql -u root <<SQL
DROP USER 'root'@'localhost';
CREATE USER 'root'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
CREATE DATABASE IF NOT EXISTS test;
SQL

mysql -u root -e 'CREATE DATABASE IF NOT EXISTS test'
cat ${MYSQL_TEST_LOG}

/usr/libexec/mysqld --version

0 comments on commit 044e072

Please sign in to comment.