Skip to content

Commit

Permalink
Testing against MRI 2.7-3.3, Rails 5.0-8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed Nov 23, 2024
1 parent a2c13e9 commit f9fa9db
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 59 deletions.
39 changes: 6 additions & 33 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,24 +33,12 @@ 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
- name: Test
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
50 changes: 26 additions & 24 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
# 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
end if 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
end if 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
Expand All @@ -51,9 +32,30 @@ if RUBY_PLATFORM != "java"
end if RUBY_VERSION.to_f >= 2.5

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 if RUBY_VERSION.to_f >= 2.7
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.3", :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.3", :platform => :ruby
end

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", "~> 2.3", :platform => :ruby
end
end
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.0-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

0 comments on commit f9fa9db

Please sign in to comment.