Repository navigation
Add a test using setup-ruby twice in the same job - #958
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
Using setup-ruby twice in the same job (e.g. for multiple Gemfiles in a monorepo) was not tested, which let ruby#444 slip through: BUNDLER_VERSION exported by a first setup-ruby step using Bundler 1 leaked into a second step, whose `bundle install` then failed with "You must use Bundler 2 or greater with this lockfile". The new job reproduces that scenario: a first step uses Bundler 1 via gemfiles/bundler1.gemfile, then a second step on the root Gemfile must use Bundler 2.4 (the latest Bundler for Ruby 2.7), both for the action's own `bundle install` and for later steps. It runs on ubuntu-24.04 since Ruby 2.7 is not available on ubuntu-26.04, which ubuntu-latest is moving to. Closes ruby#445
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a CI job using setup-ruby twice in the same job, the scenario from #444:
setup-rubystep uses Bundler 1 withgemfiles/bundler1.gemfile(passed as a step-levelBUNDLE_GEMFILE).setup-rubystep uses the rootGemfile, and must use Bundler 2.4 (the latest Bundler for Ruby 2.7), both for its ownbundle installand for later steps.The job runs on
ubuntu-24.04because Ruby 2.7 is not available onubuntu-26.04, whichubuntu-latestis moving to.I checked it by running the job's steps locally in an
ubuntu:24.04container, applying$GITHUB_ENV/$GITHUB_PATHbetween steps the same way the runner does:BUNDLER_VERSIONwhen Bundler 1 is used), the second step fails withYou must use Bundler 2 or greater with this lockfile, as reported in When executing RubySetup twice in the same job, the Bundler version is superseded by an env var set in the first RubySetup step.. #444