Если нужно тестировать под несколько версий rails сразу, учтите, что rails 8 требует ruby 3.2+.
Можно сделать так:
name: CI
on:
- push
- pull_request
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
gemfile:
- Gemfile
- gemfiles/Gemfile-rails-6-1
- gemfiles/Gemfile-rails-7-1
- gemfiles/Gemfile-rails-7-2
ruby:
- '3.0'
- 3.1
- 3.2
- 3.3
exclude:
- gemfile: gemfiles/Gemfile-rails-7-2
ruby: '3.0'
- gemfile: Gemfile
ruby: 3.1
- gemfile: Gemfile
ruby: '3.0'
- gemfile: Gemfile
ruby: 3.1
runs-on: ${{ matrix.os }}
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
Пример такого проекта тут https://github.com/bodrovis/lokalise_rails/blob/master/.github/workflows/ci.yml