-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
12 changed files
with
131 additions
and
63 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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
benchmark: | ||
|
@@ -22,65 +26,50 @@ jobs: | |
bundle exec rake partial_benchmark | ||
bundle exec rake translatable_benchmark | ||
test: | ||
name: test (${{ matrix.rails_version }}, ${{ matrix.ruby_version }}, ${{ matrix.mode }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rails_version: ["6.1", "7.0", "7.1", "main"] | ||
ruby_version: ["3.1", "3.2", "3.3"] | ||
mode: ["capture_patch_enabled", "capture_patch_disabled"] | ||
include: | ||
- rails_version: "6.1.4.4" | ||
ruby_version: "3.0" | ||
mode: "capture_patch_enabled" | ||
- rails_version: "7.0.2.3" | ||
ruby_version: "3.0" | ||
mode: "capture_patch_enabled" | ||
- rails_version: "main" | ||
ruby_version: "3.1" | ||
mode: "capture_patch_enabled" | ||
- rails_version: "7.1.1" | ||
ruby_version: "3.2" | ||
mode: "capture_patch_enabled" | ||
- rails_version: "main" | ||
ruby_version: "3.2" | ||
mode: "capture_patch_enabled" | ||
- rails_version: "6.1.4.4" | ||
ruby_version: "3.0" | ||
mode: "capture_patch_disabled" | ||
- rails_version: "7.0.2.3" | ||
ruby_version: "3.0" | ||
mode: "capture_patch_disabled" | ||
- rails_version: "main" | ||
ruby_version: "3.1" | ||
mode: "capture_patch_disabled" | ||
- rails_version: "7.1.1" | ||
ruby_version: "3.2" | ||
mode: "capture_patch_disabled" | ||
- rails_version: "main" | ||
ruby_version: "3.2" | ||
mode: "capture_patch_disabled" | ||
- rails_version: "7.1.1" | ||
ruby_version: "3.3" | ||
mode: "capture_patch_disabled" | ||
- rails_version: "main" | ||
ruby_version: "3.3" | ||
mode: "capture_patch_disabled" | ||
# Run against all previously supported Rails versions for Ruby 3.0 | ||
- ruby_version: "3.0" | ||
rails_version: "6.1" | ||
capture_patch_enabled: true | ||
- ruby_version: "3.0" | ||
rails_version: "6.1" | ||
capture_patch_enabled: false | ||
- ruby_version: "3.0" | ||
rails_version: "7.0" | ||
capture_patch_enabled: true | ||
- ruby_version: "3.0" | ||
rails_version: "7.0" | ||
capture_patch_enabled: false | ||
- ruby_version: "3.0" | ||
rails_version: "7.1" | ||
capture_patch_enabled: true | ||
- ruby_version: "3.0" | ||
rails_version: "7.1" | ||
capture_patch_enabled: false | ||
env: | ||
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails_version }}.gemfile | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby_version }} | ||
- uses: actions/cache@v3 | ||
with: | ||
path: vendor/bundle | ||
key: gems-build-rails-${{ matrix.rails_version }}-ruby-${{ matrix.ruby_version }}-${{ hashFiles('**/Gemfile.lock') }} | ||
bundler-cache: true | ||
- name: Build and test with Rake | ||
# Code-reloading isn't compatible with simplecov, so we need to run once | ||
# to collect coverage, and again to test reloads. | ||
run: | | ||
bundle config path vendor/bundle | ||
bundle update | ||
# Code-reloading isn't compatible with simplecov, so we need to run once | ||
# to collect coverage, and again to test reloads. | ||
MEASURE_COVERAGE=true bundle exec rake test spec | ||
ENABLE_RELOADING=true bundle exec rake test spec | ||
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 | ||
env: | ||
RAISE_ON_WARNING: 1 | ||
RAILS_VERSION: ${{ matrix.rails_version }} | ||
|
@@ -89,7 +78,7 @@ jobs: | |
uses: actions/[email protected] | ||
if: always() | ||
with: | ||
name: simplecov-resultset-rails${{matrix.rails_version}}-ruby${{matrix.ruby_version}} | ||
name: simplecov-resultset-rails${{ matrix.rails_version }}-ruby${{ matrix.ruby_version }} | ||
path: coverage | ||
primer_view_components_compatibility: | ||
name: Test compatibility with Primer ViewComponents (main) | ||
|
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
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
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,19 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "capybara", "~> 3" | ||
gem "rails", "~> 5.2.0" | ||
gem "rspec-rails", "~> 5" | ||
|
||
group :test do | ||
gem "cuprite", "~> 0.8" | ||
gem "puma", "~> 5" | ||
gem "selenium-webdriver", "~> 4" | ||
end | ||
|
||
group :development, :test do | ||
gem "appraisal", github: "thoughtbot/appraisal" | ||
end | ||
|
||
gemspec path: "../" |
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,20 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "capybara", "~> 3" | ||
gem "rails", "~> 6.0.0" | ||
gem "rspec-rails", "~> 5" | ||
gem "tailwindcss-rails", "~> 2.0" | ||
|
||
group :test do | ||
gem "cuprite", "~> 0.8" | ||
gem "puma", "~> 5" | ||
gem "selenium-webdriver", "~> 4" | ||
end | ||
|
||
group :development, :test do | ||
gem "appraisal", github: "thoughtbot/appraisal" | ||
end | ||
|
||
gemspec path: "../" |
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
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
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