$ show ruby/setup-ruby
This repository is a GitHub Action (`ruby/setup-ruby`) that automates the setup of Ruby interpreters (CRuby, JRuby, TruffleRuby) in CI workflows. It downloads prebuilt binaries from official builders (ruby-builder, RubyInstaller2), adds them to PATH, and optionally configures RubyGems and Bundler with intelligent version resolution. A key feature is built-in caching of `bundle install` results via a sophisticated key scheme that accounts for OS, Ruby version, Bundler configuration, and gemfile lock hash. The action supports reading Ruby version from `.ruby-version`, `.tool-versions`, or `mise.toml`, and handles Windows toolchains (MSYS2, DevKit, VCPKG/MSVC) for native gem compilation. The architecture is modular (common utilities, Ruby builder, Bundler, RubyGems, Windows-specific code) and the code is well-structured with clear error handling and thorough CI testing across a matrix of 100+ combinations of OS, Ruby versions, and architectures. Maintenance is active with automated version updates via scheduled workflows and a defined release team.
The LLM identified 1 files worth highlighting for reuse:
A Ruby script that generates an exhaustive test matrix of (OS, Ruby) combinations for the CI workflow. It reads version lists from JSON files, applies platform-specific exclusions (e.g., old Rubies on arm64, TruffleRuby on Windows, ASan on specific Ubuntu), and outputs a JSON array. This script is self-contained, depends only on Ruby stdlib, and demonstrates thoughtful handling of version compatibility boundaries. It could be adapted for any CI generator that needs to produce a comprehensive, platform-aware test matrix from version manifests.