From 4599a83ca2dcac4eeef66295457d329aa708239e Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Fri, 1 Jan 2021 12:26:42 +0100 Subject: [PATCH 1/2] Use --compile=min -O0 flags for versioninfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano --- lib/setup-julia.js | 3 ++- package-lock.json | 2 +- package.json | 2 +- src/setup-julia.ts | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/setup-julia.js b/lib/setup-julia.js index 5fcbea87..c93f9f75 100644 --- a/lib/setup-julia.js +++ b/lib/setup-julia.js @@ -82,7 +82,8 @@ function run() { exec.exec('julia', ['--version']); // If enabled, also show the full version info if (core.getInput('show-versioninfo') == 'true') { - exec.exec('julia', ['-e', 'using InteractiveUtils; versioninfo()']); + // --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s + exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()']); } } catch (error) { diff --git a/package-lock.json b/package-lock.json index 262e8295..0592ddb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "setup-julia", - "version": "1.5.0", + "version": "1.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0896b9f1..4b887d7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-julia", - "version": "1.5.0", + "version": "1.5.1", "private": true, "description": "setup Julia action", "main": "lib/setup-julia.js", diff --git a/src/setup-julia.ts b/src/setup-julia.ts index 2c334bf3..bf62727f 100644 --- a/src/setup-julia.ts +++ b/src/setup-julia.ts @@ -79,7 +79,8 @@ async function run() { // If enabled, also show the full version info if (core.getInput('show-versioninfo') == 'true') { - exec.exec('julia', ['-e', 'using InteractiveUtils; versioninfo()']) + // --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s + exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()']) } } catch (error) { core.setFailed(error.message) From 64f4c58e456c10c2816d92b4ee492b39a86dfe7c Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Fri, 1 Jan 2021 12:30:30 +0100 Subject: [PATCH 2/2] Don't print version twice if show-versioninfo is enabled --- lib/setup-julia.js | 9 ++++++--- src/setup-julia.ts | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/setup-julia.js b/lib/setup-julia.js index c93f9f75..42ebdd3c 100644 --- a/lib/setup-julia.js +++ b/lib/setup-julia.js @@ -78,13 +78,16 @@ function run() { core.addPath(path.join(juliaPath, 'bin')); // Set output core.setOutput('julia-bindir', path.join(juliaPath, 'bin')); - // Test if Julia has been installed - exec.exec('julia', ['--version']); - // If enabled, also show the full version info + // Test if Julia has been installed and print the version if (core.getInput('show-versioninfo') == 'true') { + // If enabled, show the full version info // --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()']); } + else { + // Otherwise only print julia --version to save time + exec.exec('julia', ['--version']); + } } catch (error) { core.setFailed(error.message); diff --git a/src/setup-julia.ts b/src/setup-julia.ts index bf62727f..08bab8db 100644 --- a/src/setup-julia.ts +++ b/src/setup-julia.ts @@ -73,14 +73,15 @@ async function run() { // Set output core.setOutput('julia-bindir', path.join(juliaPath, 'bin')) - - // Test if Julia has been installed - exec.exec('julia', ['--version']) - // If enabled, also show the full version info + // Test if Julia has been installed and print the version if (core.getInput('show-versioninfo') == 'true') { + // If enabled, show the full version info // --compile=min -O0 reduces the time from ~1.8-1.9s to ~0.8-0.9s exec.exec('julia', ['--compile=min', '-O0', '-e', 'using InteractiveUtils; versioninfo()']) + } else { + // Otherwise only print julia --version to save time + exec.exec('julia', ['--version']) } } catch (error) { core.setFailed(error.message)