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

📌 Loosen RuboCop dep requirements #63

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 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
43 changes: 43 additions & 0 deletions .github/workflows/heads.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: heads

on: [push, pull_request]

jobs:
test:
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
strategy:
fail-fast: true
matrix:
include:
# ruby-head
- ruby: "head"
appraisal: "rails-8-0"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby & RubyGems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: ${{ matrix.rubygems }}
bundler: ${{ matrix.bundler }}
bundler-cache: false
# `bundle` uses BUNDLE_GEMFILE, set automatically via matrix.gemfile (i.e. appraisal_root)
# We need to do this first to get appraisal installed.
# NOTE: We do not use the root Gemfile in CI workflows at all.
- name: Bundle for Appraisal ${{ matrix.appraisal }} on Ruby ${{ matrix.ruby }}
run: bundle
- name: Install Appraisal ${{ matrix.appraisal }} dependencies on Ruby ${{ matrix.ruby }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.taskname }} on Ruby ${{ matrix.ruby }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec rake ${{ matrix.taskname }}
39 changes: 39 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: style

on: [push, pull_request]

jobs:
rubocop:
name: RuboCop
strategy:
fail-fast: false
matrix:
include:
- ruby: "3.3"
appraisal: "style"
taskname: "rubocop"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest
runs-on: ubuntu-latest
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby & RubyGems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: ${{ matrix.rubygems }}
bundler: ${{ matrix.bundler }}
bundler-cache: false
# `bundle` uses BUNDLE_GEMFILE, set automatically via matrix.gemfile (i.e. appraisal_root)
# We need to do this first to get appraisal installed.
# NOTE: We do not use the root Gemfile in CI workflows at all.
- name: Bundle for Appraisal ${{ matrix.appraisal }} on Ruby ${{ matrix.ruby }}
run: bundle
- name: Install Appraisal ${{ matrix.appraisal }} dependencies on Ruby ${{ matrix.ruby }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Run ${{ matrix.appraisal }} style checks via ${{ matrix.taskname }} on Ruby ${{ matrix.ruby }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec rake ${{ matrix.taskname }}
109 changes: 93 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,104 @@ on: [push, pull_request]

jobs:
test:
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [3.0, 3.1, 3.2]
gemfile:
- Gemfile
include:
# Ruby 3.0
- ruby: "3.0"
appraisal: "rails-6-1"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: '3.5.23'
bundler: '2.5.23'
- ruby: "3.0"
appraisal: "rails-7-0"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: '3.5.23'
bundler: '2.5.23'
- ruby: "3.0"
appraisal: "rails-7-1"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: '3.5.23'
bundler: '2.5.23'

# Ruby 3.1
- ruby: "3.1"
appraisal: "rails-7-0"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest
- ruby: "3.1"
appraisal: "rails-7-1"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest
- ruby: "3.1"
appraisal: "rails-7-2"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest

# Ruby 3.2
- ruby: "3.2"
appraisal: "rails-7-1"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest
- ruby: "3.2"
appraisal: "rails-7-2"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest
- ruby: "3.2"
appraisal: "rails-8-0"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest

# Ruby 3.3
- ruby: "3.3"
appraisal: "rails-7-2"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest
- ruby: "3.3"
appraisal: "rails-8-0"
taskname: "spec"
gemfile: "appraisal_root"
rubygems: latest
bundler: latest

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby & RubyGems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run linter
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
run: bundle exec rubocop --parallel
- name: Run tests
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
run: bundle exec rake
rubygems: ${{ matrix.rubygems }}
bundler: ${{ matrix.bundler }}
bundler-cache: false
# `bundle` uses BUNDLE_GEMFILE, set automatically via matrix.gemfile (i.e. appraisal_root)
# We need to do this first to get appraisal installed.
# NOTE: We do not use the root Gemfile in CI workflows at all.
- name: Bundle for Appraisal ${{ matrix.appraisal }} on Ruby ${{ matrix.ruby }}
run: bundle
- name: Install Appraisal ${{ matrix.appraisal }} dependencies on Ruby ${{ matrix.ruby }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.taskname }} on Ruby ${{ matrix.ruby }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec rake ${{ matrix.taskname }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/pkg
/.idea

gemfiles/*.gemfile.lock
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ inherit_from:

require:
- rubocop/cop/internal_affairs
- rubocop-packaging

AllCops:
NewCops: enable
Expand Down
85 changes: 85 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# frozen_string_literal: true

# Appraisals

# To update Appraisal-generated gemfiles/*.gemfile run:
# BUNDLE_GEMFILE=appraisal_root.gemfile bundle update
# BUNDLE_GEMFILE=appraisal_root.gemfile appraisal update
# BUNDLE_GEMFILE=gemfiles/style.gemfile bundle exec rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment

appraise "style" do
gem "mutex_m", "~> 0.2"
gem "rails", ">= 6.1"
gem "rake", ">= 13"
gem "rubocop-packaging", "~> 0.5", ">= 0.5.2"
# Skip some bad releases of standard
gem "standard", ">= 1.35.1", "!= 1.41.1", "!= 1.42.0"
gem "stringio", "~> 3.0"
end

# Compat: Ruby >= 2.5
# Test Matrix:
# - Ruby 2.5
# - Ruby 2.6
# - Ruby 2.7
# + Ruby 3.0
appraise "rails-6-1" do
gem "mutex_m", "~> 0.2"
gem "rails", "~> 6.1.7.10"
gem "rake", ">= 13"
gem "rspec-rails"
gem "stringio", "~> 3.0"
end

# Compat: Ruby >= 2.7
# Test Matrix:
# - Ruby 2.7
# + Ruby 3.0
# + Ruby 3.1
appraise "rails-7-0" do
gem "mutex_m", "~> 0.2"
gem "rails", "~> 7.0.8", ">= 7.0.8.7"
gem "rake", ">= 13"
gem "rspec-rails"
gem "stringio", "~> 3.0"
end

# Compat: Ruby >= 2.7
# Test Matrix:
# - Ruby 2.7
# + Ruby 3.0
# + Ruby 3.1
# + Ruby 3.2
appraise "rails-7-1" do
gem "mutex_m", "~> 0.2"
gem "rails", "~> 7.1.5", ">= 7.1.5.1"
gem "rake", ">= 13"
gem "rspec-rails"
gem "stringio", "~> 3.0"
end

# Compat: Ruby >= 3.1
# Test Matrix:
# + Ruby 3.1
# + Ruby 3.2
# + Ruby 3.3
appraise "rails-7-2" do
gem "mutex_m", "~> 0.2"
gem "rails", "~> 7.2.2", ">= 7.2.2.1"
gem "rake", ">= 13"
gem "rspec-rails"
gem "stringio", "~> 3.0"
end

# Compat: Ruby >= 3.2
# Test Matrix:
# + Ruby 3.2
# + Ruby 3.3
# + ruby-head
appraise "rails-8-0" do
gem "mutex_m", "~> 0.2"
gem "rails", "~> 8.0.1"
gem "rake", ">= 13"
gem "rspec-rails"
gem "stringio", "~> 3.0"
end
16 changes: 9 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ source 'https://rubygems.org'

gemspec

group :development do
gem 'pry'
gem 'bundler'
gem 'rspec-rails'
gem 'rake', '>= 12.3.3'
gem 'standard'
end
# NOTE: Not adding appraisal here, because it should not be run against this Gemfile.
# See: `appraisal_root.gemfile`
gem 'rails', '>= 6.1'
gem 'pry'
gem 'rspec-rails'
gem 'rake', '>= 13'
gem 'rubocop-packaging', '~> 0.5', '>= 0.5.2'
# Skip some bad releases of standard
gem 'standard', '>= 1.35.1', '!= 1.41.1', '!= 1.42.0'
Loading