From b1a8cd24a21bd19d6f0a9dc6a547372c074a4f2a Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Wed, 14 Jan 2026 14:02:07 -0700 Subject: [PATCH 1/2] Cache dependencies using ruby/setup-ruby To speed our CI a bit, let's cache the dependencies. I am using the recommended cache strategy for Ruby: https://github.com/actions/cache/blob/main/examples.md#ruby---bundler Additionally, to use the `--without` configuration, we need to explicitely set the configuration keys through the environment: https://bundler.io/man/bundle-config.1.html#CONFIGURATION-KEYS --- .github/workflows/bench.yml | 5 ++--- .github/workflows/ruby.yml | 16 +++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 2d1d66e3f3..70d9ce677d 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -18,9 +18,8 @@ jobs: - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.4' - - name: Install dependencies - run: bundle install + ruby-version: '4.0' + bundler-cache: true - name: Generators run: RUBYOPT="-W0" bundle exec ruby benchmark/generators.rb diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index c54a857b34..3277cca5c9 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -21,20 +21,22 @@ jobs: lint: name: RuboCop runs-on: ubuntu-latest + env: + BUNDLE_WITHOUT: benchmark steps: - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.4' - - - name: Install dependencies - run: bundle install + ruby-version: '4.0' + bundler-cache: true - name: Run RuboCop run: bundle exec rake rubocop test: name: Ruby ${{ matrix.ruby }} runs-on: ubuntu-latest + env: + BUNDLE_WITHOUT: benchmark strategy: fail-fast: false # don't fail all matrix builds if one fails matrix: @@ -52,11 +54,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - - name: Install dependencies - run: | - bundle config --without benchmark - bundle install + bundler-cache: true - name: Run tests run: bundle exec rake test From adb6cc5bf5ff75ba634ac3c2a099181b490e1241 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Wed, 14 Jan 2026 14:02:55 -0700 Subject: [PATCH 2/2] Bump 'rdoc' version and handle 'erb' while Ruby 3.1 is still supported After changing CI to use ruby/setup-ruby cache, CI fails for Ruby 3.1 because 'erbv 6.0' is not compatible with that ruby version. Although RUby 3.1 is EOL, we will support it until Ruby 3.2 becomes EOL. --- Gemfile | 3 +++ Gemfile.lock | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index ea1f62b89f..735747a2ea 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,9 @@ gem 'test-unit', '3.7.7' gem 'timecop', '0.9.10' gem 'yard', '0.9.38' +# TODO: remove when Ruby 3.1 is no longer supported +gem 'erb', '~> 4.0.4' + group :benchmark do gem 'benchmark' gem 'benchmark-ips' diff --git a/Gemfile.lock b/Gemfile.lock index d55bb44515..b592455ba1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,11 +10,13 @@ GEM ast (2.4.3) benchmark (0.5.0) benchmark-ips (2.14.0) + cgi (0.5.1) coderay (1.1.3) concurrent-ruby (1.3.6) date (3.5.1) docile (1.4.1) - erb (6.0.1) + erb (4.0.4) + cgi (>= 0.3.3) i18n (1.14.8) concurrent-ruby (~> 1.0) io-console (0.8.2) @@ -46,7 +48,7 @@ GEM racc (1.8.1) rainbow (3.1.1) rake (13.3.1) - rdoc (7.0.3) + rdoc (7.1.0) erb psych (>= 4.0.0) tsort @@ -92,12 +94,13 @@ GEM yard (0.9.38) PLATFORMS - arm64-darwin-22 + arm64-darwin x86_64-linux DEPENDENCIES benchmark benchmark-ips + erb (~> 4.0.4) faker! irb minitest (= 5.27.0)