-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade all the things, 2023 edition
This gem is severely out of date. Not only is the version of `shoulda-matchers` very old, but I can't even get this project up and running on my computer anymore because it relies on an old version of Ruby. So, the primary motivation behind this commit is to bump the dependency on `shoulda-matchers` to 5.x. Besides this, in `shoulda-matchers` there are changes that either have been merged or are in flight which aim to upgrade dependencies, drop support for old Rubies and Rails, etc., and I've integrated them into this commit as well. These include: * Update development Ruby to 3.2.1 * Replace Travis config with GitHub Actions workflows * Upgrade Rubocop configuration, and correct lint violations * Add support for Ruby 3.0, 3.1, and 3.2 as well as Rails 6.1 and 7.0 * Drop support for Ruby < 3 and Rails < 6.1 In addition, I've had to update some of the tests which failed after performing these upgrades: * Patch Snowglobe (which is used in tests to generate a Rails application) due to some incompatibilities with recent Rails versions and bugs * Make sure to install `rails-controller-testing` and `bcrypt` in generated Rails application * Update tests involving `filter_param` as Rails changed which parameters are filtered in recent versions
- Loading branch information
Showing
33 changed files
with
1,059 additions
and
1,660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: | ||
- 3.2.1 | ||
- 3.1.3 | ||
- 3.0.5 | ||
appraisal: | ||
- rails_7_0 | ||
- rails_6_1 | ||
adapter: | ||
- sqlite3 | ||
- postgresql | ||
exclude: | ||
- { ruby: 3.2.1, appraisal: rails_6_1 } | ||
- { ruby: 3.0.5, appraisal: rails_7_0 } | ||
env: | ||
BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
id: set-up-ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
- uses: actions/cache@v3 | ||
with: | ||
path: vendor/bundle | ||
key: v1-rubygems-local-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles(format('gemfiles/{0}.gemfile.lock', matrix.appraisal)) }} | ||
- name: Install dependencies | ||
run: bundle install --jobs=3 --retry=3 | ||
- name: Run Tests | ||
run: bundle exec rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: RuboCop | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
|
||
- name: Cache gems | ||
uses: actions/cache@v3 | ||
with: | ||
path: ../vendor/bundle | ||
key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-rubocop- | ||
- name: Install gems | ||
run: | | ||
bundle config path ../vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- name: Run RuboCop | ||
run: bundle exec rubocop --parallel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.7.1 | ||
3.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby 3.2.1 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.