Skip to content

Refactor/simplify test matrix #144

Refactor/simplify test matrix

Refactor/simplify test matrix #144

Workflow file for this run

---
name: build
on:
push:
branches:
- main
- renovate/**
pull_request:
branches:
- main
workflow_call:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Latest ruby will only be tested on
# - all rails versions in current major
# - latest rails version in the previous major
#
# Any unsupported ruby will only be tested on
# - rails versions in each branch if their last release is within 6 months of the Ruby EOL date
# - Excluding any version of the current rails major
#
# 2.6 -> EOL Mar '22 -> Only test Rails versions released after Sep '22
# 2.7 -> EOL Mar '23 -> Only test Rails versions released after Sep '23
# 3.0 -> EOL Mar '24 -> Only test Rails versions released after Sep '24
include:
- { ruby: '2.6', gemfile: 'rails_5_2' }
- { ruby: '2.7', gemfile: 'rails_6_0' }
- { ruby: '2.7', gemfile: 'rails_6_1' }
# Capybara has an incompatibility here with rails 6. It's easier to just exclude this one run from the matrix until it's out of support
# As such ruby 3.0 is only tested on rails 7.0 as an EXCEPTION to the above rules
- { ruby: '3.0', gemfile: 'rails_7_0' }
# Ruby 3.1+ appears to have issues with Rails 6.1 https://github.com/rails/rails/issues/46883#issuecomment-1371325906
# It (Rails 6.1.x), has been marked as a won't fix and as such it's likely this will need to just be excluded until out of support window
- { ruby: '3.3', gemfile: 'rails_7_0' }
- { ruby: '3.3', gemfile: 'rails_7_1' }
- { ruby: '3.3', gemfile: 'rails_7_2' }
# Supported rubies will test all permissible supported rails versions
ruby: ['3.1', '3.2']
gemfile: ['rails_5_2', 'rails_6_0', 'rails_6_1', 'rails_7_0', 'rails_7_1', 'rails_7_2']
exclude:
# Ruby 3.0+ won't work with Rails 5.2: https://github.com/rails/rails/issues/40938
# Ruby 3.1+ has a conflicting Psych version with Rails 6.x: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias
- { ruby: '3.1', gemfile: 'rails_5_2' }
- { ruby: '3.1', gemfile: 'rails_6_0' }
- { ruby: '3.1', gemfile: 'rails_6_1' }
- { ruby: '3.2', gemfile: 'rails_5_2' }
- { ruby: '3.2', gemfile: 'rails_6_0' }
- { ruby: '3.2', gemfile: 'rails_6_1' }
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: '2.4.19'
rubygems: latest
bundler-cache: true
- run: bundle exec rake spec
- run: bundle exec rubocop
- run: bundle exec rake cucumber