Compare commits

...
8 Commits
6 changed files with 127 additions and 108 deletions
+6 -4
View File
@@ -29,9 +29,8 @@ Only versions published by [RubyInstaller](https://rubyinstaller.org/downloads/a
Due to that, Ruby 2.2 resolves to 2.2.6 on Windows and 2.2.10 on other platforms. Due to that, Ruby 2.2 resolves to 2.2.6 on Windows and 2.2.10 on other platforms.
And Ruby 2.3 on Windows only has builds for 2.3.0, 2.3.1 and 2.3.3. And Ruby 2.3 on Windows only has builds for 2.3.0, 2.3.1 and 2.3.3.
Note that Ruby ≤ 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life, Note that Ruby ≤ 2.4 and the OpenSSL version it needs (1.0.2) are both end-of-life,
which means Ruby ≤ 2.3 is unmaintained and considered insecure. which means Ruby ≤ 2.4 is unmaintained and considered insecure.
On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained.
### Supported Platforms ### Supported Platforms
@@ -204,7 +203,10 @@ if the [virtual environment](https://github.com/actions/virtual-environments) is
* Make sure to use the same operating system and version. * Make sure to use the same operating system and version.
* Make sure to use the same version of libssl. * Make sure to use the same version of libssl.
* Make sure that the operating system has `libyaml-0` installed * Make sure that the operating system has `libyaml-0` installed
* The runner software is running as user `runner` with a home directory of `/home/runner`, or you have created a symlink for the home directory of whatever user that the runner is running as to `/home/runner`. * The default tool cache directory (`/opt/hostedtoolcache` on Linux, `/Users/runner/hostedtoolcache` on macOS,
`C:/hostedtoolcache/windows` on Windows) must be writable by the `runner` user.
This is necessary since the Ruby builds embed the install path when built and cannot be moved around.
* `/home/runner` must be writable by the `runner` user.
In other cases, please use a system Ruby or [install Ruby manually](https://github.com/postmodern/chruby/wiki#installing-rubies) instead. In other cases, please use a system Ruby or [install Ruby manually](https://github.com/postmodern/chruby/wiki#installing-rubies) instead.
+22 -4
View File
@@ -59,15 +59,33 @@ function findUbuntuVersion() {
} }
} }
export function getImageOS() {
const imageOS = process.env['ImageOS']
if (!imageOS) {
throw new Error('The environment variable ImageOS must be set')
}
return imageOS
}
export function shouldExtractInToolCache(engine, version) { export function shouldExtractInToolCache(engine, version) {
return engine === 'ruby' && !isHeadVersion(version) return engine === 'ruby' && !isHeadVersion(version)
} }
export function getToolCacheRubyPrefix(version) { function getPlatformToolCache(platform) {
const toolCache = process.env['RUNNER_TOOL_CACHE'] // Hardcode paths rather than using $RUNNER_TOOL_CACHE because the prebuilt Rubies cannot be moved anyway
if (!toolCache) { if (platform.startsWith('ubuntu-')) {
throw new Error('$RUNNER_TOOL_CACHE must be set') return '/opt/hostedtoolcache'
} else if (platform.startsWith('macos-')) {
return '/Users/runner/hostedtoolcache'
} else if (platform.startsWith('windows-')) {
return 'C:/hostedtoolcache/windows'
} else {
throw new Error('Unknown platform')
} }
}
export function getToolCacheRubyPrefix(platform, version) {
const toolCache = getPlatformToolCache(platform)
return path.join(toolCache, 'Ruby', version, 'x64') return path.join(toolCache, 'Ruby', version, 'x64')
} }
Generated Vendored
+61 -52
View File
@@ -27714,7 +27714,7 @@ async function install(platform, engine, version) {
let rubyPrefix let rubyPrefix
if (common.shouldExtractInToolCache(engine, version)) { if (common.shouldExtractInToolCache(engine, version)) {
rubyPrefix = common.getToolCacheRubyPrefix(version) rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
} else { } else {
rubyPrefix = `${drive}:\\${base}` rubyPrefix = `${drive}:\\${base}`
} }
@@ -32098,6 +32098,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHeadVersion", function() { return isHeadVersion; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHeadVersion", function() { return isHeadVersion; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hashFile", function() { return hashFile; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hashFile", function() { return hashFile; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVirtualEnvironmentName", function() { return getVirtualEnvironmentName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVirtualEnvironmentName", function() { return getVirtualEnvironmentName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getImageOS", function() { return getImageOS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldExtractInToolCache", function() { return shouldExtractInToolCache; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldExtractInToolCache", function() { return shouldExtractInToolCache; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getToolCacheRubyPrefix", function() { return getToolCacheRubyPrefix; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getToolCacheRubyPrefix", function() { return getToolCacheRubyPrefix; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "win2nix", function() { return win2nix; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "win2nix", function() { return win2nix; });
@@ -32163,15 +32164,33 @@ function findUbuntuVersion() {
} }
} }
function getImageOS() {
const imageOS = process.env['ImageOS']
if (!imageOS) {
throw new Error('The environment variable ImageOS must be set')
}
return imageOS
}
function shouldExtractInToolCache(engine, version) { function shouldExtractInToolCache(engine, version) {
return engine === 'ruby' && !isHeadVersion(version) return engine === 'ruby' && !isHeadVersion(version)
} }
function getToolCacheRubyPrefix(version) { function getPlatformToolCache(platform) {
const toolCache = process.env['RUNNER_TOOL_CACHE'] // Hardcode paths rather than using $RUNNER_TOOL_CACHE because the prebuilt Rubies cannot be moved anyway
if (!toolCache) { if (platform.startsWith('ubuntu-')) {
throw new Error('$RUNNER_TOOL_CACHE must be set') return '/opt/hostedtoolcache'
} else if (platform.startsWith('macos-')) {
return '/Users/runner/hostedtoolcache'
} else if (platform.startsWith('windows-')) {
return 'C:/hostedtoolcache/windows'
} else {
throw new Error('Unknown platform')
} }
}
function getToolCacheRubyPrefix(platform, version) {
const toolCache = getPlatformToolCache(platform)
return path.join(toolCache, 'Ruby', version, 'x64') return path.join(toolCache, 'Ruby', version, 'x64')
} }
@@ -51181,7 +51200,7 @@ async function setupRuby(options = {}) {
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version']) const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
let installer let installer
if (platform === 'windows-latest' && engine === 'ruby') { if (platform.startsWith('windows-') && engine === 'ruby') {
installer = __webpack_require__(216) installer = __webpack_require__(216)
} else { } else {
installer = __webpack_require__(974) installer = __webpack_require__(974)
@@ -51217,25 +51236,15 @@ async function setupRuby(options = {}) {
core.setOutput('ruby-prefix', rubyPrefix) core.setOutput('ruby-prefix', rubyPrefix)
} }
// The returned gemfile is guaranteed to exist, the lockfile might not exist
function detectGemfiles() { function detectGemfiles() {
const gemfilePath = process.env['BUNDLE_GEMFILE'] || 'Gemfile' const gemfilePath = process.env['BUNDLE_GEMFILE'] || 'Gemfile'
if (fs.existsSync(gemfilePath)) { if (fs.existsSync(gemfilePath)) {
const lockPath = `${gemfilePath}.lock` return [gemfilePath, `${gemfilePath}.lock`]
if (fs.existsSync(lockPath)) {
return [gemfilePath, lockPath]
} else {
return [gemfilePath, null]
}
} }
const gemsRbPath = "gems.rb" if (fs.existsSync("gems.rb")) {
if (fs.existsSync(gemsRbPath)) { return ["gems.rb", "gems.locked"]
const lockPath = "gems.locked"
if (fs.existsSync(lockPath)) {
return [gemsRbPath, lockPath]
} else {
return [gemsRbPath, null]
}
} }
return [null, null] return [null, null]
@@ -51319,7 +51328,7 @@ function envPreInstall() {
} }
function readBundledWithFromGemfileLock(lockFile) { function readBundledWithFromGemfileLock(lockFile) {
if (lockFile !== null) { if (lockFile !== null && fs.existsSync(lockFile)) {
const contents = fs.readFileSync(lockFile, 'utf8') const contents = fs.readFileSync(lockFile, 'utf8')
const lines = contents.split(/\r?\n/) const lines = contents.split(/\r?\n/)
const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim())) const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim()))
@@ -51357,17 +51366,20 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`) throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
} }
if (rubyVersion.match(/^2\.[12]/)) { if (engine === 'ruby' && rubyVersion.match(/^2\.[12]/)) {
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2') console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
bundlerVersion = '1' bundlerVersion = '1'
} else if (rubyVersion.startsWith('2.3')) { } else if (engine === 'ruby' && rubyVersion.startsWith('2.3')) {
console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3') console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3')
bundlerVersion = '1' bundlerVersion = '1'
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1.')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
console.log('JRuby 9.1 has a bug with Bundler 2 (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
bundlerVersion = '1'
} }
if (engine === 'ruby' && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') { if ((engine === 'ruby' || engine === 'truffleruby') && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') {
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`) console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
} else if (engine === 'truffleruby' && bundlerVersion === '1') { } else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion === '1') {
console.log(`Using Bundler 1 shipped with ${engine}`) console.log(`Using Bundler 1 shipped with ${engine}`)
} else { } else {
const gem = path.join(rubyPrefix, 'bin', 'gem') const gem = path.join(rubyPrefix, 'bin', 'gem')
@@ -51384,24 +51396,22 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
// config // config
const path = 'vendor/bundle' const path = 'vendor/bundle'
if (lockFile !== null) {
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'])
}
await exec.exec('bundle', ['config', '--local', 'path', path]) await exec.exec('bundle', ['config', '--local', 'path', path])
if (fs.existsSync(lockFile)) {
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'])
} else {
// Generate the lockfile so we can use it to compute the cache key.
// This will also automatically pick up the latest gem versions compatible with the Gemfile.
await exec.exec('bundle', ['lock'])
}
// cache key // cache key
const paths = [path] const paths = [path]
const baseKey = await computeBaseKey(platform, engine, version, gemfile) const baseKey = await computeBaseKey(platform, engine, version, lockFile)
let key = baseKey const key = `${baseKey}-${await common.hashFile(lockFile)}`
let restoreKeys // If only Gemfile.lock changes we can reuse part of the cache (but it will keep old gem versions in the cache)
if (lockFile !== null) { const restoreKeys = [`${baseKey}-`]
key += `-${lockFile}-${await common.hashFile(lockFile)}`
// If only Gemfile.lock changes we can reuse part of the cache (but it will keep old gem versions in the cache)
restoreKeys = [`${baseKey}-${lockFile}-`]
} else {
// Only exact key, to never mix native gems of different platforms or Ruby versions
restoreKeys = []
}
console.log(`Cache key: ${key}`) console.log(`Cache key: ${key}`)
// restore cache & install // restore cache & install
@@ -51420,15 +51430,11 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
console.log(`Found cache for key: ${cachedKey}`) console.log(`Found cache for key: ${cachedKey}`)
} }
let alreadyInstalled = false // Always run 'bundle install' to list the gems
if (cachedKey === key) { await exec.exec('bundle', ['install', '--jobs', '4'])
const exitCode = await exec.exec('bundle', ['check'], { ignoreReturnCode: true })
alreadyInstalled = (exitCode === 0)
}
if (!alreadyInstalled) {
await exec.exec('bundle', ['install', '--jobs', '4'])
// @actions/cache only allows to save for non-existing keys
if (cachedKey !== key) {
// Error handling from https://github.com/actions/cache/blob/master/src/save.ts // Error handling from https://github.com/actions/cache/blob/master/src/save.ts
console.log('Saving cache') console.log('Saving cache')
try { try {
@@ -51447,8 +51453,9 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
return true return true
} }
async function computeBaseKey(platform, engine, version, gemfile) { async function computeBaseKey(platform, engine, version, lockFile) {
let baseKey = `setup-ruby-toolcache-bundle-install-${platform}-${engine}-${version}-${gemfile}` let key = `setup-ruby-bundler-cache-v2-${common.getImageOS()}-${engine}-${version}`
if (engine !== 'jruby' && common.isHeadVersion(version)) { if (engine !== 'jruby' && common.isHeadVersion(version)) {
let revision = ''; let revision = '';
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], { await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
@@ -51459,9 +51466,11 @@ async function computeBaseKey(platform, engine, version, gemfile) {
} }
} }
}); });
baseKey += `-revision-${revision}` key += `-revision-${revision}`
} }
return baseKey
key += `-${lockFile}`
return key
} }
if (__filename.endsWith('index.js')) { run() } if (__filename.endsWith('index.js')) { run() }
@@ -52901,7 +52910,7 @@ async function install(platform, engine, version) {
async function downloadAndExtract(platform, engine, version) { async function downloadAndExtract(platform, engine, version) {
let rubyPrefix let rubyPrefix
if (common.shouldExtractInToolCache(engine, version)) { if (common.shouldExtractInToolCache(engine, version)) {
rubyPrefix = common.getToolCacheRubyPrefix(version) rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
} else if (windows) { } else if (windows) {
rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`) rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`)
} else { } else {
+36 -46
View File
@@ -39,7 +39,7 @@ export async function setupRuby(options = {}) {
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version']) const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
let installer let installer
if (platform === 'windows-latest' && engine === 'ruby') { if (platform.startsWith('windows-') && engine === 'ruby') {
installer = require('./windows') installer = require('./windows')
} else { } else {
installer = require('./ruby-builder') installer = require('./ruby-builder')
@@ -75,25 +75,15 @@ export async function setupRuby(options = {}) {
core.setOutput('ruby-prefix', rubyPrefix) core.setOutput('ruby-prefix', rubyPrefix)
} }
// The returned gemfile is guaranteed to exist, the lockfile might not exist
function detectGemfiles() { function detectGemfiles() {
const gemfilePath = process.env['BUNDLE_GEMFILE'] || 'Gemfile' const gemfilePath = process.env['BUNDLE_GEMFILE'] || 'Gemfile'
if (fs.existsSync(gemfilePath)) { if (fs.existsSync(gemfilePath)) {
const lockPath = `${gemfilePath}.lock` return [gemfilePath, `${gemfilePath}.lock`]
if (fs.existsSync(lockPath)) {
return [gemfilePath, lockPath]
} else {
return [gemfilePath, null]
}
} }
const gemsRbPath = "gems.rb" if (fs.existsSync("gems.rb")) {
if (fs.existsSync(gemsRbPath)) { return ["gems.rb", "gems.locked"]
const lockPath = "gems.locked"
if (fs.existsSync(lockPath)) {
return [gemsRbPath, lockPath]
} else {
return [gemsRbPath, null]
}
} }
return [null, null] return [null, null]
@@ -177,7 +167,7 @@ function envPreInstall() {
} }
function readBundledWithFromGemfileLock(lockFile) { function readBundledWithFromGemfileLock(lockFile) {
if (lockFile !== null) { if (lockFile !== null && fs.existsSync(lockFile)) {
const contents = fs.readFileSync(lockFile, 'utf8') const contents = fs.readFileSync(lockFile, 'utf8')
const lines = contents.split(/\r?\n/) const lines = contents.split(/\r?\n/)
const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim())) const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim()))
@@ -215,17 +205,20 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`) throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
} }
if (rubyVersion.match(/^2\.[12]/)) { if (engine === 'ruby' && rubyVersion.match(/^2\.[12]/)) {
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2') console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
bundlerVersion = '1' bundlerVersion = '1'
} else if (rubyVersion.startsWith('2.3')) { } else if (engine === 'ruby' && rubyVersion.startsWith('2.3')) {
console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3') console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3')
bundlerVersion = '1' bundlerVersion = '1'
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1.')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
console.log('JRuby 9.1 has a bug with Bundler 2 (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
bundlerVersion = '1'
} }
if (engine === 'ruby' && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') { if ((engine === 'ruby' || engine === 'truffleruby') && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') {
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`) console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
} else if (engine === 'truffleruby' && bundlerVersion === '1') { } else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion === '1') {
console.log(`Using Bundler 1 shipped with ${engine}`) console.log(`Using Bundler 1 shipped with ${engine}`)
} else { } else {
const gem = path.join(rubyPrefix, 'bin', 'gem') const gem = path.join(rubyPrefix, 'bin', 'gem')
@@ -242,24 +235,22 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
// config // config
const path = 'vendor/bundle' const path = 'vendor/bundle'
if (lockFile !== null) {
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'])
}
await exec.exec('bundle', ['config', '--local', 'path', path]) await exec.exec('bundle', ['config', '--local', 'path', path])
if (fs.existsSync(lockFile)) {
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'])
} else {
// Generate the lockfile so we can use it to compute the cache key.
// This will also automatically pick up the latest gem versions compatible with the Gemfile.
await exec.exec('bundle', ['lock'])
}
// cache key // cache key
const paths = [path] const paths = [path]
const baseKey = await computeBaseKey(platform, engine, version, gemfile) const baseKey = await computeBaseKey(platform, engine, version, lockFile)
let key = baseKey const key = `${baseKey}-${await common.hashFile(lockFile)}`
let restoreKeys // If only Gemfile.lock changes we can reuse part of the cache (but it will keep old gem versions in the cache)
if (lockFile !== null) { const restoreKeys = [`${baseKey}-`]
key += `-${lockFile}-${await common.hashFile(lockFile)}`
// If only Gemfile.lock changes we can reuse part of the cache (but it will keep old gem versions in the cache)
restoreKeys = [`${baseKey}-${lockFile}-`]
} else {
// Only exact key, to never mix native gems of different platforms or Ruby versions
restoreKeys = []
}
console.log(`Cache key: ${key}`) console.log(`Cache key: ${key}`)
// restore cache & install // restore cache & install
@@ -278,15 +269,11 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
console.log(`Found cache for key: ${cachedKey}`) console.log(`Found cache for key: ${cachedKey}`)
} }
let alreadyInstalled = false // Always run 'bundle install' to list the gems
if (cachedKey === key) { await exec.exec('bundle', ['install', '--jobs', '4'])
const exitCode = await exec.exec('bundle', ['check'], { ignoreReturnCode: true })
alreadyInstalled = (exitCode === 0)
}
if (!alreadyInstalled) {
await exec.exec('bundle', ['install', '--jobs', '4'])
// @actions/cache only allows to save for non-existing keys
if (cachedKey !== key) {
// Error handling from https://github.com/actions/cache/blob/master/src/save.ts // Error handling from https://github.com/actions/cache/blob/master/src/save.ts
console.log('Saving cache') console.log('Saving cache')
try { try {
@@ -305,8 +292,9 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
return true return true
} }
async function computeBaseKey(platform, engine, version, gemfile) { async function computeBaseKey(platform, engine, version, lockFile) {
let baseKey = `setup-ruby-toolcache-bundle-install-${platform}-${engine}-${version}-${gemfile}` let key = `setup-ruby-bundler-cache-v2-${common.getImageOS()}-${engine}-${version}`
if (engine !== 'jruby' && common.isHeadVersion(version)) { if (engine !== 'jruby' && common.isHeadVersion(version)) {
let revision = ''; let revision = '';
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], { await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
@@ -317,9 +305,11 @@ async function computeBaseKey(platform, engine, version, gemfile) {
} }
} }
}); });
baseKey += `-revision-${revision}` key += `-revision-${revision}`
} }
return baseKey
key += `-${lockFile}`
return key
} }
if (__filename.endsWith('index.js')) { run() } if (__filename.endsWith('index.js')) { run() }
+1 -1
View File
@@ -23,7 +23,7 @@ export async function install(platform, engine, version) {
async function downloadAndExtract(platform, engine, version) { async function downloadAndExtract(platform, engine, version) {
let rubyPrefix let rubyPrefix
if (common.shouldExtractInToolCache(engine, version)) { if (common.shouldExtractInToolCache(engine, version)) {
rubyPrefix = common.getToolCacheRubyPrefix(version) rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
} else if (windows) { } else if (windows) {
rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`) rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`)
} else { } else {
+1 -1
View File
@@ -38,7 +38,7 @@ export async function install(platform, engine, version) {
let rubyPrefix let rubyPrefix
if (common.shouldExtractInToolCache(engine, version)) { if (common.shouldExtractInToolCache(engine, version)) {
rubyPrefix = common.getToolCacheRubyPrefix(version) rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
} else { } else {
rubyPrefix = `${drive}:\\${base}` rubyPrefix = `${drive}:\\${base}`
} }