Allow bundler: none + bundle-cache: true to use the Bundler shipped with that Ruby + the cache

This commit is contained in:
Benoit Daloze
2022-01-27 20:07:26 +01:00
parent 51c0d59222
commit fabf2515e6
2 changed files with 16 additions and 14 deletions
+8 -7
View File
@@ -78,16 +78,17 @@ export async function setupRuby(options = {}) {
await inputs['afterSetupPathHook']({ platform, rubyPrefix, engine, version })
}
const [gemfile, lockFile] = bundler.detectGemfiles()
let bundlerVersion = "unknown"
if (inputs['bundler'] !== 'none') {
const [gemfile, lockFile] = bundler.detectGemfiles()
const bundlerVersion = await common.measure('Installing Bundler', async () =>
bundlerVersion = await common.measure('Installing Bundler', async () =>
bundler.installBundler(inputs['bundler'], lockFile, platform, rubyPrefix, engine, version))
}
if (inputs['bundler-cache'] === 'true') {
await common.measure('bundle install', async () =>
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
}
if (inputs['bundler-cache'] === 'true') {
await common.measure('bundle install', async () =>
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
}
core.setOutput('ruby-prefix', rubyPrefix)