From 3abcc204c32dd286fe8ef88ef62ed08b66066820 Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Tue, 19 Mar 2024 15:12:39 +1100 Subject: [PATCH] Simplify CI matrix --- .github/workflows/ci.yml | 38 ++++++++++----------------------- mysql-binuuid-rails.gemspec | 4 ++-- test/gemfiles/rails-5.0.gemfile | 3 +++ test/gemfiles/rails-5.1.gemfile | 3 +++ test/gemfiles/rails-5.2.gemfile | 3 +++ test/gemfiles/rails-6.0.gemfile | 3 +++ test/gemfiles/rails-6.1.gemfile | 3 +++ test/gemfiles/rails-7.0.gemfile | 3 +++ 8 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 test/gemfiles/rails-5.0.gemfile create mode 100644 test/gemfiles/rails-5.1.gemfile create mode 100644 test/gemfiles/rails-5.2.gemfile create mode 100644 test/gemfiles/rails-6.0.gemfile create mode 100644 test/gemfiles/rails-6.1.gemfile create mode 100644 test/gemfiles/rails-7.0.gemfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc6a92e..4307f11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,33 +11,18 @@ jobs: continue-on-error: true strategy: matrix: - ruby-version: - - "2.7" - - "3.0" - - "3.1" - - "3.2" - - "3.3" - rails-version: - - "5.2.8" - - "6.1.6" - - "7.0.0" - - "7.0.1" - - "7.0.2" - - "7.0.3.1" - - "7.0.4.1" - exclude: - - { ruby-version: "3.0", rails-version: "5.2.8" } - - { ruby-version: "3.1", rails-version: "5.2.8" } - - { ruby-version: "3.1", rails-version: "7.0.0" } # See fixed Ruby 3.1 <> Rails 7.0.0 incompatibility: https://github.com/rails/rails/releases/tag/v7.0.1 - - { ruby-version: "3.2", rails-version: "5.2.8" } - - { ruby-version: "3.2", rails-version: "7.0.0" } - - { ruby-version: "3.3", rails-version: "5.2.8" } - - { ruby-version: "3.3", rails-version: "7.0.0" } - name: tests (ruby-${{ matrix.ruby-version }}, rails-${{ matrix.rails-version }}) + ruby: [ "3.3", "3.2", "3.1", "3.0" ] + rails: [ "7.0", "6.1"] + include: + - { ruby: "2.7", rails: "6.0" } + - { ruby: "2.7", rails: "5.2" } + - { ruby: "2.7", rails: "5.1" } + - { ruby: "2.7", rails: "5.0" } + name: "tests (Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.rails }})" runs-on: ubuntu-latest env: MYSQL_HOST: '127.0.0.1' - RAILS_VERSION: ${{ matrix.rails-version }} + BUNDLE_GEMFILE: test/gemfiles/rails-${{ matrix.rails }}.gemfile services: mysql: image: mysql:8 @@ -47,10 +32,9 @@ jobs: MYSQL_ALLOW_EMPTY_PASSWORD: "yes" options: --health-cmd "mysqladmin ping" --health-interval 5s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: ${{ matrix.ruby-version }} - - run: bundle update activerecord + ruby-version: ${{ matrix.ruby }} - run: bundle exec rake diff --git a/mysql-binuuid-rails.gemspec b/mysql-binuuid-rails.gemspec index 24a6077..a2ffd47 100644 --- a/mysql-binuuid-rails.gemspec +++ b/mysql-binuuid-rails.gemspec @@ -20,11 +20,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.7" - spec.add_runtime_dependency "activerecord", ENV["RAILS_VERSION"] || ">= 5" + spec.add_runtime_dependency "activerecord", ">= 5" spec.add_development_dependency "bundler" spec.add_development_dependency "rake" spec.add_development_dependency "mysql2" spec.add_development_dependency "minitest" - spec.add_development_dependency "rails", ENV["RAILS_VERSION"] || ">= 5" # required for a console + spec.add_development_dependency "rails", ">= 5" # required for a console end diff --git a/test/gemfiles/rails-5.0.gemfile b/test/gemfiles/rails-5.0.gemfile new file mode 100644 index 0000000..2d7d4f0 --- /dev/null +++ b/test/gemfiles/rails-5.0.gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" +gemspec path: "../.." +gem "activerecord", "~> 5.0.0" diff --git a/test/gemfiles/rails-5.1.gemfile b/test/gemfiles/rails-5.1.gemfile new file mode 100644 index 0000000..4dda832 --- /dev/null +++ b/test/gemfiles/rails-5.1.gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" +gemspec path: "../.." +gem "activerecord", "~> 5.1.0" diff --git a/test/gemfiles/rails-5.2.gemfile b/test/gemfiles/rails-5.2.gemfile new file mode 100644 index 0000000..d2f0191 --- /dev/null +++ b/test/gemfiles/rails-5.2.gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" +gemspec path: "../.." +gem "activerecord", "~> 5.2.0" diff --git a/test/gemfiles/rails-6.0.gemfile b/test/gemfiles/rails-6.0.gemfile new file mode 100644 index 0000000..445644b --- /dev/null +++ b/test/gemfiles/rails-6.0.gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" +gemspec path: "../.." +gem "activerecord", "~> 6.0.0" diff --git a/test/gemfiles/rails-6.1.gemfile b/test/gemfiles/rails-6.1.gemfile new file mode 100644 index 0000000..53669da --- /dev/null +++ b/test/gemfiles/rails-6.1.gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" +gemspec path: "../.." +gem "activerecord", "~> 6.1.0" diff --git a/test/gemfiles/rails-7.0.gemfile b/test/gemfiles/rails-7.0.gemfile new file mode 100644 index 0000000..aa81086 --- /dev/null +++ b/test/gemfiles/rails-7.0.gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" +gemspec path: "../.." +gem "activerecord", "~> 7.0.0"