Skip to content

Commit

Permalink
Appraisal & Combustion; Rails 3, 6, & 7 Compat fixes (#105)
Browse files Browse the repository at this point in the history
* πŸ§‘β€πŸ’» Default to No DEBUG=true

* πŸ‘· Setup Appraisal

* πŸ‘· Attempt to use custom RuboCop version

* πŸ‘· Unspecify rubygems version for old Ruby + Rails combos

* πŸ‘· Remove rubygems version for old Ruby + Rails combos

* πŸ‘· Specify old bundler version for old Ruby + Rails combos

* πŸ‘· Experimental true for finicky bundler/rubygems combos

* 🚨 Lint lock

* πŸ‘· RAILS_VERSION

* πŸ‘· RAILS_MAJOR_MINOR

* πŸ‘· Ancient Rails Support

* πŸ‘· Fix names

* πŸ’š Fix test

* πŸ’š Fix test

* πŸ’š Fix tests

* πŸ’š Fix env variables

* πŸ’š Fix env variables

* πŸ’š Fix rdoc version

* πŸ’š Allow JSON Version for Rails 4 support

* πŸ’š consolidate on matrix.rails

* ✨ Combustion Test Rails App

* ✨ Combustion Testing

* πŸ‘· Combustion Testing

* πŸ’š Fix dependency version pins

* πŸ’š Fix code coverage

* πŸ”¨ Regenerate Appraisals

* βž– Min branch cov = 72%

* πŸ”§ Fix path to gemspec

* βž– rspec-rails

* βž– actionpack

* βœ… Add back Rails 3.0-, 3.1, 3.2

* πŸ“Œ rake v10 for ancient Appraisals

* πŸ“Œ tzinfo v1 for ancient Rails

* πŸ“Œ delivery_method :test for Rails 3

* πŸ“Œ undefined method `unparsed_value' for #<Mail::OptionalField> on Rails 3

* πŸ“Œ branch coverage @ 71%

* πŸ“Œ undefined method `unparsed_value' for #<Mail::OptionalField> on Rails 3

* πŸ’š Fix test on Rails 3

* πŸ’š Fix typo

* 🚨 Lint lock

* πŸ‘· Turn off experimental CI flags

* πŸ‘· prefer block_is_expected

* πŸ”₯ Remove bogus comment

* πŸ”₯ Remove bogus comments

* πŸ“ Improve documentation

* 🚨 Disable RSpec/ExampleLength

* πŸ“ Documentation

* πŸ”§ 89% coverage

* πŸ”– Prepare release v2.0.6

* 🚨 Lint lock

* πŸ“ Improved documentation
  • Loading branch information
pboling authored Apr 25, 2024
1 parent 756e786 commit a9c1d9a
Show file tree
Hide file tree
Showing 53 changed files with 1,037 additions and 531 deletions.
6 changes: 4 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
### External Testing Controls
export K_SOUP_COV_DO=true # Means you want code coverage
export K_SOUP_COV_MIN_BRANCH=71 # Means you want to enforce X% branch coverage
export K_SOUP_COV_MIN_LINE=90 # Means you want to enforce X% line coverage
export K_SOUP_COV_MIN_LINE=89 # Means you want to enforce X% line coverage
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
# Available formats are html, xml, rcov, lcov, json, tty
export K_SOUP_COV_MULTI_FORMATTERS="html,tty" # What coverage output formats do you want?
export MAX_ROWS=5 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage
export DEBUG=true # allow byebug statements
# export DEBUG=true # allow byebug statements
export RAILS_VERSION="~> 7.1"
export RAILS_MAJOR_MINOR=7.1
82 changes: 82 additions & 0 deletions .github/workflows/ancient.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Rails 3 - 4.1 on EOL Ruby 2.3

on:
push:
branches:
- 'main'
- '*-stable'
- '*-dev'
tags:
- '!*' # Do not execute on tags
pull_request:
branches:
- '*'
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
test:
name: Specs - Ruby ${{ matrix.ruby }} & Rails ${{ matrix.rails }} ${{ 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
# rspec-rails uses RAILS_VERSION internally
RAILS_VERSION: "~> ${{ matrix.rails }}"
# Our spec suite (not runtime code) uses RAILS_MAJOR_MINOR internally
RAILS_MAJOR_MINOR: ${{ matrix.rails }}
strategy:
fail-fast: false
matrix:
include:
- ruby: "2.3"
appraisal: "rails-4-1"
bundler: '1.17.3'
gemfile: vanilla
rails: "4.1"
- ruby: "2.3"
appraisal: "rails-4-0"
bundler: '1.17.3'
gemfile: vanilla
rails: "4.0"
- ruby: "2.3"
appraisal: "rails-3-2"
bundler: '1.17.3'
gemfile: vanilla
rails: "3.2"
- ruby: "2.3"
appraisal: "rails-3-1"
bundler: '1.17.3'
gemfile: vanilla
rails: "3.1"
- ruby: "2.3"
appraisal: "rails-3-0"
bundler: '1.17.3'
gemfile: vanilla
rails: "3.0"
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby & RubyGems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: ${{ matrix.rubygems }}
bundler: ${{ matrix.bundler }}
bundler-cache: false
# This will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. vanilla)
# We need to do this first to get appraisal installed.
# NOTE: This does not use the root Gemfile at all.
- name: Bundle for Appraisal ${{ matrix.appraisal }} (Rails v${{ matrix.rails}})
run: bundle _1.17.3_ install
- name: Install Appraisal ${{ matrix.appraisal }} (Rails v${{ matrix.rails}}) dependencies
run: bundle _1.17.3_ exec appraisal ${{ matrix.appraisal }} bundle _1.17.3_ install
- name: Run tests ${{ matrix.appraisal }} (Rails v${{ matrix.rails}})
run: bundle _1.17.3_ exec appraisal ${{ matrix.appraisal }} bundle _1.17.3_ exec rake test
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Ruby - Coverage

env:
K_SOUP_COV_MIN_BRANCH: 73
K_SOUP_COV_MIN_LINE: 90
K_SOUP_COV_MIN_BRANCH: 71
K_SOUP_COV_MIN_LINE: 89
K_SOUP_COV_MIN_HARD: true

on:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby & Bundle
- name: Setup Ruby & RubyGems
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/heads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby & Bundle
- name: Setup Ruby & RubyGems
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
Expand Down
136 changes: 115 additions & 21 deletions .github/workflows/legacy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Legacy Ruby Support
name: Rails 4.2, 5, 6, 7 on EOL Ruby 2.5 - 3.0

on:
push:
Expand All @@ -17,43 +17,137 @@ on:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
test:
name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
name: Specs - Ruby ${{ matrix.ruby }} & Rails ${{ matrix.rails }} ${{ 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
# rspec-rails uses RAILS_VERSION internally
RAILS_VERSION: "~> ${{ matrix.rails }}"
# Our spec suite (not runtime code) uses RAILS_MAJOR_MINOR internally
RAILS_MAJOR_MINOR: ${{ matrix.rails }}
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
rails: "7.1"
- ruby: "3.0"
appraisal: "rails-7-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "7.0"
- ruby: "3.0"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "6.1"
- ruby: "2.7"
appraisal: "rails-7-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "7.1"
- ruby: "2.7"
appraisal: "rails-7-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "7.0"
- ruby: "2.7"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "6.1"
- ruby: "2.7"
appraisal: "rails-6-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "6.0"
- ruby: "2.7"
appraisal: "rails-5-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "5.2"
- ruby: "2.6"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "6.1"
- ruby: "2.6"
appraisal: "rails-6-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "6.0"
- ruby: "2.6"
appraisal: "rails-5-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "5.2"
- ruby: "2.5"
appraisal: "rails-6-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "6.1"
- ruby: "2.5"
appraisal: "rails-6-0"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "6.0"
- ruby: "2.5"
appraisal: "rails-5-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "5.2"
- ruby: "2.5"
appraisal: "rails-5-1"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "5.1"
- ruby: "2.5"
appraisal: "rails-4-2"
rubygems: "3.3.27"
bundler: none
gemfile: vanilla
rails: "4.2"
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby & Bundle
- name: Setup Ruby & RubyGems
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
# This will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. vanilla)
# We need to do this first to get appraisal installed.
# NOTE: This does not use the root Gemfile at all.
- name: Bundle for Appraisal ${{ matrix.appraisal }} (Rails v${{ matrix.rails}})
run: bundle
- name: Install Appraisal ${{ matrix.appraisal }} (Rails v${{ matrix.rails}}) dependencies
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Run tests ${{ matrix.appraisal }} (Rails v${{ matrix.rails}})
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec rake test
3 changes: 1 addition & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
strategy:
fail-fast: false
matrix:
experimental: [true]
rubygems:
- latest
bundler:
Expand All @@ -38,7 +37,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby & Bundle
- name: Setup Ruby & RubyGems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
Loading

0 comments on commit a9c1d9a

Please sign in to comment.