mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-22 22:56:07 +00:00
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:
committed by
GitHub
parent
b8427d3a11
commit
ac7b7d515b
@@ -21,7 +21,17 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
combo:
|
combo:
|
||||||
- otp-version: '25.0-rc1'
|
- otp-version: '25.0'
|
||||||
|
elixir-version: 'v1.13.4-otp-25'
|
||||||
|
rebar3-version: '3.18.0'
|
||||||
|
os: 'ubuntu-latest'
|
||||||
|
version-type: 'strict'
|
||||||
|
- otp-version: '25.0'
|
||||||
|
elixir-version: 'v1.13.4'
|
||||||
|
rebar3-version: '3.18.0'
|
||||||
|
os: 'ubuntu-latest'
|
||||||
|
version-type: 'strict'
|
||||||
|
- otp-version: '25'
|
||||||
rebar3-version: 'nightly'
|
rebar3-version: 'nightly'
|
||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
- otp-version: '24'
|
- otp-version: '24'
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
combo:
|
combo:
|
||||||
- otp-version: '25.0-rc1'
|
- otp-version: '25'
|
||||||
rebar3-version: 'nightly'
|
rebar3-version: 'nightly'
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
- otp-version: '24.0.2'
|
- otp-version: '24.0.2'
|
||||||
|
|||||||
Vendored
+7
-6
@@ -6193,7 +6193,7 @@ async function getOTPVersion(otpSpec0, osVersion) {
|
|||||||
const otpVersions = await getOTPVersions(osVersion)
|
const otpVersions = await getOTPVersions(osVersion)
|
||||||
const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
|
const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
|
||||||
let otpVersion
|
let otpVersion
|
||||||
if (otpSpec[1]) {
|
if (otpSpec[1] && !isStrictVersion()) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Requested Erlang/OTP version (${otpSpec0}) ` +
|
`Requested Erlang/OTP version (${otpSpec0}) ` +
|
||||||
"should not contain 'OTP-'",
|
"should not contain 'OTP-'",
|
||||||
@@ -6221,7 +6221,7 @@ async function getElixirVersion(exSpec0, otpVersion) {
|
|||||||
|
|
||||||
const exSpec = exSpec0.match(/^v?(.+)(-otp-.+)/) || exSpec0.match(/^v?(.+)/)
|
const exSpec = exSpec0.match(/^v?(.+)(-otp-.+)/) || exSpec0.match(/^v?(.+)/)
|
||||||
let elixirVersion
|
let elixirVersion
|
||||||
if (exSpec[2]) {
|
if (exSpec[2] && !isStrictVersion()) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion}) ` +
|
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion}) ` +
|
||||||
"should not contain '-otp-...'",
|
"should not contain '-otp-...'",
|
||||||
@@ -6387,13 +6387,14 @@ async function getRebar3Versions() {
|
|||||||
return rebar3VersionsListing
|
return rebar3VersionsListing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isStrictVersion() {
|
||||||
|
return core.getInput('version-type', { required: false }) === 'strict'
|
||||||
|
}
|
||||||
|
|
||||||
function getVersionFromSpec(spec, versions) {
|
function getVersionFromSpec(spec, versions) {
|
||||||
let version = null
|
let version = null
|
||||||
|
|
||||||
if (
|
if (spec.match(/rc/) || isStrictVersion()) {
|
||||||
spec.match(/rc/) ||
|
|
||||||
core.getInput('version-type', { required: false }) === 'strict'
|
|
||||||
) {
|
|
||||||
version = spec
|
version = spec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -141,7 +141,7 @@ async function getOTPVersion(otpSpec0, osVersion) {
|
|||||||
const otpVersions = await getOTPVersions(osVersion)
|
const otpVersions = await getOTPVersions(osVersion)
|
||||||
const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
|
const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
|
||||||
let otpVersion
|
let otpVersion
|
||||||
if (otpSpec[1]) {
|
if (otpSpec[1] && !isStrictVersion()) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Requested Erlang/OTP version (${otpSpec0}) ` +
|
`Requested Erlang/OTP version (${otpSpec0}) ` +
|
||||||
"should not contain 'OTP-'",
|
"should not contain 'OTP-'",
|
||||||
@@ -169,7 +169,7 @@ async function getElixirVersion(exSpec0, otpVersion) {
|
|||||||
|
|
||||||
const exSpec = exSpec0.match(/^v?(.+)(-otp-.+)/) || exSpec0.match(/^v?(.+)/)
|
const exSpec = exSpec0.match(/^v?(.+)(-otp-.+)/) || exSpec0.match(/^v?(.+)/)
|
||||||
let elixirVersion
|
let elixirVersion
|
||||||
if (exSpec[2]) {
|
if (exSpec[2] && !isStrictVersion()) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion}) ` +
|
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion}) ` +
|
||||||
"should not contain '-otp-...'",
|
"should not contain '-otp-...'",
|
||||||
@@ -335,13 +335,14 @@ async function getRebar3Versions() {
|
|||||||
return rebar3VersionsListing
|
return rebar3VersionsListing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isStrictVersion() {
|
||||||
|
return core.getInput('version-type', { required: false }) === 'strict'
|
||||||
|
}
|
||||||
|
|
||||||
function getVersionFromSpec(spec, versions) {
|
function getVersionFromSpec(spec, versions) {
|
||||||
let version = null
|
let version = null
|
||||||
|
|
||||||
if (
|
if (spec.match(/rc/) || isStrictVersion()) {
|
||||||
spec.match(/rc/) ||
|
|
||||||
core.getInput('version-type', { required: false }) === 'strict'
|
|
||||||
) {
|
|
||||||
version = spec
|
version = spec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user