Skip to content

Commit

Permalink
Workflows / CI: fixed & refactored
Browse files Browse the repository at this point in the history
## Fixed

* Ruby 2.6 (see hotwired/turbo-rails/#681).

## Changed

* Moved Rails versions to CI `matrix`.
* Both edge and outdated Ruby / Rails versions may fail.
* Use the latest RubyGems.
  • Loading branch information
Alexander-Senko committed Sep 25, 2024
1 parent 93a9bc2 commit 230137a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 36 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -46,3 +52,4 @@ jobs:
CC_TEST_REPORTER_ID: b7ba588af2a540fa96c267b3655a2afe31ea29976dc25905a668dd28d5e88915
with:
coverageCommand: bin/rake
continue-on-error: ${{ matrix.allow-fail }}
42 changes: 17 additions & 25 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,35 @@ 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
gem "minitest"
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"
Expand Down

0 comments on commit 230137a

Please sign in to comment.