Skip to content

Commit

Permalink
CI: Test with oldest allowed version of RuboCop
Browse files Browse the repository at this point in the history
  • Loading branch information
bquorning committed May 19, 2024
1 parent 28bf477 commit e9a9d2e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ jobs:
- name: Use latest RuboCop from `master`
run: |
echo "gem 'rubocop', github: 'rubocop/rubocop'" > Gemfile.local
cat Gemfile.local
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: NO_COVERAGE=true bundle exec rake ${{ matrix.task }}

oldest-rubocop:
runs-on: ubuntu-latest
strategy:
matrix:
task:
- spec
name: "Oldest RuboCop: ${{ matrix.task }}"
steps:
- uses: actions/checkout@v4
- name: Use oldest RuboCop allowed by gemspec
run: |
sed -nr "s/spec.add_dependency 'rubocop', '~> ([0-9\.]+)'/gem 'rubocop', '= \1'/p" \
rubocop-rspec.gemspec > Gemfile.local
cat Gemfile.local
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
Expand Down
2 changes: 1 addition & 1 deletion rubocop-rspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ Gem::Specification.new do |spec|
'rubygems_mfa_required' => 'true'
}

spec.add_runtime_dependency 'rubocop', '~> 1.40'
spec.add_dependency 'rubocop', '~> 1.40'
end
2 changes: 1 addition & 1 deletion spec/rubocop/cop/rspec/repeated_include_example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
RUBY
end

it 'allows for beginless ranges' do
it 'allows for beginless ranges', :ruby27 do
expect_no_offenses(<<~RUBY)
describe 'foo' do
include_examples 'irange', ..1
Expand Down

0 comments on commit e9a9d2e

Please sign in to comment.