Compare commits

...
5 Commits
4 changed files with 50 additions and 30 deletions
+12
View File
@@ -240,6 +240,18 @@ jobs:
ruby-version: '2.6' ruby-version: '2.6'
- run: ruby -v - run: ruby -v
testNoGemfileWithBundlerCache:
name: "Test with no Gemfile but with bundler-cache"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rm Gemfile
- uses: ./
with:
ruby-version: '2.6'
bundler-cache: true
- run: ruby -v
testLatestRubygemsVersion: testLatestRubygemsVersion:
name: "Test rubygems: latest on ${{ matrix.ruby }}" name: "Test rubygems: latest on ${{ matrix.ruby }}"
runs-on: ubuntu-latest runs-on: ubuntu-latest
+2 -3
View File
@@ -360,8 +360,7 @@ export function setupPath(newPathEntries) {
const originalPath = process.env[envPath].split(path.delimiter) const originalPath = process.env[envPath].split(path.delimiter)
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
core.startGroup(`Modifying ${envPath}`) core.group(`Modifying ${envPath}`, async () => {
// First remove the conflicting path entries // First remove the conflicting path entries
if (cleanPath.length !== originalPath.length) { if (cleanPath.length !== originalPath.length) {
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
@@ -377,7 +376,7 @@ export function setupPath(newPathEntries) {
for (const entry of newPathEntries) { for (const entry of newPathEntries) {
console.log(` ${entry}`) console.log(` ${entry}`)
} }
core.endGroup() })
core.addPath(newPathEntries.join(path.delimiter)) core.addPath(newPathEntries.join(path.delimiter))
} }
Generated Vendored
+7 -3
View File
@@ -677,8 +677,7 @@ function setupPath(newPathEntries) {
const originalPath = process.env[envPath].split(path.delimiter) const originalPath = process.env[envPath].split(path.delimiter)
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
core.startGroup(`Modifying ${envPath}`) core.group(`Modifying ${envPath}`, async () => {
// First remove the conflicting path entries // First remove the conflicting path entries
if (cleanPath.length !== originalPath.length) { if (cleanPath.length !== originalPath.length) {
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
@@ -694,7 +693,7 @@ function setupPath(newPathEntries) {
for (const entry of newPathEntries) { for (const entry of newPathEntries) {
console.log(` ${entry}`) console.log(` ${entry}`)
} }
core.endGroup() })
core.addPath(newPathEntries.join(path.delimiter)) core.addPath(newPathEntries.join(path.delimiter))
} }
@@ -85351,6 +85350,11 @@ async function setupRuby(options = {}) {
if (inputs['bundler-cache'] === 'true') { if (inputs['bundler-cache'] === 'true') {
await common.time('bundle install', async () => await common.time('bundle install', async () =>
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version'])) bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
if (lockFile !== null && fs.existsSync(lockFile)) {
await core.group(`Print lockfile`, async () =>
await exec.exec('cat', [lockFile]))
}
} }
core.setOutput('ruby-prefix', rubyPrefix) core.setOutput('ruby-prefix', rubyPrefix)
+5
View File
@@ -99,6 +99,11 @@ export async function setupRuby(options = {}) {
if (inputs['bundler-cache'] === 'true') { if (inputs['bundler-cache'] === 'true') {
await common.time('bundle install', async () => await common.time('bundle install', async () =>
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version'])) bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
if (lockFile !== null && fs.existsSync(lockFile)) {
await core.group(`Print lockfile`, async () =>
await exec.exec('cat', [lockFile]))
}
} }
core.setOutput('ruby-prefix', rubyPrefix) core.setOutput('ruby-prefix', rubyPrefix)