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

Finish GitHub actions transition #987

Merged
merged 18 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from 16 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
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@ on: [push, pull_request, workflow_dispatch]

jobs:
tests:
name: Tests with Ruby ${{ matrix.ruby-version }} and Rails ${{ matrix.gemfile }}
runs-on: ubuntu-latest
strategy:
matrix:
gemfile: ["5.0"]
ruby-version: [2.3]
ruby-version: [2.6]
include:
- gemfile: "5.0"
ruby-version: 2.7
- gemfile: "5.1"
ruby-version: 2.4
- gemfile: "5.2"
ruby-version: 2.5
ruby-version: 2.6
- gemfile: "5.1"
ruby-version: 2.7
- gemfile: "5.2"
ruby-version: 2.6
- gemfile: "5.2"
ruby-version: 2.7
- gemfile: "6.0"
ruby-version: 2.6
- gemfile: "6.0"
ruby-version: 2.7
- gemfile: "6.1"
ruby-version: 2.7
- gemfile: "6.1"
ruby-version: 3.0

env:
BUNDLE_GEMFILE: /home/runner/work/wicked_pdf/wicked_pdf/gemfiles/${{ matrix.gemfile }}.gemfile
Expand All @@ -41,5 +50,5 @@ jobs:
- name: Install gem dependencies
run: bundle install

- name: Run tests with Ruby ${{ matrix.ruby-version }} and Gemfile ${{ matrix.gemfile }}
- name: Run tests with Ruby ${{ matrix.ruby-version }} and Rails ${{ matrix.gemfile }}
run: bundle exec rake
48 changes: 47 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,57 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.2
NewCops: disable
TargetRubyVersion: 2.6
Exclude:
- 'gemfiles/bin/*'
- 'test/dummy/**/*'

Metrics/PerceivedComplexity:
Enabled: false

Bundler/OrderedGems:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/RedundantBegin:
Enabled: false

Style/NumericPredicate:
Enabled: false

Style/RedundantRegexpEscape:
Enabled: false

Style/SafeNavigation:
Enabled: false

Lint/SendWithMixinArgument:
Enabled: false

Lint/RedundantCopDisableDirective:
Enabled: false

Metrics/AbcSize:
Enabled: false

Style/StringConcatenation:
Enabled: false

Style/RedundantFetchBlock:
Enabled: false

Style/CaseLikeIf:
Enabled: false

Style/SoleNestedConditional:
Enabled: false

Style/RedundantReturn:
Enabled: false

Metrics/BlockLength:
Exclude:
- 'wicked_pdf.gemspec'
Expand Down
84 changes: 0 additions & 84 deletions .travis.yml

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/4.0.gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/4.1.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/4.2.gemfile

This file was deleted.

12 changes: 12 additions & 0 deletions gemfiles/6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source 'https://rubygems.org'

gem 'bootsnap' # required to run `rake test` in Rails 6.1
gem 'bundler', '~>2'
gem 'mocha', '= 1.3' # newer versions blow up
gem 'rails', '~>6.1.0'
gem 'rdoc'
gem 'sprockets', '~>3.0'
gem 'sqlite3', '~> 1.4'
gem 'rubocop', '1.11.0'

gemspec :path => '../'
9 changes: 0 additions & 9 deletions gemfiles/rails_edge.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion wicked_pdf.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DESC
'changelog_uri' => 'https://github.com/mileszs/wicked_pdf/blob/master/CHANGELOG.md'
}

spec.required_ruby_version = Gem::Requirement.new('>= 2.2')
spec.required_ruby_version = Gem::Requirement.new('>= 2.6')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to raise this minimum Ruby version, and by so much? I'd like people on older rubies to still be able to use this gem.

Copy link
Contributor Author

@pedrofurtado pedrofurtado Aug 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can maintain this old ruby version, if you prefer, no problem 🤝 But CI tests may not guarantee it works well on such older versions of the gem + rails version used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made rollback on this change, returning to ruby 2.2 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My two cents here, I usually keep CI to run for old versions as long as tests pass.
Once we hit a failure, then we take the decision if it's worth fixing or moving on, deprecating the failing version.

spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
Expand Down