Skip to content

Commit

Permalink
Fix Rubocop and make sure all test pass under all supported version o…
Browse files Browse the repository at this point in the history
…f activesupport (#40)

* run for each supported version of activesupport

* ignore enforced method signature merged in #39

* use ENV.fetch

* move rails 4.x for old ruby only

* 2.7 is minimum

* will the cache key update?

* use cache-version
  • Loading branch information
mjobin-mdsol authored Nov 1, 2023
1 parent 9fc95df commit 15c6d0f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,34 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.2']
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
rails: ['5.2.7', '6.0.4', '6.1.7', '7.0.8', '7.1.1']
include:
- rails: '4.0.1'
ruby: '2.7'
- rails: '4.1.1'
ruby: '2.7'
- rails: '4.2.1'
ruby: '2.7'
- rails: '5.0.1'
ruby: '2.7'
- rails: '5.1.1'
ruby: '2.7'

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
ruby-version: ${{ matrix.ruby }}
cache-version: rails-${{ matrix.rails }} # for the cache key
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run rubocop
run: bundle exec rubocop
- name: Run tests
run: bundle exec rspec
- name: Run benchmark
run: bundle exec rake benchmark

env:
RAILS_VER: ${{ matrix.rails }}
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
inherit_from: .rubocop_todo.yml

require:
- rubocop-performance

Expand Down
28 changes: 28 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-10-30 07:24:07 UTC using RuboCop version 1.24.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space
Layout/SpaceAroundEqualsInParameterDefault:
Exclude:
- 'lib/lorekeeper/multi_logger.rb'

# Offense count: 1
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'lib/lorekeeper/multi_logger.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantFreeze:
Exclude:
- 'lib/lorekeeper/backtrace_cleaner.rb'
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in lorekeeper.gemspec
gemspec

gem 'activesupport', "~> #{ENV.fetch('RAILS_VER', '7.1.1')}"

0 comments on commit 15c6d0f

Please sign in to comment.