From 7b728b73d09ae43c4abe79b9830ff062fbb016c2 Mon Sep 17 00:00:00 2001 From: Denis Kulicek Date: Thu, 29 Oct 2020 14:27:52 +0100 Subject: [PATCH] Add experimental-otp input opt-in flag --- dist/index.js | 8 ++++++-- src/setup-elixir.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 724995d..5cf9a60 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3321,13 +3321,17 @@ async function main() { elixirSpec, otpVersion ) - const osVersion = getOSVersion() let installHex = core.getInput('install-hex') installHex = installHex == null ? 'true' : installHex + let installRebar = core.getInput('install-rebar') installRebar = installRebar == null ? 'true' : installRebar + const experimentalOTP = core.getInput('experimental-otp') + const osVersion = + experimentalOTP === 'true' ? getRunnerOSVersion() : 'ubuntu-14.04' + console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`) await installOTP(otpVersion, osVersion) console.log(`##[endgroup]`) @@ -3359,7 +3363,7 @@ async function getOtpVersion(spec) { return getVersionFromSpec(spec, await getOtpVersions()) || spec } -function getOSVersion() { +function getRunnerOSVersion(experimentalOTP) { const mapToUbuntuVersion = { ubuntu16: 'ubuntu-16.04', ubuntu18: 'ubuntu-18.04', diff --git a/src/setup-elixir.js b/src/setup-elixir.js index b896d7e..c1046c4 100644 --- a/src/setup-elixir.js +++ b/src/setup-elixir.js @@ -23,13 +23,17 @@ async function main() { elixirSpec, otpVersion ) - const osVersion = getOSVersion() let installHex = core.getInput('install-hex') installHex = installHex == null ? 'true' : installHex + let installRebar = core.getInput('install-rebar') installRebar = installRebar == null ? 'true' : installRebar + const experimentalOTP = core.getInput('experimental-otp') + const osVersion = + experimentalOTP === 'true' ? getRunnerOSVersion() : 'ubuntu-14.04' + console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`) await installOTP(otpVersion, osVersion) console.log(`##[endgroup]`) @@ -61,7 +65,7 @@ async function getOtpVersion(spec) { return getVersionFromSpec(spec, await getOtpVersions()) || spec } -function getOSVersion() { +function getRunnerOSVersion(experimentalOTP) { const mapToUbuntuVersion = { ubuntu16: 'ubuntu-16.04', ubuntu18: 'ubuntu-18.04',