setup-ruby-flash automatically falls back to ruby/setup-ruby for Ruby versions and implementations that are not supported by rv and ore. This enables true drop-in replacement behavior where you can use setup-ruby-flash everywhere and get the best performance where available, with full compatibility as a fallback.
These configurations use the optimized rv and ore tools:
- Ruby 3.2 (MRI)
- Ruby 3.3 (MRI)
- Ruby 3.4 (MRI)
- Ruby 4.0 (MRI)
- Platforms: Linux (x86_64, ARM64), macOS (x86_64, ARM64)
These configurations automatically fall back to ruby/setup-ruby:
- Ruby versions other than 3.2, 3.3, 3.4, 4.0: Includes 2.7, 3.0, 3.1, 3.5+, head, etc.
- Non-MRI implementations: JRuby, TruffleRuby, mruby, Rubinius, etc.
- Windows: All Ruby versions on Windows
- Unsupported architectures: i686, ppc64le, etc.
The action uses a allowlist approach - only explicitly supported versions use the fast path:
1. Parse ruby-version input (including reading from version files)
2. Check if it's a non-MRI implementation (jruby, truffleruby, etc.)
3. Check if version matches 3.2, 3.3, 3.4, or 4.0 (with or without patch versions)
4. If not allowlisted: use ruby/setup-ruby
5. If allowlisted: proceed with rv + oreThis means any version not explicitly in the allowlist (like head, 3.5, 2.7) will use fallback.
When fallback occurs, you'll see an informative notice in the workflow logs:
::notice::Ruby version '3.1' is not supported by setup-ruby-flash (requires 3.2+). Falling back to ruby/setup-ruby.
or
::notice::Ruby implementation 'jruby-9.4' is not supported by setup-ruby-flash. Falling back to ruby/setup-ruby.
All subsequent steps in the workflow continue normally - the fallback is transparent.
Test your gem across all supported Ruby versions automatically:
name: CI
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Ruby
uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
# Ruby 2.7, 3.0, 3.1: automatic fallback to ruby/setup-ruby
# Ruby 3.2, 3.3, 3.4, 4.0: fast path with rv + ore
- name: Run tests
run: bundle exec rake testTest on JRuby, TruffleRuby, or other implementations:
jobs:
test:
strategy:
matrix:
ruby:
- '3.4' # Fast path
- 'jruby-9.4' # Automatic fallback
- 'truffleruby-24' # Automatic fallback
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake testTest across platforms, including Windows:
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ruby: ['3.2', '3.3', '3.4']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
# Linux & macOS: fast path
# Windows: automatic fallback (platform detection happens first)
- run: bundle exec rake testGradually migrate from older Ruby versions:
jobs:
test:
strategy:
matrix:
ruby: ['3.1', '3.2', '3.3'] # Mix old and new
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
# Ruby 3.1: fallback
# Ruby 3.2, 3.3: fast path
- run: bundle exec rake testAll inputs are passed through to ruby/setup-ruby when fallback occurs:
| Input | Supported in Fallback |
|---|---|
ruby-version |
✅ Yes |
rubygems |
✅ Yes |
bundler |
✅ Yes |
working-directory |
✅ Yes |
cache-version |
✅ Yes |
bundler-cache |
✅ Yes (passed through) |
ore-install |
✅ Converted to bundler-cache: true |
rv-version |
|
rv-git-ref |
|
ore-version |
|
ore-git-ref |
|
gfgo-git-ref |
|
skip-extensions |
|
without-groups |
|
ruby-install-retries |
|
no-document |
|
token |
✅ Yes |
Simply replace the action name - no other changes needed:
Before:
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: trueAfter:
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.3'
bundler-cache: true # or ore-install: true for even faster installsNo changes needed - just replace the action:
Before:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: trueAfter:
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # or ore-install: true- First run: ~5-10 seconds
- Cached run: ~1-2 seconds
- With ore-install: gem installation ~50% faster
- First run: ~30-60 seconds (compilation)
- Cached run: ~5-10 seconds
- Gem installation: standard Bundler speed
For projects that need to support both old and new Ruby versions:
- Use setup-ruby-flash everywhere
- Get automatic performance benefits on Ruby 3.2+
- Get automatic compatibility on older versions
- No conditional logic needed in your workflows
Check the workflow logs for the notice message:
::notice::Ruby version '3.1' is not supported by setup-ruby-flash (requires 3.2+). Falling back to ruby/setup-ruby.
Yes, just specify an unsupported Ruby version:
- uses: appraisal-rb/setup-ruby-flash@v1
with:
ruby-version: '3.1' # Will use fallbackNo - fallback is automatic and cannot be disabled. If you only want to support Ruby 3.2+, specify that in your matrix configuration:
matrix:
ruby: ['3.2', '3.3', '3.4'] # No fallback neededoWhen fallback occurs, both ore-install and bundler-cache are converted to bundler-cache: true and passed to ruby/setup-ruby. This ensures compatibility.
They're aliases - both enable gem caching and installation:
- Fast path (Ruby 3.2+): Both use ore for gem installation
- Fallback path: Both convert to
bundler-cache: truefor ruby/setup-ruby - Use whichever name you prefer for clarity in your workflows
The action uses a simple dual-allowlist approach supporting both numeric and special versions:
# Allowlists of supported Ruby versions (update these as rv adds support)
# Numeric MRI versions (major.minor format)
SUPPORTED_NUMERIC_VERSIONS="3.2 3.3 3.4 4.0"
# Special versions and alternative implementations
SUPPORTED_SPECIAL_VERSIONS="" # e.g., "head jruby truffleruby" when rv supports them
# Default to fallback unless version is in allowlist
USE_FALLBACK="true"
# First check special versions (head, jruby-*, truffleruby-*, etc.)
if [ -n "$SUPPORTED_SPECIAL_VERSIONS" ]; then
for allowed_version in $SUPPORTED_SPECIAL_VERSIONS; do
if [[ "$RUBY_VERSION" == $allowed_version* ]]; then
USE_FALLBACK="false"
break
fi
done
fi
# If not found, check numeric versions
if [ "$USE_FALLBACK" = "true" ]; then
VERSION_PREFIX=$(echo "$RUBY_VERSION" | grep -oE '^[0-9]+\.[0-9]+')
if [ -n "$VERSION_PREFIX" ]; then
for allowed_version in $SUPPORTED_NUMERIC_VERSIONS; do
if [ "$VERSION_PREFIX" = "$allowed_version" ]; then
USE_FALLBACK="false"
break
fi
done
fi
fiAdding support for new versions is trivial:
- Numeric versions (e.g., Ruby 4.1): Add to
SUPPORTED_NUMERIC_VERSIONS="3.2 3.3 3.4 4.0 4.1" - Special versions (e.g., head, jruby): Add to
SUPPORTED_SPECIAL_VERSIONS="head jruby truffleruby"
All rv/ore-specific steps are conditional on use-fallback != 'true':
- name: Install Ruby
if: steps.check-support.outputs.use-fallback != 'true'
# ... rv installation logicWhen fallback is needed, ruby/setup-ruby is invoked:
- name: Setup Ruby with ruby/setup-ruby (fallback)
if: steps.check-support.outputs.use-fallback == 'true'
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
# ... other inputs- Simplified Workflows: One action for all Ruby versions
- Best Performance: Automatic optimization where available
- Full Compatibility: Works with any Ruby version/implementation
- No Breaking Changes: Drop-in replacement for ruby/setup-ruby
- Future Proof: As rv/ore add support for more versions, you automatically get the benefits
- Fallback uses compilation (slower first run) for older Ruby versions
- ore-install feature not available when using fallback
- Some advanced setup-ruby-flash features unavailable in fallback mode
- Main README - General usage and features
- GIT_REF_FEATURE.md - Building from source
- ruby/setup-ruby - The fallback action