diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 101416c0..1cab3623 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,19 +10,25 @@ permissions: jobs: rspec: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: ruby: - - '3.3' - - '3.2' - - '3.1' - - '3.0' - - '2.7' - - '2.6' - - '2.5' - - '2.4' + - 3.3 + - 3.2 + - 3.1 + rails: + - 7.2 + include: + # Edge + - { ruby: 'head', rails: 'edge', allow-fail: true } + # Outdated + - { ruby: '3.0', rails: '7.1', allow-fail: true } + - { ruby: '2.7', rails: '7.1', allow-fail: true } + - { ruby: '2.6', rails: '6', allow-fail: true } + - { ruby: '2.5', rails: '6', allow-fail: true } + - { ruby: '2.4', rails: '5', allow-fail: true } services: mongodb: @@ -31,13 +37,13 @@ jobs: - 27017:27017 steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + rubygems: latest bundler-cache: true - name: RSpec & publish code coverage @@ -46,3 +52,4 @@ jobs: CC_TEST_REPORTER_ID: b7ba588af2a540fa96c267b3655a2afe31ea29976dc25905a668dd28d5e88915 with: coverageCommand: bin/rake + continue-on-error: ${{ matrix.allow-fail }} diff --git a/Gemfile b/Gemfile index f9458e44..8cc5cb31 100644 --- a/Gemfile +++ b/Gemfile @@ -2,12 +2,10 @@ source "https://rubygems.org" gemspec +gem 'puma' + platforms :ruby do - if RUBY_VERSION >= "2.5.0" - gem 'sqlite3', '~> 1.4' - else - gem 'sqlite3', '~> 1.3.6' - end + gem 'sqlite3' end platforms :jruby do @@ -15,30 +13,24 @@ platforms :jruby do gem "activerecord-jdbcsqlite3-adapter" end -if RUBY_VERSION >= "2.6.0" - gem "turbo-rails" - gem "redis", "~> 4.0" -end +gem 'mongoid' -if RUBY_VERSION >= "2.5.0" - gem "rails", "~> 6.0" - gem 'webrick' +case rails_version = ENV['RAILS_VERSION'] +when nil + gem 'rails' +when 'edge' + gem 'rails', github: 'rails/rails' else - gem "rails", "~> 5.0" + gem 'rails', "~> #{rails_version}.0" end -if RUBY_VERSION >= "2.7.0" - gem "mongoid", github: "mongodb/mongoid" -elsif RUBY_VERSION >= "2.6.0" - gem "mongoid", "~> 8.1" -else - gem "mongoid", "~> 7.2" -end - -if RUBY_VERSION >= "3.1.0" - gem "net-imap" - gem "net-pop" - gem "net-smtp" +case RUBY_VERSION +when '2.6'...'3.0' + gem "turbo-rails", "<= 2.0.7" + gem "redis", "~> 4.0" +when '3.0'...'4' + gem 'turbo-rails' + gem 'redis' end if RUBY_VERSION < "2.5.0"