mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Crash on invalid Elixir+OTP combo (#134)
* Prevent "future" errors when choosing incompatible Elixir v. OTP versions * Fix tests as per GitHub Actions' output * Make test elixir `master` strict It has no -otp- in the name
This commit is contained in:
committed by
GitHub
parent
7dd0d763a8
commit
6b2f8153b4
@@ -116,6 +116,7 @@ jobs:
|
|||||||
- elixir-version: 'master'
|
- elixir-version: 'master'
|
||||||
otp-version: '25'
|
otp-version: '25'
|
||||||
os: 'ubuntu-20.04'
|
os: 'ubuntu-20.04'
|
||||||
|
version-type: 'strict'
|
||||||
- gleam-version: 'nightly'
|
- gleam-version: 'nightly'
|
||||||
otp-version: '24'
|
otp-version: '24'
|
||||||
- gleam-version: '0.23'
|
- gleam-version: '0.23'
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ async function testElixirVersions() {
|
|||||||
let otpVersion
|
let otpVersion
|
||||||
|
|
||||||
spec = '1.1.x'
|
spec = '1.1.x'
|
||||||
otpVersion = 'OTP-23'
|
otpVersion = 'OTP-17'
|
||||||
expected = 'v1.1.1'
|
expected = 'v1.1.1-otp-17'
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
|||||||
Vendored
+5
-3
@@ -7358,9 +7358,11 @@ async function getElixirVersion(exSpec0, otpVersion) {
|
|||||||
`Using Elixir ${elixirVersion} (built for OTP ${otpVersionMajor})`,
|
`Using Elixir ${elixirVersion} (built for OTP ${otpVersionMajor})`,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// ... and it's not available: fallback to the 'generic' version (v1.4.5 only).
|
// ... and it's not available: exit with exception
|
||||||
elixirVersionWithOTP = elixirVersion
|
throw new Error(
|
||||||
core.info(`Using Elixir ${elixirVersion}`)
|
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion}) not ` +
|
||||||
|
'found in version list (did you check Compatibility between Elixir and Erlang/OTP?)',
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
+5
-3
@@ -188,9 +188,11 @@ async function getElixirVersion(exSpec0, otpVersion) {
|
|||||||
`Using Elixir ${elixirVersion} (built for OTP ${otpVersionMajor})`,
|
`Using Elixir ${elixirVersion} (built for OTP ${otpVersionMajor})`,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// ... and it's not available: fallback to the 'generic' version (v1.4.5 only).
|
// ... and it's not available: exit with exception
|
||||||
elixirVersionWithOTP = elixirVersion
|
throw new Error(
|
||||||
core.info(`Using Elixir ${elixirVersion}`)
|
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion}) not ` +
|
||||||
|
'found in version list (did you check Compatibility between Elixir and Erlang/OTP?)',
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
Reference in New Issue
Block a user