Test on top of Erlang/OTP 25+ (not RC) (#118)

* Add Erlang/OTP 25+ (not RC) to tests

* Test a specific combo

And a strict version

* Allow testing "edge" cases

We weren't taking our own considerations into account for version strictness
We want to be able to test cases where we use -otp- (if the consumer is doing
it, at least they have to use _strict_ to assert their decision)
This commit is contained in:
Paulo F. Oliveira
2022-05-30 15:11:49 +01:00
committed by GitHub
parent b8427d3a11
commit ac7b7d515b
4 changed files with 26 additions and 14 deletions
+7 -6
View File
@@ -141,7 +141,7 @@ async function getOTPVersion(otpSpec0, osVersion) {
const otpVersions = await getOTPVersions(osVersion)
const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
let otpVersion
if (otpSpec[1]) {
if (otpSpec[1] && !isStrictVersion()) {
throw new Error(
`Requested Erlang/OTP version (${otpSpec0}) ` +
"should not contain 'OTP-'",
@@ -169,7 +169,7 @@ async function getElixirVersion(exSpec0, otpVersion) {
const exSpec = exSpec0.match(/^v?(.+)(-otp-.+)/) || exSpec0.match(/^v?(.+)/)
let elixirVersion
if (exSpec[2]) {
if (exSpec[2] && !isStrictVersion()) {
throw new Error(
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion}) ` +
"should not contain '-otp-...'",
@@ -335,13 +335,14 @@ async function getRebar3Versions() {
return rebar3VersionsListing
}
function isStrictVersion() {
return core.getInput('version-type', { required: false }) === 'strict'
}
function getVersionFromSpec(spec, versions) {
let version = null
if (
spec.match(/rc/) ||
core.getInput('version-type', { required: false }) === 'strict'
) {
if (spec.match(/rc/) || isStrictVersion()) {
version = spec
}