Skip to content

Commit 276e065

Browse files
authored
Update RubyGems in GitHub Actions CI (#406)
* Update RubyGems in GitHub Actions CI * Allow `WARN: Unresolved or ambiguous specs during Gem::Specification.reset:` for Ruby 3.0.x and TruffleRuby The latest RubyGems version supported on Ruby 3.0 is 3.5.23, and TruffleRuby does not support `gem update --system` (its bundled RubyGems version is 3.5.22). Both of these are lower than 3.6.0, so the warning is expected in these environments.
1 parent b7a85cd commit 276e065

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

.github/workflows/ruby.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,24 @@ jobs:
1616
- '3.4'
1717
- jruby
1818
- truffleruby
19+
include:
20+
- ruby: '3.0'
21+
rubygems_version: '3.5.23'
22+
- ruby: '3.1'
23+
rubygems_version: '3.6.9'
1924
name: Ruby ${{ matrix.ruby }}
2025
steps:
2126
- uses: actions/checkout@v2
2227
- name: Set up Ruby
2328
uses: ruby/setup-ruby@v1
2429
with:
2530
ruby-version: ${{ matrix.ruby }}
31+
- name: Update RubyGems
32+
env:
33+
RUBYGEMS_VERSION: ${{ matrix.rubygems_version }}
34+
run: |
35+
gem update --system ${RUBYGEMS_VERSION:-}
36+
gem -v
2637
- name: Install dependencies
2738
run: bundle install --jobs 4 --retry 3
2839
- name: Run tests

spec/integration_spec.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
subject { sh(command) }
1212

1313
it "must invoke the CLI class" do
14-
expect(subject).to eq("bundler-audit #{Bundler::Audit::VERSION}#{$/}")
14+
expected = "bundler-audit #{Bundler::Audit::VERSION}#{$/}"
15+
16+
if RUBY_VERSION.start_with?("3.0") || RUBY_ENGINE == "truffleruby"
17+
# Allow `WARN: Unresolved or ambiguous specs during Gem::Specification.reset:` for Ruby 3.0.x and TruffleRuby
18+
expect(subject).to include(expected)
19+
else
20+
expect(subject).to eq(expected)
21+
end
1522
end
1623
end
1724

@@ -26,6 +33,13 @@
2633
subject { sh(command) }
2734

2835
it "must invoke the CLI class" do
29-
expect(subject).to eq("bundler-audit #{Bundler::Audit::VERSION}#{$/}")
36+
expected = "bundler-audit #{Bundler::Audit::VERSION}#{$/}"
37+
38+
if RUBY_VERSION.start_with?("3.0") || RUBY_ENGINE == "truffleruby"
39+
# Allow `WARN: Unresolved or ambiguous specs during Gem::Specification.reset:` for Ruby 3.0.x and TruffleRuby
40+
expect(subject).to include(expected)
41+
else
42+
expect(subject).to eq(expected)
43+
end
3044
end
3145
end

0 commit comments

Comments
 (0)