From 072226ff318512f2bbcf65260ebb9f9be2ec1737 Mon Sep 17 00:00:00 2001 From: Sean Doyle Date: Sat, 9 Oct 2021 14:29:17 -0400 Subject: [PATCH] Execute CI against `rails/rails` main In preparation for troubleshooting [hotwired/turbo-rails#243][], this commit expands the GitHub Actions CI matrix to account for both `rails@~>6.1` and `rails@main`. [hotwired/turbo-rails#243]: https://github.com/hotwired/turbo-rails/issues/243 --- .github/workflows/ci.yml | 8 +++++++- Gemfile | 10 ++++++++++ Gemfile.lock | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e8a6338..6316d8d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,9 @@ jobs: ruby-version: - "2.7" - "3.0" + rails-version: + - "6.1" + - "main" continue-on-error: [ false ] # Disabled until minitest relaxes its upper bound: https://github.com/seattlerb/minitest/pull/862 @@ -16,7 +19,10 @@ jobs: # - ruby-version: head # continue-on-error: true - name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }} + env: + RAILS_VERSION: "${{ matrix.rails-version }}" + + name: ${{ format('Tests (Ruby {0}, Rails {1})', matrix.ruby-version, matrix.rails-version) }} runs-on: ubuntu-latest continue-on-error: ${{ matrix.continue-on-error }} diff --git a/Gemfile b/Gemfile index 001e9325..c97fef54 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,16 @@ source 'https://rubygems.org' gemspec +rails_version = ENV.fetch("RAILS_VERSION", "6.1") + +if rails_version == "main" + rails_constraint = { github: "rails/rails" } +else + rails_constraint = "~> #{rails_version}.0" +end + +gem "rails", rails_constraint + gem 'rake' gem 'byebug' gem 'puma' diff --git a/Gemfile.lock b/Gemfile.lock index ce29ab51..d7447993 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,6 +172,7 @@ DEPENDENCIES capybara importmap-rails puma + rails (~> 6.1.0) rake rexml selenium-webdriver