Don't show versioninfo() by default (#25)

* Only show versioninfo() in debug mode

* Add input to specify if versioninfo() is displayed

* No access to secrets
This commit is contained in:
Sascha Mann
2020-02-19 20:45:01 +01:00
committed by GitHub
parent eba5daa7a3
commit 83f4f82909
3 changed files with 17 additions and 4 deletions

View File

@@ -9,6 +9,10 @@ inputs:
description: 'Architecture of the Julia binaries. Defaults to x64.' description: 'Architecture of the Julia binaries. Defaults to x64.'
required: false required: false
default: 'x64' default: 'x64'
show-versioninfo:
description: 'Display InteractiveUtils.versioninfo() after installing'
required: false
default: 'false'
runs: runs:
using: 'node12' using: 'node12'
main: 'lib/setup-julia.js' main: 'lib/setup-julia.js'

8
lib/setup-julia.js generated
View File

@@ -43,8 +43,12 @@ function run() {
} }
// Add it to PATH // Add it to PATH
core.addPath(path.join(juliaPath, 'bin')); core.addPath(path.join(juliaPath, 'bin'));
// Test if Julia has been installed by showing versioninfo() // Test if Julia has been installed
yield exec.exec('julia', ['-e', 'using InteractiveUtils; versioninfo()']); 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()']);
}
} }
catch (error) { catch (error) {
core.setFailed(error.message); core.setFailed(error.message);

View File

@@ -32,8 +32,13 @@ async function run() {
// Add it to PATH // Add it to PATH
core.addPath(path.join(juliaPath, 'bin')) core.addPath(path.join(juliaPath, 'bin'))
// Test if Julia has been installed by showing versioninfo() // Test if Julia has been installed
await exec.exec('julia', ['-e', 'using InteractiveUtils; versioninfo()']) 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()'])
}
} catch (error) { } catch (error) {
core.setFailed(error.message) core.setFailed(error.message)
} }