Skip to content

Commit

Permalink
Use Appraisal in CI
Browse files Browse the repository at this point in the history
Appraisal allows us to test with different versions of gems. In addition to GitHub Actions' matrix functionality, we can use this to test against different combinations of Ruby and Rails versions.

As part of this, we've also made the following changes to our CI pipeline:

Rename Appraisal rails-head to rails-main

Loosen version constraints to minor versions

Use setup-ruby's caching mechanism

  Means we don't need to configure vendor/bundle as the path here. We should probably do this for other workflows too.

Don't trigger CI twice on PRs

Co-authored-by: Simon Fish <[email protected]>
  • Loading branch information
Spone and boardfish committed Jan 4, 2024
1 parent 4fad575 commit beb9857
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ jobs:
# Run against all previously supported Rails versions for Ruby 3.0
- ruby_version: "3.0"
rails_version: "6.1"
capture_patch_enabled: true
mode: "capture_patch_enabled"
- ruby_version: "3.0"
rails_version: "6.1"
capture_patch_enabled: false
mode: "capture_patch_disabled"
- ruby_version: "3.0"
rails_version: "7.0"
capture_patch_enabled: true
mode: "capture_patch_enabled"
- ruby_version: "3.0"
rails_version: "7.0"
capture_patch_enabled: false
mode: "capture_patch_disabled"
- ruby_version: "3.0"
rails_version: "7.1"
capture_patch_enabled: true
mode: "capture_patch_enabled"
- ruby_version: "3.0"
rails_version: "7.1"
capture_patch_enabled: false
mode: "capture_patch_disabled"
env:
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails_version }}.gemfile
steps:
Expand All @@ -69,7 +69,7 @@ jobs:
run: |
bundle exec appraisal rails-${{ matrix.rails_version }} bundle
MEASURE_COVERAGE=true bundle exec appraisal rails-${{ matrix.rails_version }} rake
ENABLE_RELOADING=true bundle exec appraisal rails-${{ matrix.rails_version }} rake
ENABLE_RELOADING=true bundle exec appraisal rails-${{ matrix.rails_version }} rake
env:
RAISE_ON_WARNING: 1
RAILS_VERSION: ${{ matrix.rails_version }}
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ group :test do
end

group :development, :test do
gem "appraisal", github: "thoughtbot/appraisal"
gem "appraisal", "~> 2.5"
end

gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ group :test do
end

group :development, :test do
gem "appraisal", github: "thoughtbot/appraisal"
gem "appraisal", "~> 2.5"
end

gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ group :test do
end

group :development, :test do
gem "appraisal", github: "thoughtbot/appraisal"
gem "appraisal", "~> 2.5"
end

gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/rails_main.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ group :test do
end

group :development, :test do
gem "appraisal", github: "thoughtbot/appraisal"
gem "appraisal", "~> 2.5"
end

gemspec path: "../"

0 comments on commit beb9857

Please sign in to comment.