diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dccad38..147d4bcd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,6 +98,10 @@ jobs: otp-version: '23' rebar3-version: '3.14' os: 'ubuntu-20.04' + - elixir-version: 'v1.12' + otp-version: '24' + rebar3-version: '3.15' + os: 'ubuntu-20.04' steps: - uses: actions/checkout@v2 - name: Use erlef/setup-beam diff --git a/3RD_PARTY_LICENSES b/3RD_PARTY_LICENSES index e10a7d17..76cf966a 100644 --- a/3RD_PARTY_LICENSES +++ b/3RD_PARTY_LICENSES @@ -1081,7 +1081,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----- -The following software may be included in this product: es-to-primitive, is-boolean-object, is-callable, is-date-object, is-number-object, is-string, is-symbol, object.entries. A copy of the source code may be downloaded from git://github.com/ljharb/es-to-primitive.git (es-to-primitive), git://github.com/ljharb/is-boolean-object.git (is-boolean-object), git://github.com/ljharb/is-callable.git (is-callable), git://github.com/ljharb/is-date-object.git (is-date-object), git://github.com/inspect-js/is-number-object.git (is-number-object), git://github.com/ljharb/is-string.git (is-string), git://github.com/inspect-js/is-symbol.git (is-symbol), git://github.com/es-shims/Object.entries.git (object.entries). This software contains the following license and notice below: +The following software may be included in this product: es-to-primitive, is-boolean-object, is-callable, is-date-object, is-number-object, is-string, is-symbol, object.entries. A copy of the source code may be downloaded from git://github.com/ljharb/es-to-primitive.git (es-to-primitive), git://github.com/inspect-js/is-boolean-object.git (is-boolean-object), git://github.com/ljharb/is-callable.git (is-callable), git://github.com/inspect-js/is-date-object.git (is-date-object), git://github.com/inspect-js/is-number-object.git (is-number-object), git://github.com/ljharb/is-string.git (is-string), git://github.com/inspect-js/is-symbol.git (is-symbol), git://github.com/es-shims/Object.entries.git (object.entries). This software contains the following license and notice below: The MIT License (MIT) @@ -1928,7 +1928,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----- -The following software may be included in this product: is-bigint. A copy of the source code may be downloaded from git+https://github.com/ljharb/is-bigint.git. This software contains the following license and notice below: +The following software may be included in this product: is-bigint. A copy of the source code may be downloaded from git+https://github.com/inspect-js/is-bigint.git. This software contains the following license and notice below: MIT License @@ -2216,7 +2216,7 @@ terms above. ----- -The following software may be included in this product: lodash.clonedeep, lodash.flatten, lodash.snakecase, lodash.truncate. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash.clonedeep), https://github.com/lodash/lodash.git (lodash.flatten), https://github.com/lodash/lodash.git (lodash.snakecase), https://github.com/lodash/lodash.git (lodash.truncate). This software contains the following license and notice below: +The following software may be included in this product: lodash.clonedeep, lodash.snakecase, lodash.truncate. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash.clonedeep), https://github.com/lodash/lodash.git (lodash.snakecase), https://github.com/lodash/lodash.git (lodash.truncate). This software contains the following license and notice below: Copyright jQuery Foundation and other contributors diff --git a/__tests__/setup-beam.test.js b/__tests__/setup-beam.test.js index 548a88ee..1dbc3597 100644 --- a/__tests__/setup-beam.test.js +++ b/__tests__/setup-beam.test.js @@ -98,6 +98,30 @@ async function testOTPVersions() { expected = 'OTP-19.3.6' got = await setupElixir.getOTPVersion(spec, osVersion) assert.deepStrictEqual(got, expected) + + spec = '20' + osVersion = 'ubuntu-20.04' + expected = 'OTP-20.3.8' + got = await setupElixir.getOTPVersion(spec, osVersion) + assert.deepStrictEqual(got, expected) + + spec = '20.x' + osVersion = 'ubuntu-20.04' + expected = 'OTP-20.3.8' + got = await setupElixir.getOTPVersion(spec, osVersion) + assert.deepStrictEqual(got, expected) + + spec = '20.0' + osVersion = 'ubuntu-20.04' + expected = 'OTP-20.0.5' + got = await setupElixir.getOTPVersion(spec, osVersion) + assert.deepStrictEqual(got, expected) + + spec = '20.0.x' + osVersion = 'ubuntu-20.04' + expected = 'OTP-20.0.5' + got = await setupElixir.getOTPVersion(spec, osVersion) + assert.deepStrictEqual(got, expected) } async function testElixirVersions() { diff --git a/dist/index.js b/dist/index.js index d876a230..f2b0dbef 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4791,7 +4791,10 @@ async function getOTPVersions(osVersion) { .forEach((line) => { const otpMatch = line.match(/^(OTP-)?([^ ]+)/) - const otpVersion = otpMatch[2] + let otpVersion = otpMatch[2] + if (semver.validRange(otpVersion)) { + otpVersion = semver.minVersion(otpVersion).version + } otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference }) diff --git a/src/setup-beam.js b/src/setup-beam.js index d4d41c4b..05934be6 100644 --- a/src/setup-beam.js +++ b/src/setup-beam.js @@ -184,7 +184,10 @@ async function getOTPVersions(osVersion) { .forEach((line) => { const otpMatch = line.match(/^(OTP-)?([^ ]+)/) - const otpVersion = otpMatch[2] + let otpVersion = otpMatch[2] + if (semver.validRange(otpVersion)) { + otpVersion = semver.minVersion(otpVersion).version + } otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference })