Skip to content

Commit 22e8d22

Browse files
Bump 'rdoc' dependency, handle 'erb' version constraint with Ruby 3.1 and improve CI bundle cache (#3185)
* 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 * 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.
1 parent 7cc1158 commit 22e8d22

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

.github/workflows/bench.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ jobs:
1919
- uses: actions/checkout@v6
2020
- uses: ruby/setup-ruby@v1
2121
with:
22-
ruby-version: '3.4'
23-
- name: Install dependencies
24-
run: bundle install
22+
ruby-version: '4.0'
23+
bundler-cache: true
2524

2625
- name: Generators
2726
run: RUBYOPT="-W0" bundle exec ruby benchmark/generators.rb

.github/workflows/ruby.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,22 @@ jobs:
2222
lint:
2323
name: RuboCop
2424
runs-on: ubuntu-latest
25+
env:
26+
BUNDLE_WITHOUT: benchmark
2527
steps:
2628
- uses: actions/checkout@v6
2729
- uses: ruby/setup-ruby@v1
2830
with:
29-
ruby-version: '3.4'
30-
31-
- name: Install dependencies
32-
run: bundle install
31+
ruby-version: '4.0'
32+
bundler-cache: true
3333

3434
- name: Run RuboCop
3535
run: bundle exec rake rubocop
3636
test:
3737
name: Ruby ${{ matrix.ruby }}
3838
runs-on: ubuntu-latest
39+
env:
40+
BUNDLE_WITHOUT: benchmark
3941
strategy:
4042
fail-fast: false # don't fail all matrix builds if one fails
4143
matrix:
@@ -53,11 +55,7 @@ jobs:
5355
- uses: ruby/setup-ruby@v1
5456
with:
5557
ruby-version: ${{ matrix.ruby }}
56-
57-
- name: Install dependencies
58-
run: |
59-
bundle config --without benchmark
60-
bundle install
58+
bundler-cache: true
6159

6260
- name: Run tests
6361
run: bundle exec rake test

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ gem 'test-unit', '3.7.7'
1818
gem 'timecop', '0.9.10'
1919
gem 'yard', '0.9.38'
2020

21+
# TODO: remove when Ruby 3.1 is no longer supported
22+
gem 'erb', '~> 4.0.4'
23+
2124
group :benchmark do
2225
gem 'benchmark'
2326
gem 'benchmark-ips'

Gemfile.lock

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ GEM
1010
ast (2.4.3)
1111
benchmark (0.5.0)
1212
benchmark-ips (2.14.0)
13+
cgi (0.5.1)
1314
coderay (1.1.3)
1415
concurrent-ruby (1.3.6)
1516
date (3.5.1)
1617
docile (1.4.1)
17-
erb (6.0.1)
18+
erb (4.0.4)
19+
cgi (>= 0.3.3)
1820
i18n (1.14.8)
1921
concurrent-ruby (~> 1.0)
2022
io-console (0.8.2)
@@ -46,7 +48,7 @@ GEM
4648
racc (1.8.1)
4749
rainbow (3.1.1)
4850
rake (13.3.1)
49-
rdoc (7.0.3)
51+
rdoc (7.1.0)
5052
erb
5153
psych (>= 4.0.0)
5254
tsort
@@ -92,12 +94,13 @@ GEM
9294
yard (0.9.38)
9395

9496
PLATFORMS
95-
arm64-darwin-22
97+
arm64-darwin
9698
x86_64-linux
9799

98100
DEPENDENCIES
99101
benchmark
100102
benchmark-ips
103+
erb (~> 4.0.4)
101104
faker!
102105
irb
103106
minitest (= 5.27.0)

0 commit comments

Comments
 (0)