Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing against MRI 2.7-3.3, Rails 5.0-8.0 #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 7 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,17 @@ on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
ruby: [ '2.4', '2.5', '2.6', '2.7', '3.0', '3.1' ]
bundler: [ '1.17.3', '2.1.4' ]
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3' ]
database: [ 'mysql', 'postgresql', 'sqlite' ]
exclude:
- ruby: '2.4'
bundler: '2.1.4'
- ruby: '2.5'
bundler: '2.1.4'
- ruby: '2.6'
bundler: '2.1.4'
- ruby: '2.7'
bundler: '1.17.3'
- ruby: '3.0'
bundler: '1.17.3'
- ruby: '3.1'
bundler: '1.17.3'

services:
postgres:
image: postgres:13.5
image: postgres:16
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: gutentag
Expand All @@ -47,26 +33,14 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: ${{ matrix.bundler }}
bundler-cache: true

- name: Set up Bundler
run: |
export BUNDLER_VERSION=${{ matrix.bundler }}
export BUNDLE_PATH=$PWD/vendor/bundle

gem update --system

bundle _${{ matrix.bundler }}_ config set path $PWD/$BUNDLE_PATH
bundle _${{ matrix.bundler }}_ install --jobs=4 --retry=3
bundle _${{ matrix.bundler }}_ update
- name: Set up Appraisal
run: bundle exec appraisal update
run: bundle exec appraisal install
- name: Test
env:
CI: "true"
Expand All @@ -77,16 +51,15 @@ jobs:
run: bundle exec appraisal rspec

rubocop:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler: 2.1.4
bundler-cache: true
- name: Rubocop
run: bundle exec rubocop
66 changes: 29 additions & 37 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,59 +1,51 @@
# frozen_string_literal: true

appraise "rails_4_0" do
gem "rails", "~> 4.0.13"
gem "mysql2", "~> 0.3.10", :platform => :ruby
end if RUBY_VERSION.to_f < 2.4

appraise "rails_4_1" do
gem "rails", "~> 4.1.16"
gem "mysql2", "~> 0.3.13", :platform => :ruby
end if RUBY_VERSION.to_f < 2.4

appraise "rails_4_2" do
gem "rails", "~> 4.2.8"
gem "mysql2", "~> 0.4.0", :platform => :ruby

gem "activerecord-jdbcmysql-adapter", "~> 1.3.23", :platform => :jruby
gem "activerecord-jdbcpostgresql-adapter", "~> 1.3.23", :platform => :jruby
gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", :platform => :jruby
end if RUBY_VERSION.to_f < 2.7

appraise "rails_5_0" do
gem "rails", "~> 5.0.3"
gem "mysql2", "~> 0.4.0", :platform => :ruby
end if RUBY_VERSION.to_f >= 2.2 && RUBY_VERSION.to_f <= 2.7

appraise "rails_5_1" do
gem "rails", "~> 5.1.1"
gem "mysql2", "~> 0.4.0", :platform => :ruby
end if RUBY_VERSION.to_f >= 2.2 && RUBY_VERSION.to_f <= 2.7

appraise "rails_5_2" do
gem "rails", "~> 5.2.0"
gem "pg", "~> 1.0", :platform => :ruby
gem "mysql2", "~> 0.5.0", :platform => :ruby
end if RUBY_VERSION.to_f >= 2.2 && RUBY_VERSION.to_f <= 2.7
end if RUBY_VERSION.to_f <= 2.7

if RUBY_PLATFORM != "java"
appraise "rails_6_0" do
gem "rails", "~> 6.0.0"
gem "pg", "~> 1.0", :platform => :ruby
gem "mysql2", "~> 0.5.0", :platform => :ruby
gem "sqlite3", "~> 1.4", :platform => :ruby
end if RUBY_VERSION.to_f >= 2.5 && RUBY_VERSION.to_f <= 3.0
gem "sqlite3", ">= 1.4", :platform => :ruby
end if RUBY_VERSION.to_f <= 2.7

appraise "rails_6_1" do
gem "rails", "~> 6.1.0"
gem "pg", "~> 1.0", :platform => :ruby
gem "mysql2", "~> 0.5.0", :platform => :ruby
gem "sqlite3", "~> 1.4", :platform => :ruby
end if RUBY_VERSION.to_f >= 2.5
gem "sqlite3", ">= 1.4", :platform => :ruby
end

appraise "rails_7_0" do
gem "rails", "~> 7.0.1"
gem "rails", "~> 7.0.8.6"
gem "pg", "~> 1.0", :platform => :ruby
gem "mysql2", "~> 0.5.0", :platform => :ruby
gem "sqlite3", ">= 1.4", :platform => :ruby
end

appraise "rails_7_1" do
gem "rails", "~> 7.1.5"
gem "pg", "~> 1.0", :platform => :ruby
gem "mysql2", "~> 0.5.0", :platform => :ruby
gem "sqlite3", "~> 2.0", :platform => :ruby
end

appraise "rails_7_2" do
gem "rails", "~> 7.2.2"
gem "pg", "~> 1.0", :platform => :ruby
gem "mysql2", "~> 0.5.0", :platform => :ruby
gem "sqlite3", "~> 2.0", :platform => :ruby
end if RUBY_VERSION.to_f >= 3.1

appraise "rails_8_0" do
gem "rails", "~> 8.0.0"
gem "pg", "~> 1.0", :platform => :ruby
gem "mysql2", "~> 0.5.0", :platform => :ruby
gem "sqlite3", "~> 1.4", :platform => :ruby
end if RUBY_VERSION.to_f >= 2.7
gem "sqlite3", "~> 2.3", :platform => :ruby
end if RUBY_VERSION.to_f >= 3.2
end
10 changes: 4 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ source "https://rubygems.org"

gemspec

gem "test-unit", :platform => :ruby_22

gem "mysql2", "~> 0.3", :platform => :ruby
gem "pg", "~> 0.18", :platform => :ruby
gem "mysql2", "~> 0.5", :platform => :ruby
gem "pg", "~> 1.0", :platform => :ruby

if RUBY_VERSION.to_f < 3.0
gem "sqlite3", "~> 1.3.13"
else
gem "sqlite3", "~> 1.4"
gem "sqlite3", ">= 1.4"
end

gem "activerecord-jdbcmysql-adapter", ">= 1.3.23", :platform => :jruby
gem "activerecord-jdbcpostgresql-adapter", ">= 1.3.23", :platform => :jruby
gem "activerecord-jdbcsqlite3-adapter", ">= 1.3.23", :platform => :jruby

gem "activerecord", [">= 3.2.22"] if RUBY_PLATFORM == "java"
gem "activerecord", [">= 5.2"] if RUBY_PLATFORM == "java"

# Required for testing Rails 6.1 on MRI 3.1+
gem "net-smtp" if RUBY_VERSION.to_f > 3.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ Gutentag::Tag.names_for_scope(Article.order(created_at: :desc).limit(2))

These are the versions the test suite runs against. It's possible it may work on older versions of Ruby, but it definitely won't work on older versions of Rails.

* Ruby: MRI v2.3-v3.1, JRuby v9.2.5
* Rails/ActiveRecord: v4.0-v7.0
* Ruby: MRI v2.7-v3.3
* Rails/ActiveRecord: v5.2-v8.0

If you're using MRI v2.2 and/or ActiveRecord v3.2, the last version of Gutentag that fully supported those versions is v2.4.1.

Expand Down
Loading