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 340dce2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ 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

0 comments on commit 340dce2

Please sign in to comment.