Skip to content

Commit

Permalink
👷 Setup Appraisal
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Apr 24, 2024
1 parent 9b4524a commit a441d1c
Show file tree
Hide file tree
Showing 18 changed files with 356 additions and 120 deletions.
157 changes: 139 additions & 18 deletions .github/workflows/legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,144 @@ concurrency:

jobs:
test:
name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
name: Ruby ${{ matrix.ruby }} and ${{ matrix.appraisal }} ${{ matrix.name_extra || '' }}
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
strategy:
fail-fast: false
matrix:
experimental: [false]
rubygems:
- "2.7.11"
bundler:
- none
gemfile:
- vanilla
ruby:
- "3.0"
- "2.7"
- "2.6"
- "2.5"
- "2.4"
- "2.3"
include:
- ruby: "3.0"
appraisal: "rails-7-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "3.0"
appraisal: "rails-7-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "3.0"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "3.0"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.7"
appraisal: "rails-7-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.7"
appraisal: "rails-7-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.7"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.7"
appraisal: "rails-6-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.7"
appraisal: "rails-5-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.6"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.6"
appraisal: "rails-6-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.6"
appraisal: "rails-5-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.5"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.5"
appraisal: "rails-6-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.5"
appraisal: "rails-5-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.5"
appraisal: "rails-5-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.4"
appraisal: "rails-5-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.4"
appraisal: "rails-5-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.4"
appraisal: "rails-5-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.4"
appraisal: "rails-4-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.3"
appraisal: "rails-5-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.3"
appraisal: "rails-5-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.3"
appraisal: "rails-5-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.3"
appraisal: "rails-4-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.3"
appraisal: "rails-4-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
- ruby: "2.3"
appraisal: "rails-4-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
steps:
Expand All @@ -54,6 +171,10 @@ jobs:
ruby-version: ${{ matrix.ruby }}
rubygems: ${{ matrix.rubygems }}
bundler: ${{ matrix.bundler }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test
bundler-cache: false
- name: Bundle for Appraisal ${{ matrix.appraisal }}
run: bundle
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Run tests ${{ matrix.appraisal }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec rake test
60 changes: 43 additions & 17 deletions .github/workflows/supported.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,56 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rubygems:
- latest
bundler:
- latest
gemfile:
- vanilla
ruby:
include:
- ruby: "3.3"
appraisal: "rails-7-1"
rubygems: latest
bundler: latest
gemfile: vanilla
- ruby: "3.3"
appraisal: "rails-7-0"
rubygems: latest
bundler: latest
gemfile: vanilla
- ruby: "3.2"
appraisal: "rails-7-1"
rubygems: latest
bundler: latest
gemfile: vanilla
- ruby: "3.2"
appraisal: "rails-7-0"
rubygems: latest
bundler: latest
gemfile: vanilla
#- '3.1' - 3.1 tests are run by coverage.yml
- '3.2'
- '3.3'
- truffleruby
- jruby

- ruby: "truffleruby"
appraisal: "rails-7-1"
rubygems: latest
bundler: latest
gemfile: vanilla
- ruby: "jruby"
appraisal: "rails-7-1"
rubygems: latest
bundler: latest
gemfile: vanilla
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/cache@v4
id: cache
with:
path: path/to/dependencies
key: ${{ runner.os }}-${{matrix.ruby}}-${{matrix.appraisal}}-${{ hashFiles('gemfiles/*.gemfile.lock') }}
- name: Setup Ruby & Bundle
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler: "${{ matrix.bundler }}"
bundler-cache: true

- name: Run tests
run: bundle exec rake test
bundler-cache: false
- name: Bundle for Appraisal ${{ matrix.appraisal }}
run: bundle
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Run tests ${{ matrix.appraisal }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec rake test
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.2.3
ruby 2.7.8
105 changes: 89 additions & 16 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,29 +1,102 @@
# frozen_string_literal: true

# NOTE(2024-04-24): Current release of rake v13 supports Ruby >= 2.3
# NOTE(2024-04-24): Current release of json v2 supports Ruby >= 2.3

# Compat: Ruby >= 1.9.3
# Test Matrix:
# - Ruby 2.3
appraise "rails-4-0" do
gem "actionmailer", "~> 4.0.13"
gem "railties", "~> 4.0.13"
end

# Compat: Ruby >= 1.9.3
# Test Matrix:
# - Ruby 2.3
appraise "rails-4-1" do
gem "actionmailer", "~> 4.1.16"
gem "railties", "~> 4.1.16"
end

# Compat: Ruby >= 1.9.3
# Test Matrix:
# - Ruby 2.3
# - Ruby 2.4
appraise "rails-4-2" do
gem "actionmailer", "~> 4.2.0"
gem "railties", "~> 4.2.0"
gem "json", "~> 2.0"
gem "rake", "~> 11.0"
gem "actionmailer", "~> 4.2.11.3"
gem "railties", "~> 4.2.11.3"
end

# Compat: Ruby >= 2.2.2
# Test Matrix:
# - Ruby 2.3
# - Ruby 2.4
appraise "rails-5-0" do
gem "actionmailer", "~> 5.0.0"
gem "railties", "~> 5.0.0"
gem "json", "~> 2.0"
gem "rake", "~> 12.0"
gem "actionmailer", "~> 5.0.7.2"
gem "railties", "~> 5.0.7.2"
end

# Compat: Ruby >= 2.2.2
# Test Matrix:
# - Ruby 2.3
# - Ruby 2.4
# - Ruby 2.5
appraise "rails-5-1" do
gem "actionmailer", "~> 5.1.0"
gem "railties", "~> 5.1.0"
gem "json", "~> 2.0"
gem "rake", "~> 12.0"
gem "actionmailer", "~> 5.1.7"
gem "railties", "~> 5.1.7"
end

# Compat: Ruby >= 2.2.2
# Test Matrix:
# - Ruby 2.3
# - Ruby 2.4
# - Ruby 2.5
# - Ruby 2.6
# - Ruby 2.7
appraise "rails-5-2" do
gem "actionmailer", "~> 5.2.0"
gem "railties", "~> 5.2.0"
gem "json", "~> 2.0"
gem "rake", "~> 12.0"
gem "actionmailer", "~> 5.2.8.1"
gem "railties", "~> 5.2.8.1"
end

# Compat: Ruby >= 2.5
# Test Matrix:
# - Ruby 2.5
# - Ruby 2.6
# - Ruby 2.7
appraise "rails-6-0" do
gem "actionmailer", "~> 6.0.6.1"
gem "railties", "~> 6.0.6.1"
end

# Compat: Ruby >= 2.5
# Test Matrix:
# - Ruby 2.5
# - Ruby 2.6
# - Ruby 2.7
# - Ruby 3.0
appraise "rails-6-1" do
gem "actionmailer", "~> 6.1.7.7"
gem "railties", "~> 6.1.7.7"
end

# Compat: Ruby >= 2.7
# Test Matrix:
# - Ruby 2.7
# - Ruby 3.0
# - Ruby 3.1
appraise "rails-7-0" do
gem "actionmailer", "~> 7.0.8.1"
gem "railties", "~> 7.0.8.1"
end

# Compat: Ruby >= 2.7
# Test Matrix:
# - Ruby 2.7
# - Ruby 3.0
# - Ruby 3.1
# - Ruby 3.2
appraise "rails-7-1" do
gem "actionmailer", "~> 7.1.3.2"
gem "railties", "~> 7.1.3.2"
end
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
# Specify your gem's dependencies in sanitize_email.gemspec
gemspec

# Appraisals is having a *rough* time upgrading to Ruby 3, and worse upgrading past bundler v2.3.
# Changes in Bundler 2.4 and/or 2.5 are causing many issues, and that's why we use git,
# as some of the issues are fixed there.
# See - https://github.com/thoughtbot/appraisal/issues/214
# See - https://github.com/thoughtbot/appraisal/issues/218
gem "appraisal", "~> 2", github: "thoughtbot/appraisal"

platform :mri do
# Debugging
gem "byebug", ">= 11"
Expand Down
Loading

0 comments on commit a441d1c

Please sign in to comment.