Skip to content

Adds Rails matrix testing to ensure maximum compatibility #21

Adds Rails matrix testing to ensure maximum compatibility

Adds Rails matrix testing to ensure maximum compatibility #21

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.4.5
bundler-cache: true
- name: Lint code for consistent style
run: bundle exec rubocop -f github
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ["3.0", "3.1", "3.2", "3.3"]
rails-version: ["rails-7-1", "rails-7-2", "rails-8-0"]
exclude:
# Rails 8 requires Ruby 3.1+
- ruby-version: "3.0"
rails-version: "rails-8-0"
steps:
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Generate Appraisal gemfiles
run: bundle exec appraisal install
- name: Run tests
run: bundle exec appraisal ${{ matrix.rails-version }} rspec
- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots-${{ matrix.ruby-version }}-${{ matrix.rails-version }}
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore