diff --git a/dist/index.js b/dist/index.js index d33bd98..8a1760c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -51365,12 +51365,12 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) { // cache key const paths = [path] - const baseKey = await computeBaseKey(platform, engine, version) + const baseKey = await computeBaseKey(platform, engine, version, gemfile) let key = baseKey let restoreKeys if (lockFile !== null) { key += `-${lockFile}-${await common.hashFile(lockFile)}` - // If only Gemfile.lock we can reuse some of the cache (but it will keep old gem versions in the cache) + // 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 @@ -51421,8 +51421,8 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) { return true } -async function computeBaseKey(platform, engine, version) { - let baseKey = `setup-ruby-bundle-install-${platform}-${engine}-${version}` +async function computeBaseKey(platform, engine, version, gemfile) { + let baseKey = `setup-ruby-bundle-install-${platform}-${engine}-${version}-${gemfile}` if (engine !== 'jruby' && common.isHeadVersion(version)) { let revision = ''; await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], { diff --git a/index.js b/index.js index fa125b2..eb14ffe 100644 --- a/index.js +++ b/index.js @@ -249,12 +249,12 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) { // cache key const paths = [path] - const baseKey = await computeBaseKey(platform, engine, version) + const baseKey = await computeBaseKey(platform, engine, version, gemfile) let key = baseKey let restoreKeys if (lockFile !== null) { key += `-${lockFile}-${await common.hashFile(lockFile)}` - // If only Gemfile.lock we can reuse some of the cache (but it will keep old gem versions in the cache) + // 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 @@ -305,8 +305,8 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) { return true } -async function computeBaseKey(platform, engine, version) { - let baseKey = `setup-ruby-bundle-install-${platform}-${engine}-${version}` +async function computeBaseKey(platform, engine, version, gemfile) { + let baseKey = `setup-ruby-bundle-install-${platform}-${engine}-${version}-${gemfile}` if (engine !== 'jruby' && common.isHeadVersion(version)) { let revision = ''; await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {