diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a8c725..db8e3dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,63 +9,6 @@ on: - master jobs: - legacy: - runs-on: ubuntu-18.04 - services: - mysql: - image: mysql:5.5 - env: - MYSQL_ROOT_PASSWORD: pass - ports: - - "3306:3306" - options: >- - --health-cmd="mysqladmin ping" - --health-interval=10s - --health-timeout=5s - --health-retries=3 - - name: ruby-${{ matrix.ruby }} ${{ matrix.gemfile }} - strategy: - matrix: - include: - - gemfile: rails3.0 - ruby: 2.4 - - gemfile: rails3.1 - ruby: 2.4 - - gemfile: rails3.2 - ruby: 2.4 - - - gemfile: rails4.0 - ruby: 2.4 - - gemfile: rails4.1 - ruby: 2.4 - - gemfile: rails4.2 - ruby: 2.4 - - env: - BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile - BUNDLE_PATH_RELATIVE_TO_CWD: true - - steps: - - uses: actions/checkout@master - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler: default - bundler-cache: true - - - name: Set up database - run: | - cp spec/support/config.yml.github spec/support/config.yml - bundle exec rake db:create - - - name: Run tests - run: | - bundle exec rspec spec - - latest: runs-on: ubuntu-latest services: @@ -101,10 +44,15 @@ jobs: - gemfile: rails6.1 ruby: 3.0 - - gemfile: rails7.0 - ruby: 2.7 - gemfile: rails7.0 ruby: 3.0 + - gemfile: rails7.0 + ruby: 3.1 + + - gemfile: rails7.1 + ruby: 3.1 + - gemfile: rails7.1 + ruby: 3.2 env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile diff --git a/.ruby-version b/.ruby-version index b502146..be94e6f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.2 +3.2.2 diff --git a/Appraisals b/Appraisals index ac317fa..2784573 100644 --- a/Appraisals +++ b/Appraisals @@ -1,29 +1,23 @@ appraise "rails5.1" do gem "activerecord", "~> 5.1.0" - gem "mysql2", "~> 0.5.2" - gem "sqlite3", "~> 1.4.1" end appraise "rails5.2" do gem "activerecord", "~> 5.2.0" - gem "mysql2", "~> 0.5.2" - gem "sqlite3", "~> 1.4.1" end appraise "rails6.0" do gem "activerecord", "~> 6.0.0" - gem "mysql2", "~> 0.5.2" - gem "sqlite3", "~> 1.4.1" end appraise "rails6.1" do gem "activerecord", "~> 6.1.0" - gem "mysql2", "~> 0.5.2" - gem "sqlite3", "~> 1.4.1" end appraise "rails7.0" do gem "activerecord", "~> 7.0.0" - gem "mysql2", "~> 0.5" - gem "sqlite3", "~> 1.4" +end + +appraise "rails7.1" do + gem "activerecord", "~> 7.1.0" end diff --git a/CHANGELOG.md b/CHANGELOG.md index de1727b..9eb867d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log +## 0.5.0 2023-10-27 + +- Add support for Rails 7.1 +- Drop legacy test job because ubuntu-18.04 build node is not available anymore + ## 0.4.0 2022-02-12 - Add support for Rails 7.0 diff --git a/Gemfile b/Gemfile index 6741bed..8c8b150 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -gem "activerecord", "~> 7.0.0" +gem "activerecord", "~> 7.1.0" # Specify your gem's dependencies in octoshark.gemspec gemspec diff --git a/gemfiles/rails3.1.gemfile b/gemfiles/rails3.1.gemfile deleted file mode 100644 index 401354b..0000000 --- a/gemfiles/rails3.1.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 3.1.0" -gem "mysql2", "~> 0.3.10" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails3.2.gemfile b/gemfiles/rails3.2.gemfile deleted file mode 100644 index 3d8a447..0000000 --- a/gemfiles/rails3.2.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 3.2.0" -gem "mysql2", "~> 0.3.10" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails4.0.gemfile b/gemfiles/rails4.0.gemfile deleted file mode 100644 index 16438b9..0000000 --- a/gemfiles/rails4.0.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 4.0.0" -gem "mysql2", "~> 0.3.10" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails4.1.gemfile b/gemfiles/rails4.1.gemfile deleted file mode 100644 index 57ba79c..0000000 --- a/gemfiles/rails4.1.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 4.1.0" -gem "mysql2", "~> 0.3.13" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails4.2.gemfile b/gemfiles/rails4.2.gemfile deleted file mode 100644 index 9457e49..0000000 --- a/gemfiles/rails4.2.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 4.2.0" -gem "mysql2", "~> 0.3.13" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails5.1.gemfile b/gemfiles/rails5.1.gemfile index 2e39bfe..e2f8f85 100644 --- a/gemfiles/rails5.1.gemfile +++ b/gemfiles/rails5.1.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 5.1.0" -gem "mysql2", "~> 0.5.2" -gem "sqlite3", "~> 1.4.1" gemspec path: "../" diff --git a/gemfiles/rails5.2.gemfile b/gemfiles/rails5.2.gemfile index a745240..027888d 100644 --- a/gemfiles/rails5.2.gemfile +++ b/gemfiles/rails5.2.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 5.2.0" -gem "mysql2", "~> 0.5.2" -gem "sqlite3", "~> 1.4.1" gemspec path: "../" diff --git a/gemfiles/rails6.0.gemfile b/gemfiles/rails6.0.gemfile index 84d6c8b..b07bd13 100644 --- a/gemfiles/rails6.0.gemfile +++ b/gemfiles/rails6.0.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 6.0.0" -gem "mysql2", "~> 0.5.2" -gem "sqlite3", "~> 1.4.1" gemspec path: "../" diff --git a/gemfiles/rails6.1.gemfile b/gemfiles/rails6.1.gemfile index a9ebb29..07548db 100644 --- a/gemfiles/rails6.1.gemfile +++ b/gemfiles/rails6.1.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 6.1.0" -gem "mysql2", "~> 0.5.2" -gem "sqlite3", "~> 1.4.1" gemspec path: "../" diff --git a/gemfiles/rails7.0.gemfile b/gemfiles/rails7.0.gemfile index 254b2f7..bc1dfc9 100644 --- a/gemfiles/rails7.0.gemfile +++ b/gemfiles/rails7.0.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 7.0.0" -gem "mysql2", "~> 0.5" -gem "sqlite3", "~> 1.4" gemspec path: "../" diff --git a/gemfiles/rails3.0.gemfile b/gemfiles/rails7.1.gemfile similarity index 53% rename from gemfiles/rails3.0.gemfile rename to gemfiles/rails7.1.gemfile index d4744cf..69bc38a 100644 --- a/gemfiles/rails3.0.gemfile +++ b/gemfiles/rails7.1.gemfile @@ -2,8 +2,6 @@ source "https://rubygems.org" -gem "activerecord", "~> 3.0.0" -gem "mysql2", "< 0.3" -gem "sqlite3", "~> 1.3.13" +gem "activerecord", "~> 7.1.0" gemspec path: "../" diff --git a/lib/octoshark/connection_pools_manager.rb b/lib/octoshark/connection_pools_manager.rb index d4be4bd..982a5a5 100644 --- a/lib/octoshark/connection_pools_manager.rb +++ b/lib/octoshark/connection_pools_manager.rb @@ -81,6 +81,7 @@ def create_connection_pool(name, config) def build_connection_pool_spec(name, config) if active_record_6_1_or_7? env_name = defined?(Rails) ? Rails.env : nil + require "active_record/database_configurations" db_config = ActiveRecord::DatabaseConfigurations::HashConfig.new(env_name, name, config) pool_config_class = ActiveRecord::ConnectionAdapters::PoolConfig diff --git a/lib/octoshark/version.rb b/lib/octoshark/version.rb index 8ae28ff..342d788 100644 --- a/lib/octoshark/version.rb +++ b/lib/octoshark/version.rb @@ -1,3 +1,3 @@ module Octoshark - VERSION = "0.4.0" + VERSION = "0.5.0" end diff --git a/octoshark.gemspec b/octoshark.gemspec index c33e1de..209216f 100644 --- a/octoshark.gemspec +++ b/octoshark.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "activerecord", ">= 3.0" spec.add_development_dependency "rake" - spec.add_development_dependency "rspec", "~> 3.7.0" + spec.add_development_dependency "rspec", "~> 3.12.0" spec.add_development_dependency "sqlite3", "~> 1.4.1" spec.add_development_dependency "mysql2", "~> 0.5.2" spec.add_development_dependency "appraisal" diff --git a/spec/support/config.yml.github b/spec/support/config.yml.github index 765ebc9..b952a05 100644 --- a/spec/support/config.yml.github +++ b/spec/support/config.yml.github @@ -1,7 +1,6 @@ db1: adapter: mysql2 encoding: utf8 - reconnect: false database: octoshark_db1 pool: 5 username: root @@ -12,7 +11,6 @@ db1: db2: adapter: mysql2 encoding: utf8 - reconnect: false database: octoshark_db2 pool: 5 username: root diff --git a/spec/support/config.yml.template b/spec/support/config.yml.template index 236b77d..a3c4c5d 100644 --- a/spec/support/config.yml.template +++ b/spec/support/config.yml.template @@ -1,7 +1,6 @@ db1: adapter: mysql2 encoding: utf8 - reconnect: false database: octoshark_db1 pool: 5 username: root @@ -12,7 +11,6 @@ db1: db2: adapter: mysql2 encoding: utf8 - reconnect: false database: octoshark_db2 pool: 5 username: root