Add groups to clarify output and measure the time each group takes

This commit is contained in:
Benoit Daloze
2020-04-05 14:09:18 +02:00
parent 045dd42354
commit e9b0369f85
5 changed files with 96 additions and 24 deletions
+4 -1
View File
@@ -26,7 +26,8 @@ export async function run() {
setupPath(ruby, newPathEntries)
await installBundler(platform, rubyPrefix, engine, version)
await common.measure('Installing Bundler', async () =>
installBundler(platform, rubyPrefix, engine, version))
core.setOutput('ruby-prefix', rubyPrefix)
} catch (error) {
@@ -101,12 +102,14 @@ function setupPath(ruby, newPathEntries) {
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
if (cleanPath.length !== originalPath.length) {
core.startGroup('Cleaning PATH')
console.log('Entries removed from PATH to avoid conflicts with Ruby:')
for (const entry of originalPath) {
if (!cleanPath.includes(entry)) {
console.log(` ${entry}`)
}
}
core.endGroup()
}
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))