Skip to content

Commit c5aec93

Browse files
authored
Merge branch 'master' into master
2 parents 254b00e + b63d2e8 commit c5aec93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1240
-541
lines changed

.github/workflows/build.yml

Lines changed: 57 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,65 +4,77 @@ jobs:
44
build:
55
name: >-
66
${{ matrix.os }} ruby ${{ matrix.ruby }} ${{ matrix.db }}
7-
# Run all the tests on the new environment as much as possible.
8-
# https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners
97
runs-on: ${{ matrix.os }}
108
continue-on-error: ${{ matrix.allow-failure || false }}
119
strategy:
1210
matrix:
13-
os:
14-
# Use ubuntu-18.04 instead of ubuntu-20.04 temporarily, due to a failing test on mysql 8.0.
15-
# https://github.com/brianmario/mysql2/issues/1165
16-
# - ubuntu-20.04 # focal
17-
- ubuntu-18.04 # bionic
18-
ruby:
19-
- '3.1'
20-
- '3.0'
21-
- '2.7'
22-
- '2.6'
23-
- '2.5'
24-
- '2.4'
25-
- '2.3'
26-
- '2.2'
27-
- '2.1'
28-
db: ['']
2911
include:
30-
# Comment out due to ci/setup.sh stucking.
31-
# - {os: ubuntu-18.04, ruby: 2.4, db: mariadb10.1}
32-
# Allow failure due to the issue #965, #1165.
33-
- {os: ubuntu-20.04, ruby: '2.4', db: mariadb10.3, allow-failure: true}
34-
- {os: ubuntu-18.04, ruby: '2.4', db: mysql57}
35-
# Allow failure due to the issue #1165.
36-
- {os: ubuntu-20.04, ruby: '2.4', db: mysql80, allow-failure: true}
37-
- {os: ubuntu-18.04, ruby: 'head', db: '', allow-failure: true}
38-
# db: A DB's brew package name in macOS case.
39-
# Set a name "db: 'name@X.Y'" when using an old version.
40-
# MariaDB lastet version
41-
# Allow failure due to the following test failures that rarely happens.
12+
# Ruby 3.x on Ubuntu 24.04 LTS
13+
- {os: ubuntu-24.04, ruby: 'head', db: mysql84}
14+
- {os: ubuntu-24.04, ruby: '3.4', db: mysql84}
15+
16+
# Ruby 3.x on Ubuntu 22.04 LTS
17+
- {os: ubuntu-22.04, ruby: '3.4', db: mysql80}
18+
- {os: ubuntu-22.04, ruby: '3.3', db: mysql80}
19+
- {os: ubuntu-22.04, ruby: '3.2', db: mysql80}
20+
- {os: ubuntu-22.04, ruby: '3.1', db: mysql80}
21+
- {os: ubuntu-22.04, ruby: '3.0', db: mysql80}
22+
23+
# Ruby 2.x on Ubuntu 20.04 LTS
24+
- {os: ubuntu-20.04, ruby: '2.7', db: mysql80}
25+
- {os: ubuntu-20.04, ruby: '2.6', db: mysql80}
26+
- {os: ubuntu-20.04, ruby: '2.5', db: mysql80}
27+
- {os: ubuntu-20.04, ruby: '2.4', db: mysql80}
28+
- {os: ubuntu-20.04, ruby: '2.3', db: mysql80}
29+
- {os: ubuntu-20.04, ruby: '2.2', db: mysql80}
30+
- {os: ubuntu-20.04, ruby: '2.1', db: mysql80}
31+
- {os: ubuntu-20.04, ruby: '2.0', db: mysql80}
32+
33+
# MySQL 5.7 packages stopped after Ubuntu 18.04 Bionic
34+
# - {os: ubuntu-18.04, ruby: '2.7', db: mysql57}
35+
36+
# MariaDB LTS versions
37+
# db: on Linux, ci/setup.sh installs the specified packages
38+
# db: on MacOS, installs a Homebrew package use "name@X.Y" to specify a version
39+
40+
- {os: ubuntu-24.04, ruby: '3.4', db: mariadb11.4}
41+
- {os: ubuntu-22.04, ruby: '3.0', db: mariadb10.11}
42+
- {os: ubuntu-22.04, ruby: '2.7', db: mariadb10.11}
43+
- {os: ubuntu-22.04, ruby: '3.0', db: mariadb10.6}
44+
- {os: ubuntu-20.04, ruby: '2.7', db: mariadb10.6}
45+
46+
# TODO - Windows CI
47+
# - {os: windows-2022, ruby: '3.2', db: mysql80}
48+
# - {os: windows-2022, ruby: '2.7', db: mysql80}
49+
50+
# Allow failure due to this issue:
4251
# https://github.com/brianmario/mysql2/issues/1194
43-
- {os: macos-latest, ruby: '2.4', db: mariadb, allow-failure: true}
44-
# MySQL latest version
45-
# Allow failure due to the issue #1165.
46-
- {os: macos-latest, ruby: '2.4', db: mysql, allow-failure: true}
52+
- {os: macos-latest, ruby: '3.4', db: mariadb@11.4, ssl: openssl@3, allow-failure: true}
53+
- {os: macos-latest, ruby: '3.4', db: mysql@8.4, ssl: openssl@3, allow-failure: true}
54+
- {os: macos-latest, ruby: '2.6', db: mysql@8.0, ssl: openssl@1.1, allow-failure: true}
55+
4756
# On the fail-fast: true, it cancels all in-progress jobs
48-
# if any matrix job fails unlike Travis fast_finish.
57+
# if any matrix job fails, which we don't want.
4958
fail-fast: false
5059
env:
5160
BUNDLE_WITHOUT: development
61+
# reduce MacOS CI time, don't need to clean a runtime that isn't saved
62+
HOMEBREW_NO_INSTALL_CLEANUP: 1
63+
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
5264
steps:
5365
- uses: actions/checkout@v3
54-
- name: Install openssl
55-
if: matrix.os == 'macos-latest'
56-
run: |
57-
brew update
58-
brew install openssl
59-
# https://github.com/ruby/setup-ruby
6066
- uses: ruby/setup-ruby@v1
6167
with:
6268
ruby-version: ${{ matrix.ruby }}
6369
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
64-
- if: matrix.db != ''
65-
run: echo 'DB=${{ matrix.db }}' >> $GITHUB_ENV
66-
- run: sudo echo "127.0.0.1 mysql2gem.example.com" | sudo tee -a /etc/hosts
70+
- if: runner.os == 'Linux' || runner.os == 'macOS'
71+
run: sudo echo "127.0.0.1 mysql2gem.example.com" | sudo tee -a /etc/hosts
72+
- if: runner.os == 'Windows'
73+
run: echo "127.0.0.1 mysql2gem.example.com" | tee -a C:/Windows/System32/drivers/etc/hosts
74+
- run: echo 'DB=${{ matrix.db }}' >> $GITHUB_ENV
6775
- run: bash ci/setup.sh
68-
- run: bundle exec rake spec
76+
# Set the verbose option in the Makefile to print compiling command lines.
77+
- run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
78+
- if: matrix.ssl
79+
run: echo "rake_spec_opts=--with-openssl-dir=$(brew --prefix ${{ matrix.ssl }})" >> $GITHUB_ENV
80+
- run: bundle exec rake spec -- $rake_spec_opts

.github/workflows/container.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Fedora latest stable version
1717
- {distro: fedora, image: 'fedora:latest'}
1818
# Fedora development version
19-
- {distro: fedora, image: 'fedora:rawhide'}
19+
- {distro: fedora, image: 'fedora:rawhide', ssl_cert_dir: '/tmp/mysql2', ssl_cert_host: 'localhost'}
2020
# On the fail-fast: true, it cancels all in-progress jobs
2121
# if any matrix job fails unlike Travis fast_finish.
2222
fail-fast: false
@@ -27,4 +27,11 @@ jobs:
2727
# as a temporary workaround to avoid the following issue
2828
# in the Fedora >= 34 containers.
2929
# https://bugzilla.redhat.com/show_bug.cgi?id=1900021
30-
- run: docker run --add-host=mysql2gem.example.com:127.0.0.1 -t --cap-add=SYS_PTRACE --security-opt seccomp=unconfined mysql2
30+
- run: |
31+
docker run \
32+
--add-host=${{ matrix.ssl_cert_host || 'mysql2gem.example.com' }}:127.0.0.1 \
33+
-t \
34+
-e TEST_RUBY_MYSQL2_SSL_CERT_DIR="${{ matrix.ssl_cert_dir || '' }}" \
35+
-e TEST_RUBY_MYSQL2_SSL_CERT_HOST="${{ matrix.ssl_cert_host || '' }}" \
36+
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
37+
mysql2

.rubocop_todo.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Metrics/BlockNesting:
4545
# Offense count: 1
4646
# Configuration parameters: CountComments, CountAsOne.
4747
Metrics/ClassLength:
48-
Max: 135
48+
Max: 141
4949

5050
# Offense count: 3
5151
# Configuration parameters: IgnoredMethods.
@@ -87,6 +87,7 @@ Style/Documentation:
8787
- 'lib/mysql2/client.rb'
8888
- 'lib/mysql2/em.rb'
8989
- 'lib/mysql2/error.rb'
90+
- 'lib/mysql2/result.rb'
9091
- 'lib/mysql2/statement.rb'
9192

9293
# Offense count: 6

.travis.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

Gemfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ source 'https://rubygems.org'
33
gemspec
44

55
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.2")
6-
gem 'rake', '~> 13.0.1'
6+
gem 'rake', '~> 13.0'
77
else
88
gem 'rake', '< 13'
99
end
10-
gem 'rake-compiler', '~> 1.1.0'
10+
gem 'rake-compiler', '~> 1.2.0'
1111

1212
# For local debugging, irb is Gemified since Ruby 2.6
1313
gem 'irb', require: false
@@ -17,7 +17,8 @@ group :test do
1717
gem 'rspec', '~> 3.2'
1818

1919
# https://github.com/bbatsov/rubocop/pull/4789
20-
gem 'rubocop', '~> 1.30', '>= 1.30.1' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
20+
# 1.51 is the last version supporting Ruby 2.6
21+
gem 'rubocop', '>= 1.30.1', '< 1.51' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
2122
end
2223

2324
group :benchmarks, optional: true do

0 commit comments

Comments
 (0)