From 340dce24f3b96c07d70fae3e9940a7cb86aa1937 Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Sun, 19 May 2024 16:42:35 +0200 Subject: [PATCH] CI: Test with oldest allowed version of RuboCop --- .github/workflows/main.yml | 20 ++++++++++++++++++++ rubocop-rspec.gemspec | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 06093c254..11cf67bf4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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" diff --git a/rubocop-rspec.gemspec b/rubocop-rspec.gemspec index 1a3b64f94..9c52b6a36 100644 --- a/rubocop-rspec.gemspec +++ b/rubocop-rspec.gemspec @@ -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