mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Compare commits
50 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3580539cee | |||
| fe5485f1f6 | |||
| 98de8ffa90 | |||
| 6c5fe278e7 | |||
| 36214a49c0 | |||
| 972bec8037 | |||
| 10e998534e | |||
| 542d9a8e62 | |||
| b764149ef2 | |||
| cba803d7b7 | |||
| eda66a8458 | |||
| cf0aea912f | |||
| 13b647ed24 | |||
| d6f6c371de | |||
| 905cf79e7d | |||
| 4f85a51ca2 | |||
| fc1fdd6f00 | |||
| da184bc66d | |||
| 566deebc64 | |||
| b94e7d372a | |||
| 033f103421 | |||
| 9afaa6e45f | |||
| 4168d0bf3c | |||
| 8c38699ca8 | |||
| df4a3eca5d | |||
| db4f13ce18 | |||
| 1df7f7a827 | |||
| f350bf9e05 | |||
| e6d7c94229 | |||
| fceaea9f54 | |||
| 2bb5b653d0 | |||
| 1d4efdd2e9 | |||
| 73f047e328 | |||
| 6dd8a1a852 | |||
| fd9a2e183f | |||
| 65085e37bc | |||
| 80c1659516 | |||
| 8e7fdef09f | |||
| 1fe9179886 | |||
| 6389fe58dc | |||
| 8fc1380bb7 | |||
| 3c915dd1b0 | |||
| e5d50587ee | |||
| b1273cf7cc | |||
| 9308cafcbf | |||
| 2971b073e5 | |||
| a0b139a890 | |||
| 6a38171948 | |||
| 75edbb8287 | |||
| a8bc27ec39 |
@@ -24,7 +24,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Version it!
|
- name: Version it!
|
||||||
run: |
|
run: |
|
||||||
# We expect a string such as const setupBeamVersion = 'undefined' in the code
|
# We expect a string such as const setupBeamVersion = 'undefined' in the code
|
||||||
@@ -45,8 +45,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- uses: actions/setup-node@v4.4.0
|
- uses: actions/setup-node@v6.1.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
- run: npm run build-dist
|
- run: npm run build-dist
|
||||||
@@ -58,15 +58,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- uses: raven-actions/actionlint@v2.0.1
|
- uses: raven-actions/actionlint@v2.1.0
|
||||||
|
|
||||||
unit_tests_ubuntu:
|
unit_tests_ubuntu:
|
||||||
name: Unit tests (Ubuntu)
|
name: Unit tests (Ubuntu)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- uses: actions/setup-node@v4.4.0
|
- uses: actions/setup-node@v6.1.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
@@ -76,6 +76,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
install-rebar: false
|
install-rebar: false
|
||||||
|
install-hex: false
|
||||||
version-file: test/.tool-versions
|
version-file: test/.tool-versions
|
||||||
version-type: strict
|
version-type: strict
|
||||||
|
|
||||||
@@ -83,19 +84,27 @@ jobs:
|
|||||||
name: Unit tests (Windows)
|
name: Unit tests (Windows)
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- uses: actions/setup-node@v4.4.0
|
- uses: actions/setup-node@v6.1.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
- run: npm install --production
|
- run: npm install --production
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
- name: .tool-versions test
|
||||||
|
id: setup-beam
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
install-rebar: false
|
||||||
|
install-hex: false
|
||||||
|
version-file: test/.tool-versions
|
||||||
|
version-type: strict
|
||||||
|
|
||||||
unit_tests_macos:
|
unit_tests_macos:
|
||||||
name: Unit tests (macOS)
|
name: Unit tests (macOS)
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- uses: actions/setup-node@v4.4.0
|
- uses: actions/setup-node@v6.1.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
install-rebar: [true, false]
|
install-rebar: [true, false]
|
||||||
install-hex: [true, false]
|
install-hex: [true, false]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
@@ -43,12 +43,6 @@ jobs:
|
|||||||
elixir-version: '1.14.3'
|
elixir-version: '1.14.3'
|
||||||
os: 'macos-latest'
|
os: 'macos-latest'
|
||||||
version-type: 'strict'
|
version-type: 'strict'
|
||||||
- otp-version: '27'
|
|
||||||
os: 'macos-15'
|
|
||||||
version-type: 'strict'
|
|
||||||
- otp-version: '26'
|
|
||||||
os: 'macos-15'
|
|
||||||
version-type: 'strict'
|
|
||||||
- otp-version: '25'
|
- otp-version: '25'
|
||||||
os: 'macos-15'
|
os: 'macos-15'
|
||||||
- otp-version: '26'
|
- otp-version: '26'
|
||||||
@@ -71,7 +65,7 @@ jobs:
|
|||||||
rebar3-version: 'latest'
|
rebar3-version: 'latest'
|
||||||
os: 'macos-latest'
|
os: 'macos-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -124,7 +118,7 @@ jobs:
|
|||||||
rebar3-version: 3.24
|
rebar3-version: 3.24
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
@@ -25,6 +25,15 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
combo:
|
combo:
|
||||||
|
- otp-version: '<26'
|
||||||
|
elixir-version: '<1.17'
|
||||||
|
os: 'ubuntu-22.04'
|
||||||
|
- otp-version: 'master'
|
||||||
|
elixir-version: '> 0'
|
||||||
|
os: 'ubuntu-24.04'
|
||||||
|
- otp-version: 'master'
|
||||||
|
elixir-version: 'main'
|
||||||
|
os: 'ubuntu-24.04'
|
||||||
- otp-version: '27'
|
- otp-version: '27'
|
||||||
elixir-version: 'v1.17.0'
|
elixir-version: 'v1.17.0'
|
||||||
rebar3-version: '3.23'
|
rebar3-version: '3.23'
|
||||||
@@ -44,12 +53,6 @@ jobs:
|
|||||||
elixir-version: '1.14.3'
|
elixir-version: '1.14.3'
|
||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
version-type: 'strict'
|
version-type: 'strict'
|
||||||
- otp-version: '27'
|
|
||||||
os: 'ubuntu-24.04'
|
|
||||||
version-type: 'strict'
|
|
||||||
- otp-version: '26'
|
|
||||||
os: 'ubuntu-24.04'
|
|
||||||
version-type: 'strict'
|
|
||||||
- otp-version: '25'
|
- otp-version: '25'
|
||||||
os: 'ubuntu-24.04'
|
os: 'ubuntu-24.04'
|
||||||
- otp-version: '26'
|
- otp-version: '26'
|
||||||
@@ -83,7 +86,7 @@ jobs:
|
|||||||
escript_script: 'protoc-gen-elixir --version'
|
escript_script: 'protoc-gen-elixir --version'
|
||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -151,7 +154,7 @@ jobs:
|
|||||||
rebar3-version: 3.24
|
rebar3-version: 3.24
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
name: Update 3rd party licenses
|
name: Update 3rd party licenses
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- run:
|
- run:
|
||||||
./.github/workflows/update_3rd_party_licenses.sh
|
./.github/workflows/update_3rd_party_licenses.sh
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
combo:
|
combo:
|
||||||
|
- otp-version: '<26'
|
||||||
|
elixir-version: '<1.17'
|
||||||
|
os: 'ubuntu-22.04'
|
||||||
|
- otp-version: 'master'
|
||||||
|
elixir-version: '> 0'
|
||||||
|
os: 'ubuntu-24.04'
|
||||||
- otp-version: '27'
|
- otp-version: '27'
|
||||||
elixir-version: 'v1.17.0'
|
elixir-version: 'v1.17.0'
|
||||||
rebar3-version: '3.23'
|
rebar3-version: '3.23'
|
||||||
@@ -64,7 +70,7 @@ jobs:
|
|||||||
escript_script: 'protoc-gen-elixir --version'
|
escript_script: 'protoc-gen-elixir --version'
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -131,7 +137,7 @@ jobs:
|
|||||||
rebar3-version: 3.24
|
rebar3-version: 3.24
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.2.2
|
- uses: actions/checkout@v6.0.2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
@@ -53,19 +53,25 @@ end up being parsed as `23`, which is not equivalent.
|
|||||||
|
|
||||||
#### Pre-release versions
|
#### Pre-release versions
|
||||||
|
|
||||||
For pre-release versions, such as `v1.11.0-rc.0`, use the full version
|
To use a pre-release version such as `v1.11.0-rc.0`, specify the exact version
|
||||||
specifier (`v1.11.0-rc.0`) and set option `version-type` to `strict`. Pre-release versions are
|
(`v1.11.0-rc.0`) and set `version-type` to `strict`.
|
||||||
opt-in, so `1.11.x` will not match a pre-release.
|
Note that pre-release versions are opt-in by default.
|
||||||
|
Patterns like `1.11.x` do not include pre-release versions unless `latest` is specified.
|
||||||
|
|
||||||
#### "Latest" versions
|
#### "Latest" versions
|
||||||
|
|
||||||
Set a tool's version to `latest` to retrieve the latest version of a given tool.
|
To retrieve the most recent available version of a tool, set the version to `latest`.
|
||||||
The latest version is (locally) calculated by the action based on the (retrieved) versions
|
This may include pre-release versions such as release candidates.
|
||||||
it knows (**note**: it is not the same as [GitHub considers it](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository)
|
|
||||||
and some repositories might propose).
|
|
||||||
|
|
||||||
If in doubt do a test run and compare the obtained release with the one you were expecting to
|
If you want to target only the latest stable release and exclude pre-releases, use a
|
||||||
be the latest.
|
version range like `> 0` instead.
|
||||||
|
|
||||||
|
Note that the `latest` version is determined locally by the action based on the versions it
|
||||||
|
has retrieved. This may differ from how [GitHub defines "latest"](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository),
|
||||||
|
and some repositories may present different interpretations.
|
||||||
|
|
||||||
|
If you're unsure, perform a test run and compare the resolved version against the version you
|
||||||
|
expect to be considered the latest.
|
||||||
|
|
||||||
### Compatibility between Operating System and Erlang/OTP
|
### Compatibility between Operating System and Erlang/OTP
|
||||||
|
|
||||||
@@ -78,6 +84,7 @@ and Erlang/OTP.
|
|||||||
| `ubuntu-24.04` | 24.3 - 28 | x86_64, arm64 | ✅
|
| `ubuntu-24.04` | 24.3 - 28 | x86_64, arm64 | ✅
|
||||||
| `windows-2019` | 21\* - 25 | x86_64, x86 | ✅
|
| `windows-2019` | 21\* - 25 | x86_64, x86 | ✅
|
||||||
| `windows-2022` | 21\* - 28 | x86_64, x86 | ✅
|
| `windows-2022` | 21\* - 28 | x86_64, x86 | ✅
|
||||||
|
| `windows-2025` | 21\* - 28 | x86_64, x86 | ✅
|
||||||
| `macOS-13` | 25.0 - 28 | x86_64, arm64 | ✅
|
| `macOS-13` | 25.0 - 28 | x86_64, arm64 | ✅
|
||||||
| `macOS-14` | 25.0 - 28 | x86_64, arm64 | ✅
|
| `macOS-14` | 25.0 - 28 | x86_64, arm64 | ✅
|
||||||
| `macOS-15` | 25.0 - 28 | x86_64, arm64 | ✅
|
| `macOS-15` | 25.0 - 28 | x86_64, arm64 | ✅
|
||||||
@@ -96,6 +103,7 @@ uses that to download assets:
|
|||||||
| `ubuntu24` | `ubuntu-24.04`
|
| `ubuntu24` | `ubuntu-24.04`
|
||||||
| `win19` | `windows-2019`
|
| `win19` | `windows-2019`
|
||||||
| `win22` | `windows-2022`
|
| `win22` | `windows-2022`
|
||||||
|
| `win25` | `windows-2025`
|
||||||
| `macos13` | `macOS-13`
|
| `macos13` | `macOS-13`
|
||||||
| `macos14` | `macOS-14`
|
| `macos14` | `macOS-14`
|
||||||
| `macos15` | `macOS-15`
|
| `macos15` | `macOS-15`
|
||||||
@@ -291,7 +299,7 @@ on: push
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2025
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: erlef/setup-beam@v1
|
- uses: erlef/setup-beam@v1
|
||||||
|
|||||||
Vendored
+182
-60
@@ -5700,7 +5700,7 @@ function coerce (version, options) {
|
|||||||
var undefined;
|
var undefined;
|
||||||
|
|
||||||
/** Used as the semantic version number. */
|
/** Used as the semantic version number. */
|
||||||
var VERSION = '4.17.21';
|
var VERSION = '4.17.23';
|
||||||
|
|
||||||
/** Used as the size to enable large array optimizations. */
|
/** Used as the size to enable large array optimizations. */
|
||||||
var LARGE_ARRAY_SIZE = 200;
|
var LARGE_ARRAY_SIZE = 200;
|
||||||
@@ -9454,7 +9454,7 @@ function coerce (version, options) {
|
|||||||
if (isArray(iteratee)) {
|
if (isArray(iteratee)) {
|
||||||
return function(value) {
|
return function(value) {
|
||||||
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
return iteratee;
|
return iteratee;
|
||||||
});
|
});
|
||||||
@@ -10058,8 +10058,47 @@ function coerce (version, options) {
|
|||||||
*/
|
*/
|
||||||
function baseUnset(object, path) {
|
function baseUnset(object, path) {
|
||||||
path = castPath(path, object);
|
path = castPath(path, object);
|
||||||
object = parent(object, path);
|
|
||||||
return object == null || delete object[toKey(last(path))];
|
// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
||||||
|
var index = -1,
|
||||||
|
length = path.length;
|
||||||
|
|
||||||
|
if (!length) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
|
||||||
|
|
||||||
|
while (++index < length) {
|
||||||
|
var key = path[index];
|
||||||
|
|
||||||
|
// skip non-string keys (e.g., Symbols, numbers)
|
||||||
|
if (typeof key !== 'string') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always block "__proto__" anywhere in the path if it's not expected
|
||||||
|
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Block "constructor.prototype" chains
|
||||||
|
if (key === 'constructor' &&
|
||||||
|
(index + 1) < length &&
|
||||||
|
typeof path[index + 1] === 'string' &&
|
||||||
|
path[index + 1] === 'prototype') {
|
||||||
|
|
||||||
|
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
|
||||||
|
if (isRootPrimitive && index === 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var obj = parent(object, path);
|
||||||
|
return obj == null || delete obj[toKey(last(path))];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25890,9 +25929,11 @@ const _ = __nccwpck_require__(2356)
|
|||||||
|
|
||||||
const MAX_HTTP_RETRIES = 3
|
const MAX_HTTP_RETRIES = 3
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== 'test') {
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
core.setFailed(err.message)
|
core.setFailed(err.message)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
checkOtpArchitecture()
|
checkOtpArchitecture()
|
||||||
@@ -25908,15 +25949,14 @@ async function main() {
|
|||||||
versions = parseVersionFile(versionFilePath)
|
versions = parseVersionFile(versionFilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
const osVersion = getRunnerOSVersion()
|
|
||||||
const otpSpec = getInput('otp-version', true, 'erlang', versions)
|
const otpSpec = getInput('otp-version', true, 'erlang', versions)
|
||||||
const elixirSpec = getInput('elixir-version', false, 'elixir', versions)
|
const elixirSpec = getInput('elixir-version', false, 'elixir', versions)
|
||||||
const gleamSpec = getInput('gleam-version', false, 'gleam', versions)
|
const gleamSpec = getInput('gleam-version', false, 'gleam', versions)
|
||||||
const rebar3Spec = getInput('rebar3-version', false, 'rebar', versions)
|
const rebar3Spec = getInput('rebar3-version', false, 'rebar', versions)
|
||||||
|
|
||||||
if (otpSpec !== 'false') {
|
if (otpSpec !== 'false') {
|
||||||
await installOTP(otpSpec, osVersion)
|
await installOTP(otpSpec)
|
||||||
const elixirInstalled = await maybeInstallElixir(elixirSpec, otpSpec)
|
const elixirInstalled = await maybeInstallElixir(elixirSpec)
|
||||||
if (elixirInstalled === true) {
|
if (elixirInstalled === true) {
|
||||||
const shouldMixRebar = getInput('install-rebar', false)
|
const shouldMixRebar = getInput('install-rebar', false)
|
||||||
await mix(shouldMixRebar, 'rebar')
|
await mix(shouldMixRebar, 'rebar')
|
||||||
@@ -25932,11 +25972,12 @@ async function main() {
|
|||||||
await maybeInstallRebar3(rebar3Spec)
|
await maybeInstallRebar3(rebar3Spec)
|
||||||
|
|
||||||
// undefined is replaced by a function, post- main branch merge
|
// undefined is replaced by a function, post- main branch merge
|
||||||
const setupBeamVersion = 'abd725c'
|
const setupBeamVersion = 'fe5485f'
|
||||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function installOTP(otpSpec, osVersion) {
|
async function installOTP(otpSpec) {
|
||||||
|
const osVersion = getRunnerOSVersion()
|
||||||
const otpVersion = await getOTPVersion(otpSpec, osVersion)
|
const otpVersion = await getOTPVersion(otpSpec, osVersion)
|
||||||
core.startGroup(
|
core.startGroup(
|
||||||
`Installing Erlang/OTP ${otpVersion} - built on ${getRunnerOSArchitecture()}/${osVersion}`,
|
`Installing Erlang/OTP ${otpVersion} - built on ${getRunnerOSArchitecture()}/${osVersion}`,
|
||||||
@@ -25958,10 +25999,10 @@ async function installOTP(otpSpec, osVersion) {
|
|||||||
return otpVersion
|
return otpVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
async function maybeInstallElixir(elixirSpec, otpSpec) {
|
async function maybeInstallElixir(elixirSpec) {
|
||||||
let installed = false
|
let installed = false
|
||||||
if (elixirSpec) {
|
if (elixirSpec) {
|
||||||
const elixirVersion = await getElixirVersion(elixirSpec, otpSpec)
|
const elixirVersion = await getElixirVersion(elixirSpec)
|
||||||
core.startGroup(`Installing Elixir ${elixirVersion}`)
|
core.startGroup(`Installing Elixir ${elixirVersion}`)
|
||||||
await doWithMirrors({
|
await doWithMirrors({
|
||||||
hexMirrors: hexMirrorsInput(),
|
hexMirrors: hexMirrorsInput(),
|
||||||
@@ -26043,10 +26084,14 @@ async function maybeInstallRebar3(rebar3Spec) {
|
|||||||
return installed
|
return installed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function maybeRemoveOTPPrefix(otpSpec) {
|
||||||
|
return otpSpec.replace(/^OTP-/, '')
|
||||||
|
}
|
||||||
|
|
||||||
async function getOTPVersion(otpSpec0, osVersion) {
|
async function getOTPVersion(otpSpec0, osVersion) {
|
||||||
const [otpVersions, originListing, hexMirrors] =
|
const [otpVersions, originListing, hexMirrors] =
|
||||||
await getOTPVersions(osVersion)
|
await getOTPVersions(osVersion)
|
||||||
let spec = otpSpec0.replace(/^OTP-/, '')
|
let spec = maybeRemoveOTPPrefix(otpSpec0)
|
||||||
const versions = otpVersions
|
const versions = otpVersions
|
||||||
const otpVersion = getVersionFromSpec(spec, versions)
|
const otpVersion = getVersionFromSpec(spec, versions)
|
||||||
|
|
||||||
@@ -26060,26 +26105,50 @@ async function getOTPVersion(otpSpec0, osVersion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function requestedVersionFor(tool, version, originListing, mirrors) {
|
function requestedVersionFor(tool, version, originListing, mirrors) {
|
||||||
return (
|
const isStrictVersion = isStrictVersion()
|
||||||
`Requested ${tool} version (${version}) not found in version list, ` +
|
|
||||||
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}; ` +
|
let versionType = 'loose'
|
||||||
"should you be using option 'version-type': 'strict'?"
|
if (isStrictVersion) {
|
||||||
)
|
versionType = 'strict'
|
||||||
|
}
|
||||||
|
|
||||||
|
let ret =
|
||||||
|
`Requested ${versionType} ${tool} version (${version}) not found in version list, ` +
|
||||||
|
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.`
|
||||||
|
if (!isStrictVersion) {
|
||||||
|
ret = `${ret} Should you be using option 'version-type': 'strict'?`
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
const knownBranches = ['main', 'master', 'maint']
|
const knownBranches = ['main', 'master', 'maint']
|
||||||
const nonSpecificVersions = ['nightly', 'latest']
|
const nonSpecificVersions = ['nightly', 'latest']
|
||||||
|
|
||||||
async function getElixirVersion(exSpec0, otpVersion0) {
|
async function getElixirVersion(exSpec0) {
|
||||||
const otpVersion = otpVersion0.match(/^(?:OTP-)?(.+)$/)[1]
|
|
||||||
const regex = `^(\\d{1,3}|${knownBranches.join('|')}|${nonSpecificVersions.join('|')})?.*$`
|
|
||||||
let otpVersionMajor = otpVersion.match(new RegExp(regex))[1]
|
|
||||||
|
|
||||||
const otpSuffix = /-otp-(\d+)/
|
const otpSuffix = /-otp-(\d+)/
|
||||||
const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null
|
const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null
|
||||||
|
let otpVersionMajor = ''
|
||||||
|
|
||||||
if (userSuppliedOtp && isVersion(userSuppliedOtp)) {
|
if (userSuppliedOtp && isVersion(userSuppliedOtp)) {
|
||||||
otpVersionMajor = userSuppliedOtp
|
otpVersionMajor = userSuppliedOtp
|
||||||
|
} else {
|
||||||
|
let cmd = 'erl'
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
cmd = 'erl.exe'
|
||||||
|
}
|
||||||
|
const args = [
|
||||||
|
'-noshell',
|
||||||
|
'-eval',
|
||||||
|
'io:format(erlang:system_info(otp_release)), halt().',
|
||||||
|
]
|
||||||
|
await exec(cmd, args, {
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => {
|
||||||
|
otpVersionMajor = data.toString()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] =
|
const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] =
|
||||||
@@ -26094,17 +26163,29 @@ async function getElixirVersion(exSpec0, otpVersion0) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let foundCombo = false
|
||||||
|
let otpVersionMajorIter = parseInt(otpVersionMajor)
|
||||||
|
let otpVersionsMajor = []
|
||||||
|
while (otpVersionMajorIter > otpVersionMajor - 3) {
|
||||||
|
otpVersionMajorIter += ''
|
||||||
|
otpVersionsMajor.push(otpVersionMajorIter)
|
||||||
const elixirVersionComp = otpVersionsForElixirMap[elixirVersionFromSpec]
|
const elixirVersionComp = otpVersionsForElixirMap[elixirVersionFromSpec]
|
||||||
if (
|
if (
|
||||||
(elixirVersionComp && elixirVersionComp.includes(otpVersionMajor)) ||
|
(elixirVersionComp && elixirVersionComp.includes(otpVersionMajorIter)) ||
|
||||||
!isVersion(otpVersionMajor)
|
!isVersion(otpVersionMajorIter)
|
||||||
) {
|
) {
|
||||||
core.info(
|
core.info(
|
||||||
`Using Elixir ${elixirVersionFromSpec} (built for Erlang/OTP ${otpVersionMajor})`,
|
`Using Elixir ${elixirVersionFromSpec} (built for Erlang/OTP ${otpVersionMajorIter})`,
|
||||||
)
|
)
|
||||||
} else {
|
foundCombo = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
otpVersionMajorIter = parseInt(otpVersionMajorIter) - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundCombo) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion0}) not ` +
|
`Requested Elixir / Erlang/OTP version (${exSpec0} / tried ${otpVersionsMajor}) not ` +
|
||||||
'found in version list (did you check Compatibility between Elixir and Erlang/OTP?).' +
|
'found in version list (did you check Compatibility between Elixir and Erlang/OTP?).' +
|
||||||
'Elixir and Erlang/OTP compatibility can be found at: ' +
|
'Elixir and Erlang/OTP compatibility can be found at: ' +
|
||||||
'https://hexdocs.pm/elixir/compatibility-and-deprecations.html',
|
'https://hexdocs.pm/elixir/compatibility-and-deprecations.html',
|
||||||
@@ -26113,8 +26194,8 @@ async function getElixirVersion(exSpec0, otpVersion0) {
|
|||||||
|
|
||||||
let elixirVersionForDownload = elixirVersionFromSpec
|
let elixirVersionForDownload = elixirVersionFromSpec
|
||||||
|
|
||||||
if (isVersion(otpVersionMajor)) {
|
if (isVersion(otpVersionMajorIter)) {
|
||||||
elixirVersionForDownload = `${elixirVersionFromSpec}-otp-${otpVersionMajor}`
|
elixirVersionForDownload = `${elixirVersionFromSpec}-otp-${otpVersionMajorIter}`
|
||||||
}
|
}
|
||||||
|
|
||||||
return maybePrependWithV(elixirVersionForDownload)
|
return maybePrependWithV(elixirVersionForDownload)
|
||||||
@@ -26196,12 +26277,9 @@ async function getOTPVersions(osVersion) {
|
|||||||
.trim()
|
.trim()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
const otpMatch = line
|
const otpVersionOrig = line.match(/^([^ ]+)?( .+)/)[1]
|
||||||
.match(/^([^ ]+)?( .+)/)[1]
|
const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig)
|
||||||
.match(/^([^-]+-)?(.+)$/)
|
debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig])
|
||||||
const otpVersion = otpMatch[2]
|
|
||||||
const otpVersionOrig = otpMatch[0]
|
|
||||||
debugLog('OTP line and parsing', [line, otpVersion, otpMatch])
|
|
||||||
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
||||||
})
|
})
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32') {
|
||||||
@@ -26215,10 +26293,10 @@ async function getOTPVersions(osVersion) {
|
|||||||
.flat()
|
.flat()
|
||||||
.filter((x) => x.name.match(file_regex))
|
.filter((x) => x.name.match(file_regex))
|
||||||
.forEach((x) => {
|
.forEach((x) => {
|
||||||
const otpMatch = x.name.match(file_regex)
|
const otpVersionOrig = x.name.match(file_regex)[1]
|
||||||
const otpVersion = otpMatch[1]
|
const otpVersion = otpVersionOrig
|
||||||
debugLog('OTP line and parsing', [otpMatch, otpVersion])
|
debugLog('OTP line and parsing', [x.name, otpVersion, otpVersionOrig])
|
||||||
otpVersions[otpVersion] = otpVersion
|
otpVersions[otpVersion] = otpVersionOrig
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (process.platform === 'darwin') {
|
} else if (process.platform === 'darwin') {
|
||||||
@@ -26227,10 +26305,9 @@ async function getOTPVersions(osVersion) {
|
|||||||
columns: true,
|
columns: true,
|
||||||
})
|
})
|
||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
const otpMatch = line.ref_name.match(/^([^-]+-)?(.+)$/)
|
const otpVersionOrig = line.ref_name
|
||||||
const otpVersion = otpMatch[2]
|
const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig)
|
||||||
const otpVersionOrig = otpMatch[0]
|
debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig])
|
||||||
debugLog('OTP line and parsing', [line, otpVersion, otpMatch])
|
|
||||||
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -26323,6 +26400,7 @@ function validVersion(v) {
|
|||||||
v.match(
|
v.match(
|
||||||
new RegExp(`${knownBranches.join('|')}|${nonSpecificVersions.join('|')}`),
|
new RegExp(`${knownBranches.join('|')}|${nonSpecificVersions.join('|')}`),
|
||||||
) == null &&
|
) == null &&
|
||||||
|
// these ones are for rebar3, which has alpha and beta releases
|
||||||
!v.startsWith('a') &&
|
!v.startsWith('a') &&
|
||||||
!v.startsWith('b')
|
!v.startsWith('b')
|
||||||
)
|
)
|
||||||
@@ -26349,8 +26427,14 @@ function getVersionFromSpec(spec0, versions0) {
|
|||||||
const altVersions = {}
|
const altVersions = {}
|
||||||
Object.entries(versions0).forEach(([version, altVersion]) => {
|
Object.entries(versions0).forEach(([version, altVersion]) => {
|
||||||
let coerced
|
let coerced
|
||||||
if (isStrictVersion() || isRC(version)) {
|
if (
|
||||||
// If `version-type: strict` or version is RC, we just try to remove a potential initial v
|
isStrictVersion() ||
|
||||||
|
isRC(version) ||
|
||||||
|
isKnownBranch(version) ||
|
||||||
|
isKnownVerBranch(version)
|
||||||
|
) {
|
||||||
|
// If `version-type: strict`, version is an RC, or version is "a branch"
|
||||||
|
// we just try to remove a potential initial v
|
||||||
coerced = maybeRemoveVPrefix(version)
|
coerced = maybeRemoveVPrefix(version)
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, we place the version into a version bucket
|
// Otherwise, we place the version into a version bucket
|
||||||
@@ -26367,13 +26451,19 @@ function getVersionFromSpec(spec0, versions0) {
|
|||||||
const rangeMax = semver.maxSatisfying(versions, rangeForMax)
|
const rangeMax = semver.maxSatisfying(versions, rangeForMax)
|
||||||
let version = null
|
let version = null
|
||||||
|
|
||||||
if (isStrictVersion() || isRC(spec0) || isKnownBranch(spec0)) {
|
if (spec0 === 'latest') {
|
||||||
|
version = versions0[versions0.latest]
|
||||||
|
} else if (
|
||||||
|
isStrictVersion() ||
|
||||||
|
isRC(spec0) ||
|
||||||
|
isKnownBranch(spec0) ||
|
||||||
|
isKnownVerBranch(spec0) ||
|
||||||
|
spec0 === 'nightly'
|
||||||
|
) {
|
||||||
if (versions0[spec]) {
|
if (versions0[spec]) {
|
||||||
// If `version-type: strict` or version is RC, we obtain it directly
|
// We obtain it directly
|
||||||
version = versions0[spec]
|
version = versions0[spec]
|
||||||
}
|
}
|
||||||
} else if (spec0 === 'latest') {
|
|
||||||
version = versions0[versions0.latest]
|
|
||||||
} else if (rangeMax !== null) {
|
} else if (rangeMax !== null) {
|
||||||
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
|
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
|
||||||
const thatVersion = spec
|
const thatVersion = spec
|
||||||
@@ -26482,12 +26572,28 @@ function getRunnerOSVersion() {
|
|||||||
ubuntu24: 'ubuntu-24.04',
|
ubuntu24: 'ubuntu-24.04',
|
||||||
win19: 'windows-2019',
|
win19: 'windows-2019',
|
||||||
win22: 'windows-2022',
|
win22: 'windows-2022',
|
||||||
|
win25: 'windows-2025',
|
||||||
macos13: 'macOS-13',
|
macos13: 'macOS-13',
|
||||||
macos14: 'macOS-14',
|
macos14: 'macOS-14',
|
||||||
macos15: 'macOS-15',
|
macos15: 'macOS-15',
|
||||||
}
|
}
|
||||||
|
const deprecatedImageOSToContainer = {
|
||||||
|
ubuntu18: 'ubuntu-18.04',
|
||||||
|
ubuntu20: 'ubuntu-20.04',
|
||||||
|
}
|
||||||
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
|
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
|
||||||
if (!containerFromEnvImageOS) {
|
if (!containerFromEnvImageOS) {
|
||||||
|
const deprecatedContainerFromEnvImageOS =
|
||||||
|
deprecatedImageOSToContainer[process.env.ImageOS]
|
||||||
|
if (deprecatedContainerFromEnvImageOS) {
|
||||||
|
core.warning(
|
||||||
|
`You are using deprecated ImageOS ${deprecatedContainerFromEnvImageOS}. ` +
|
||||||
|
'Support for maintenance is very limited. Consider a non-deprecated version as ' +
|
||||||
|
'mentioned in the README.md.',
|
||||||
|
)
|
||||||
|
|
||||||
|
return deprecatedContainerFromEnvImageOS
|
||||||
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Tried to map a target OS from env. variable 'ImageOS' (got " +
|
"Tried to map a target OS from env. variable 'ImageOS' (got " +
|
||||||
`${process.env.ImageOS}` +
|
`${process.env.ImageOS}` +
|
||||||
@@ -26498,6 +26604,7 @@ function getRunnerOSVersion() {
|
|||||||
"']",
|
"']",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return containerFromEnvImageOS
|
return containerFromEnvImageOS
|
||||||
}
|
}
|
||||||
@@ -26576,7 +26683,7 @@ function xyzAbcVersion(pref, suf) {
|
|||||||
// https://www.erlang.org/doc/system_principles/versions.html
|
// https://www.erlang.org/doc/system_principles/versions.html
|
||||||
const dd = '\\.?(\\d+)?'
|
const dd = '\\.?(\\d+)?'
|
||||||
return new RegExp(
|
return new RegExp(
|
||||||
`${pref}v?(\\d+)${dd}${dd}${dd}${dd}${dd}(?:-rc\\.?\\d+)?(?:-otp-\\d+)?${suf}`,
|
`${pref}(?:OTP-)?v?(\\d+)${dd}${dd}${dd}${dd}${dd}(?:-rc\\.?\\d+)?(?:-otp-\\d+)?${suf}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26625,7 +26732,7 @@ function parseVersionFile(versionFilePath0) {
|
|||||||
// For the time being we parse .tool-versions
|
// For the time being we parse .tool-versions
|
||||||
// If we ever start parsing something else, this should
|
// If we ever start parsing something else, this should
|
||||||
// become default in a new option named e.g. version-file-type
|
// become default in a new option named e.g. version-file-type
|
||||||
versions.split('\n').forEach((line) => {
|
versions.split(/\r?\n/).forEach((line) => {
|
||||||
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
|
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
|
||||||
if (appVersion) {
|
if (appVersion) {
|
||||||
const app = appVersion[1]
|
const app = appVersion[1]
|
||||||
@@ -27046,14 +27153,18 @@ function debugLoggingEnabled() {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
get,
|
get,
|
||||||
getOTPVersion,
|
|
||||||
getElixirVersion,
|
getElixirVersion,
|
||||||
getGleamVersion,
|
getGleamVersion,
|
||||||
|
getOTPVersion,
|
||||||
getRebar3Version,
|
getRebar3Version,
|
||||||
getVersionFromSpec,
|
getVersionFromSpec,
|
||||||
githubAMDRunnerArchs,
|
githubAMDRunnerArchs,
|
||||||
githubARMRunnerArchs,
|
githubARMRunnerArchs,
|
||||||
install,
|
install,
|
||||||
|
installOTP,
|
||||||
|
maybeInstallElixir,
|
||||||
|
maybeInstallGleam,
|
||||||
|
maybeInstallRebar3,
|
||||||
parseVersionFile,
|
parseVersionFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27465,7 +27576,7 @@ const normalize_options = function (opts) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Normalize option `columns`
|
// Normalize option `columns`
|
||||||
options.cast_first_line_to_header = null;
|
options.cast_first_line_to_header = undefined;
|
||||||
if (options.columns === true) {
|
if (options.columns === true) {
|
||||||
// Fields in the first line are converted as-is to columns
|
// Fields in the first line are converted as-is to columns
|
||||||
options.cast_first_line_to_header = undefined;
|
options.cast_first_line_to_header = undefined;
|
||||||
@@ -27997,7 +28108,7 @@ const normalize_options = function (opts) {
|
|||||||
// Normalize option `to`
|
// Normalize option `to`
|
||||||
if (options.to === undefined || options.to === null) {
|
if (options.to === undefined || options.to === null) {
|
||||||
options.to = -1;
|
options.to = -1;
|
||||||
} else {
|
} else if (options.to !== -1) {
|
||||||
if (typeof options.to === "string" && /\d+/.test(options.to)) {
|
if (typeof options.to === "string" && /\d+/.test(options.to)) {
|
||||||
options.to = parseInt(options.to);
|
options.to = parseInt(options.to);
|
||||||
}
|
}
|
||||||
@@ -28016,7 +28127,7 @@ const normalize_options = function (opts) {
|
|||||||
// Normalize option `to_line`
|
// Normalize option `to_line`
|
||||||
if (options.to_line === undefined || options.to_line === null) {
|
if (options.to_line === undefined || options.to_line === null) {
|
||||||
options.to_line = -1;
|
options.to_line = -1;
|
||||||
} else {
|
} else if (options.to_line !== -1) {
|
||||||
if (typeof options.to_line === "string" && /\d+/.test(options.to_line)) {
|
if (typeof options.to_line === "string" && /\d+/.test(options.to_line)) {
|
||||||
options.to_line = parseInt(options.to_line);
|
options.to_line = parseInt(options.to_line);
|
||||||
}
|
}
|
||||||
@@ -28147,10 +28258,14 @@ const transform = function (original_options = {}) {
|
|||||||
this.state.bufBytesStart += bomLength;
|
this.state.bufBytesStart += bomLength;
|
||||||
buf = buf.slice(bomLength);
|
buf = buf.slice(bomLength);
|
||||||
// Renormalize original options with the new encoding
|
// Renormalize original options with the new encoding
|
||||||
this.options = normalize_options({
|
const options = normalize_options({
|
||||||
...this.original_options,
|
...this.original_options,
|
||||||
encoding: encoding,
|
encoding: encoding,
|
||||||
});
|
});
|
||||||
|
// Properties are merged with the existing options instance
|
||||||
|
for (const key in options) {
|
||||||
|
this.options[key] = options[key];
|
||||||
|
}
|
||||||
// Options will re-evaluate the Buffer with the new encoding
|
// Options will re-evaluate the Buffer with the new encoding
|
||||||
({ comment, escape, quote } = this.options);
|
({ comment, escape, quote } = this.options);
|
||||||
break;
|
break;
|
||||||
@@ -28893,10 +29008,14 @@ const transform = function (original_options = {}) {
|
|||||||
if (skip_records_with_error) {
|
if (skip_records_with_error) {
|
||||||
this.state.recordHasError = true;
|
this.state.recordHasError = true;
|
||||||
if (this.options.on_skip !== undefined) {
|
if (this.options.on_skip !== undefined) {
|
||||||
|
try {
|
||||||
this.options.on_skip(
|
this.options.on_skip(
|
||||||
err,
|
err,
|
||||||
raw ? this.state.rawBuffer.toString(encoding) : undefined,
|
raw ? this.state.rawBuffer.toString(encoding) : undefined,
|
||||||
);
|
);
|
||||||
|
} catch (err) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// this.emit('skip', err, raw ? this.state.rawBuffer.toString(encoding) : undefined);
|
// this.emit('skip', err, raw ? this.state.rawBuffer.toString(encoding) : undefined);
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -28950,10 +29069,13 @@ const parse = function (data, opts = {}) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const close = () => {};
|
const close = () => {};
|
||||||
const err1 = parser.parse(data, false, push, close);
|
const error = parser.parse(data, true, push, close);
|
||||||
if (err1 !== undefined) throw err1;
|
if (error !== undefined) throw error;
|
||||||
const err2 = parser.parse(undefined, true, push, close);
|
// 250606: `parser.parse` was implemented as 2 calls:
|
||||||
if (err2 !== undefined) throw err2;
|
// const err1 = parser.parse(data, false, push, close);
|
||||||
|
// if (err1 !== undefined) throw err1;
|
||||||
|
// const err2 = parser.parse(undefined, true, push, close);
|
||||||
|
// if (err2 !== undefined) throw err2;
|
||||||
return records;
|
return records;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Generated
+543
-512
File diff suppressed because it is too large
Load Diff
+10
-10
@@ -19,19 +19,19 @@
|
|||||||
"@actions/core": "1.11.1",
|
"@actions/core": "1.11.1",
|
||||||
"@actions/exec": "1.1.1",
|
"@actions/exec": "1.1.1",
|
||||||
"@actions/tool-cache": "2.0.2",
|
"@actions/tool-cache": "2.0.2",
|
||||||
"csv-parse": "5.6.0",
|
"csv-parse": "6.1.0",
|
||||||
"semver": "7.7.2",
|
"lodash": "4.17.23",
|
||||||
"lodash": "4.17.21"
|
"semver": "7.7.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vercel/ncc": "0.38.3",
|
"@eslint/js": "9.38.0",
|
||||||
"eslint": "9.29.0",
|
"@vercel/ncc": "0.38.4",
|
||||||
"@eslint/js": "9.29.0",
|
"eslint": "9.38.0",
|
||||||
"globals": "16.2.0",
|
|
||||||
"markdownlint-cli": "0.45.0",
|
|
||||||
"prettier": "3.6.0",
|
|
||||||
"shellcheck": "3.1.0",
|
|
||||||
"eslint-plugin-yml": "1.18.0",
|
"eslint-plugin-yml": "1.18.0",
|
||||||
|
"globals": "17.3.0",
|
||||||
|
"markdownlint-cli": "0.47.0",
|
||||||
|
"prettier": "3.6.2",
|
||||||
|
"shellcheck": "4.1.0",
|
||||||
"yarn": "1.22.22"
|
"yarn": "1.22.22"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
+120
-48
@@ -10,9 +10,11 @@ const _ = require('lodash')
|
|||||||
|
|
||||||
const MAX_HTTP_RETRIES = 3
|
const MAX_HTTP_RETRIES = 3
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== 'test') {
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
core.setFailed(err.message)
|
core.setFailed(err.message)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
checkOtpArchitecture()
|
checkOtpArchitecture()
|
||||||
@@ -28,15 +30,14 @@ async function main() {
|
|||||||
versions = parseVersionFile(versionFilePath)
|
versions = parseVersionFile(versionFilePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
const osVersion = getRunnerOSVersion()
|
|
||||||
const otpSpec = getInput('otp-version', true, 'erlang', versions)
|
const otpSpec = getInput('otp-version', true, 'erlang', versions)
|
||||||
const elixirSpec = getInput('elixir-version', false, 'elixir', versions)
|
const elixirSpec = getInput('elixir-version', false, 'elixir', versions)
|
||||||
const gleamSpec = getInput('gleam-version', false, 'gleam', versions)
|
const gleamSpec = getInput('gleam-version', false, 'gleam', versions)
|
||||||
const rebar3Spec = getInput('rebar3-version', false, 'rebar', versions)
|
const rebar3Spec = getInput('rebar3-version', false, 'rebar', versions)
|
||||||
|
|
||||||
if (otpSpec !== 'false') {
|
if (otpSpec !== 'false') {
|
||||||
await installOTP(otpSpec, osVersion)
|
await installOTP(otpSpec)
|
||||||
const elixirInstalled = await maybeInstallElixir(elixirSpec, otpSpec)
|
const elixirInstalled = await maybeInstallElixir(elixirSpec)
|
||||||
if (elixirInstalled === true) {
|
if (elixirInstalled === true) {
|
||||||
const shouldMixRebar = getInput('install-rebar', false)
|
const shouldMixRebar = getInput('install-rebar', false)
|
||||||
await mix(shouldMixRebar, 'rebar')
|
await mix(shouldMixRebar, 'rebar')
|
||||||
@@ -52,11 +53,12 @@ async function main() {
|
|||||||
await maybeInstallRebar3(rebar3Spec)
|
await maybeInstallRebar3(rebar3Spec)
|
||||||
|
|
||||||
// undefined is replaced by a function, post- main branch merge
|
// undefined is replaced by a function, post- main branch merge
|
||||||
const setupBeamVersion = 'abd725c'
|
const setupBeamVersion = 'fe5485f'
|
||||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function installOTP(otpSpec, osVersion) {
|
async function installOTP(otpSpec) {
|
||||||
|
const osVersion = getRunnerOSVersion()
|
||||||
const otpVersion = await getOTPVersion(otpSpec, osVersion)
|
const otpVersion = await getOTPVersion(otpSpec, osVersion)
|
||||||
core.startGroup(
|
core.startGroup(
|
||||||
`Installing Erlang/OTP ${otpVersion} - built on ${getRunnerOSArchitecture()}/${osVersion}`,
|
`Installing Erlang/OTP ${otpVersion} - built on ${getRunnerOSArchitecture()}/${osVersion}`,
|
||||||
@@ -78,10 +80,10 @@ async function installOTP(otpSpec, osVersion) {
|
|||||||
return otpVersion
|
return otpVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
async function maybeInstallElixir(elixirSpec, otpSpec) {
|
async function maybeInstallElixir(elixirSpec) {
|
||||||
let installed = false
|
let installed = false
|
||||||
if (elixirSpec) {
|
if (elixirSpec) {
|
||||||
const elixirVersion = await getElixirVersion(elixirSpec, otpSpec)
|
const elixirVersion = await getElixirVersion(elixirSpec)
|
||||||
core.startGroup(`Installing Elixir ${elixirVersion}`)
|
core.startGroup(`Installing Elixir ${elixirVersion}`)
|
||||||
await doWithMirrors({
|
await doWithMirrors({
|
||||||
hexMirrors: hexMirrorsInput(),
|
hexMirrors: hexMirrorsInput(),
|
||||||
@@ -168,10 +170,14 @@ async function maybeInstallRebar3(rebar3Spec) {
|
|||||||
return installed
|
return installed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function maybeRemoveOTPPrefix(otpSpec) {
|
||||||
|
return otpSpec.replace(/^OTP-/, '')
|
||||||
|
}
|
||||||
|
|
||||||
async function getOTPVersion(otpSpec0, osVersion) {
|
async function getOTPVersion(otpSpec0, osVersion) {
|
||||||
const [otpVersions, originListing, hexMirrors] =
|
const [otpVersions, originListing, hexMirrors] =
|
||||||
await getOTPVersions(osVersion)
|
await getOTPVersions(osVersion)
|
||||||
let spec = otpSpec0.replace(/^OTP-/, '')
|
let spec = maybeRemoveOTPPrefix(otpSpec0)
|
||||||
const versions = otpVersions
|
const versions = otpVersions
|
||||||
const otpVersion = getVersionFromSpec(spec, versions)
|
const otpVersion = getVersionFromSpec(spec, versions)
|
||||||
|
|
||||||
@@ -185,26 +191,50 @@ async function getOTPVersion(otpSpec0, osVersion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function requestedVersionFor(tool, version, originListing, mirrors) {
|
function requestedVersionFor(tool, version, originListing, mirrors) {
|
||||||
return (
|
const isStrictVersion = isStrictVersion()
|
||||||
`Requested ${tool} version (${version}) not found in version list, ` +
|
|
||||||
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}; ` +
|
let versionType = 'loose'
|
||||||
"should you be using option 'version-type': 'strict'?"
|
if (isStrictVersion) {
|
||||||
)
|
versionType = 'strict'
|
||||||
|
}
|
||||||
|
|
||||||
|
let ret =
|
||||||
|
`Requested ${versionType} ${tool} version (${version}) not found in version list, ` +
|
||||||
|
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.`
|
||||||
|
if (!isStrictVersion) {
|
||||||
|
ret = `${ret} Should you be using option 'version-type': 'strict'?`
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
const knownBranches = ['main', 'master', 'maint']
|
const knownBranches = ['main', 'master', 'maint']
|
||||||
const nonSpecificVersions = ['nightly', 'latest']
|
const nonSpecificVersions = ['nightly', 'latest']
|
||||||
|
|
||||||
async function getElixirVersion(exSpec0, otpVersion0) {
|
async function getElixirVersion(exSpec0) {
|
||||||
const otpVersion = otpVersion0.match(/^(?:OTP-)?(.+)$/)[1]
|
|
||||||
const regex = `^(\\d{1,3}|${knownBranches.join('|')}|${nonSpecificVersions.join('|')})?.*$`
|
|
||||||
let otpVersionMajor = otpVersion.match(new RegExp(regex))[1]
|
|
||||||
|
|
||||||
const otpSuffix = /-otp-(\d+)/
|
const otpSuffix = /-otp-(\d+)/
|
||||||
const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null
|
const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null
|
||||||
|
let otpVersionMajor = ''
|
||||||
|
|
||||||
if (userSuppliedOtp && isVersion(userSuppliedOtp)) {
|
if (userSuppliedOtp && isVersion(userSuppliedOtp)) {
|
||||||
otpVersionMajor = userSuppliedOtp
|
otpVersionMajor = userSuppliedOtp
|
||||||
|
} else {
|
||||||
|
let cmd = 'erl'
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
cmd = 'erl.exe'
|
||||||
|
}
|
||||||
|
const args = [
|
||||||
|
'-noshell',
|
||||||
|
'-eval',
|
||||||
|
'io:format(erlang:system_info(otp_release)), halt().',
|
||||||
|
]
|
||||||
|
await exec(cmd, args, {
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => {
|
||||||
|
otpVersionMajor = data.toString()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] =
|
const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] =
|
||||||
@@ -219,17 +249,29 @@ async function getElixirVersion(exSpec0, otpVersion0) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let foundCombo = false
|
||||||
|
let otpVersionMajorIter = parseInt(otpVersionMajor)
|
||||||
|
let otpVersionsMajor = []
|
||||||
|
while (otpVersionMajorIter > otpVersionMajor - 3) {
|
||||||
|
otpVersionMajorIter += ''
|
||||||
|
otpVersionsMajor.push(otpVersionMajorIter)
|
||||||
const elixirVersionComp = otpVersionsForElixirMap[elixirVersionFromSpec]
|
const elixirVersionComp = otpVersionsForElixirMap[elixirVersionFromSpec]
|
||||||
if (
|
if (
|
||||||
(elixirVersionComp && elixirVersionComp.includes(otpVersionMajor)) ||
|
(elixirVersionComp && elixirVersionComp.includes(otpVersionMajorIter)) ||
|
||||||
!isVersion(otpVersionMajor)
|
!isVersion(otpVersionMajorIter)
|
||||||
) {
|
) {
|
||||||
core.info(
|
core.info(
|
||||||
`Using Elixir ${elixirVersionFromSpec} (built for Erlang/OTP ${otpVersionMajor})`,
|
`Using Elixir ${elixirVersionFromSpec} (built for Erlang/OTP ${otpVersionMajorIter})`,
|
||||||
)
|
)
|
||||||
} else {
|
foundCombo = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
otpVersionMajorIter = parseInt(otpVersionMajorIter) - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundCombo) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion0}) not ` +
|
`Requested Elixir / Erlang/OTP version (${exSpec0} / tried ${otpVersionsMajor}) not ` +
|
||||||
'found in version list (did you check Compatibility between Elixir and Erlang/OTP?).' +
|
'found in version list (did you check Compatibility between Elixir and Erlang/OTP?).' +
|
||||||
'Elixir and Erlang/OTP compatibility can be found at: ' +
|
'Elixir and Erlang/OTP compatibility can be found at: ' +
|
||||||
'https://hexdocs.pm/elixir/compatibility-and-deprecations.html',
|
'https://hexdocs.pm/elixir/compatibility-and-deprecations.html',
|
||||||
@@ -238,8 +280,8 @@ async function getElixirVersion(exSpec0, otpVersion0) {
|
|||||||
|
|
||||||
let elixirVersionForDownload = elixirVersionFromSpec
|
let elixirVersionForDownload = elixirVersionFromSpec
|
||||||
|
|
||||||
if (isVersion(otpVersionMajor)) {
|
if (isVersion(otpVersionMajorIter)) {
|
||||||
elixirVersionForDownload = `${elixirVersionFromSpec}-otp-${otpVersionMajor}`
|
elixirVersionForDownload = `${elixirVersionFromSpec}-otp-${otpVersionMajorIter}`
|
||||||
}
|
}
|
||||||
|
|
||||||
return maybePrependWithV(elixirVersionForDownload)
|
return maybePrependWithV(elixirVersionForDownload)
|
||||||
@@ -321,12 +363,9 @@ async function getOTPVersions(osVersion) {
|
|||||||
.trim()
|
.trim()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
const otpMatch = line
|
const otpVersionOrig = line.match(/^([^ ]+)?( .+)/)[1]
|
||||||
.match(/^([^ ]+)?( .+)/)[1]
|
const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig)
|
||||||
.match(/^([^-]+-)?(.+)$/)
|
debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig])
|
||||||
const otpVersion = otpMatch[2]
|
|
||||||
const otpVersionOrig = otpMatch[0]
|
|
||||||
debugLog('OTP line and parsing', [line, otpVersion, otpMatch])
|
|
||||||
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
||||||
})
|
})
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32') {
|
||||||
@@ -340,10 +379,10 @@ async function getOTPVersions(osVersion) {
|
|||||||
.flat()
|
.flat()
|
||||||
.filter((x) => x.name.match(file_regex))
|
.filter((x) => x.name.match(file_regex))
|
||||||
.forEach((x) => {
|
.forEach((x) => {
|
||||||
const otpMatch = x.name.match(file_regex)
|
const otpVersionOrig = x.name.match(file_regex)[1]
|
||||||
const otpVersion = otpMatch[1]
|
const otpVersion = otpVersionOrig
|
||||||
debugLog('OTP line and parsing', [otpMatch, otpVersion])
|
debugLog('OTP line and parsing', [x.name, otpVersion, otpVersionOrig])
|
||||||
otpVersions[otpVersion] = otpVersion
|
otpVersions[otpVersion] = otpVersionOrig
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (process.platform === 'darwin') {
|
} else if (process.platform === 'darwin') {
|
||||||
@@ -352,10 +391,9 @@ async function getOTPVersions(osVersion) {
|
|||||||
columns: true,
|
columns: true,
|
||||||
})
|
})
|
||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
const otpMatch = line.ref_name.match(/^([^-]+-)?(.+)$/)
|
const otpVersionOrig = line.ref_name
|
||||||
const otpVersion = otpMatch[2]
|
const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig)
|
||||||
const otpVersionOrig = otpMatch[0]
|
debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig])
|
||||||
debugLog('OTP line and parsing', [line, otpVersion, otpMatch])
|
|
||||||
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -448,6 +486,7 @@ function validVersion(v) {
|
|||||||
v.match(
|
v.match(
|
||||||
new RegExp(`${knownBranches.join('|')}|${nonSpecificVersions.join('|')}`),
|
new RegExp(`${knownBranches.join('|')}|${nonSpecificVersions.join('|')}`),
|
||||||
) == null &&
|
) == null &&
|
||||||
|
// these ones are for rebar3, which has alpha and beta releases
|
||||||
!v.startsWith('a') &&
|
!v.startsWith('a') &&
|
||||||
!v.startsWith('b')
|
!v.startsWith('b')
|
||||||
)
|
)
|
||||||
@@ -474,8 +513,14 @@ function getVersionFromSpec(spec0, versions0) {
|
|||||||
const altVersions = {}
|
const altVersions = {}
|
||||||
Object.entries(versions0).forEach(([version, altVersion]) => {
|
Object.entries(versions0).forEach(([version, altVersion]) => {
|
||||||
let coerced
|
let coerced
|
||||||
if (isStrictVersion() || isRC(version)) {
|
if (
|
||||||
// If `version-type: strict` or version is RC, we just try to remove a potential initial v
|
isStrictVersion() ||
|
||||||
|
isRC(version) ||
|
||||||
|
isKnownBranch(version) ||
|
||||||
|
isKnownVerBranch(version)
|
||||||
|
) {
|
||||||
|
// If `version-type: strict`, version is an RC, or version is "a branch"
|
||||||
|
// we just try to remove a potential initial v
|
||||||
coerced = maybeRemoveVPrefix(version)
|
coerced = maybeRemoveVPrefix(version)
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, we place the version into a version bucket
|
// Otherwise, we place the version into a version bucket
|
||||||
@@ -492,13 +537,19 @@ function getVersionFromSpec(spec0, versions0) {
|
|||||||
const rangeMax = semver.maxSatisfying(versions, rangeForMax)
|
const rangeMax = semver.maxSatisfying(versions, rangeForMax)
|
||||||
let version = null
|
let version = null
|
||||||
|
|
||||||
if (isStrictVersion() || isRC(spec0) || isKnownBranch(spec0)) {
|
if (spec0 === 'latest') {
|
||||||
|
version = versions0[versions0.latest]
|
||||||
|
} else if (
|
||||||
|
isStrictVersion() ||
|
||||||
|
isRC(spec0) ||
|
||||||
|
isKnownBranch(spec0) ||
|
||||||
|
isKnownVerBranch(spec0) ||
|
||||||
|
spec0 === 'nightly'
|
||||||
|
) {
|
||||||
if (versions0[spec]) {
|
if (versions0[spec]) {
|
||||||
// If `version-type: strict` or version is RC, we obtain it directly
|
// We obtain it directly
|
||||||
version = versions0[spec]
|
version = versions0[spec]
|
||||||
}
|
}
|
||||||
} else if (spec0 === 'latest') {
|
|
||||||
version = versions0[versions0.latest]
|
|
||||||
} else if (rangeMax !== null) {
|
} else if (rangeMax !== null) {
|
||||||
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
|
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
|
||||||
const thatVersion = spec
|
const thatVersion = spec
|
||||||
@@ -607,12 +658,28 @@ function getRunnerOSVersion() {
|
|||||||
ubuntu24: 'ubuntu-24.04',
|
ubuntu24: 'ubuntu-24.04',
|
||||||
win19: 'windows-2019',
|
win19: 'windows-2019',
|
||||||
win22: 'windows-2022',
|
win22: 'windows-2022',
|
||||||
|
win25: 'windows-2025',
|
||||||
macos13: 'macOS-13',
|
macos13: 'macOS-13',
|
||||||
macos14: 'macOS-14',
|
macos14: 'macOS-14',
|
||||||
macos15: 'macOS-15',
|
macos15: 'macOS-15',
|
||||||
}
|
}
|
||||||
|
const deprecatedImageOSToContainer = {
|
||||||
|
ubuntu18: 'ubuntu-18.04',
|
||||||
|
ubuntu20: 'ubuntu-20.04',
|
||||||
|
}
|
||||||
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
|
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
|
||||||
if (!containerFromEnvImageOS) {
|
if (!containerFromEnvImageOS) {
|
||||||
|
const deprecatedContainerFromEnvImageOS =
|
||||||
|
deprecatedImageOSToContainer[process.env.ImageOS]
|
||||||
|
if (deprecatedContainerFromEnvImageOS) {
|
||||||
|
core.warning(
|
||||||
|
`You are using deprecated ImageOS ${deprecatedContainerFromEnvImageOS}. ` +
|
||||||
|
'Support for maintenance is very limited. Consider a non-deprecated version as ' +
|
||||||
|
'mentioned in the README.md.',
|
||||||
|
)
|
||||||
|
|
||||||
|
return deprecatedContainerFromEnvImageOS
|
||||||
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Tried to map a target OS from env. variable 'ImageOS' (got " +
|
"Tried to map a target OS from env. variable 'ImageOS' (got " +
|
||||||
`${process.env.ImageOS}` +
|
`${process.env.ImageOS}` +
|
||||||
@@ -623,6 +690,7 @@ function getRunnerOSVersion() {
|
|||||||
"']",
|
"']",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return containerFromEnvImageOS
|
return containerFromEnvImageOS
|
||||||
}
|
}
|
||||||
@@ -701,7 +769,7 @@ function xyzAbcVersion(pref, suf) {
|
|||||||
// https://www.erlang.org/doc/system_principles/versions.html
|
// https://www.erlang.org/doc/system_principles/versions.html
|
||||||
const dd = '\\.?(\\d+)?'
|
const dd = '\\.?(\\d+)?'
|
||||||
return new RegExp(
|
return new RegExp(
|
||||||
`${pref}v?(\\d+)${dd}${dd}${dd}${dd}${dd}(?:-rc\\.?\\d+)?(?:-otp-\\d+)?${suf}`,
|
`${pref}(?:OTP-)?v?(\\d+)${dd}${dd}${dd}${dd}${dd}(?:-rc\\.?\\d+)?(?:-otp-\\d+)?${suf}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -750,7 +818,7 @@ function parseVersionFile(versionFilePath0) {
|
|||||||
// For the time being we parse .tool-versions
|
// For the time being we parse .tool-versions
|
||||||
// If we ever start parsing something else, this should
|
// If we ever start parsing something else, this should
|
||||||
// become default in a new option named e.g. version-file-type
|
// become default in a new option named e.g. version-file-type
|
||||||
versions.split('\n').forEach((line) => {
|
versions.split(/\r?\n/).forEach((line) => {
|
||||||
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
|
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
|
||||||
if (appVersion) {
|
if (appVersion) {
|
||||||
const app = appVersion[1]
|
const app = appVersion[1]
|
||||||
@@ -1171,13 +1239,17 @@ function debugLoggingEnabled() {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
get,
|
get,
|
||||||
getOTPVersion,
|
|
||||||
getElixirVersion,
|
getElixirVersion,
|
||||||
getGleamVersion,
|
getGleamVersion,
|
||||||
|
getOTPVersion,
|
||||||
getRebar3Version,
|
getRebar3Version,
|
||||||
getVersionFromSpec,
|
getVersionFromSpec,
|
||||||
githubAMDRunnerArchs,
|
githubAMDRunnerArchs,
|
||||||
githubARMRunnerArchs,
|
githubARMRunnerArchs,
|
||||||
install,
|
install,
|
||||||
|
installOTP,
|
||||||
|
maybeInstallElixir,
|
||||||
|
maybeInstallGleam,
|
||||||
|
maybeInstallRebar3,
|
||||||
parseVersionFile,
|
parseVersionFile,
|
||||||
}
|
}
|
||||||
|
|||||||
+124
-75
@@ -1,3 +1,5 @@
|
|||||||
|
process.env.NODE_ENV = 'test'
|
||||||
|
|
||||||
simulateInput('otp-version', '25.1.2')
|
simulateInput('otp-version', '25.1.2')
|
||||||
simulateInput('otp-architecture', '64')
|
simulateInput('otp-architecture', '64')
|
||||||
simulateInput('elixir-version', '1.14.2')
|
simulateInput('elixir-version', '1.14.2')
|
||||||
@@ -75,7 +77,7 @@ describe('OTP install', () => {
|
|||||||
const otpOSVersion = 'ubuntu-08.04'
|
const otpOSVersion = 'ubuntu-08.04'
|
||||||
const otpVersion = 'OTP-23.2'
|
const otpVersion = 'OTP-23.2'
|
||||||
|
|
||||||
assert.rejects(
|
await assert.rejects(
|
||||||
async () => {
|
async () => {
|
||||||
await setupBeam.install('otp', {
|
await setupBeam.install('otp', {
|
||||||
hexMirror: 'https://builds.hex.pm',
|
hexMirror: 'https://builds.hex.pm',
|
||||||
@@ -95,7 +97,7 @@ describe('OTP install', () => {
|
|||||||
describe('Elixir install', () => {
|
describe('Elixir install', () => {
|
||||||
it('fails for version 0.11 without OTP', async () => {
|
it('fails for version 0.11 without OTP', async () => {
|
||||||
const exVersion = '0.11'
|
const exVersion = '0.11'
|
||||||
assert.rejects(
|
await assert.rejects(
|
||||||
async () => {
|
async () => {
|
||||||
await setupBeam.install('elixir', {
|
await setupBeam.install('elixir', {
|
||||||
hexMirror: 'https://builds.hex.pm',
|
hexMirror: 'https://builds.hex.pm',
|
||||||
@@ -112,7 +114,7 @@ describe('Elixir install', () => {
|
|||||||
|
|
||||||
it('fails for version 1.0.0 on OTP 17 (without OTP)', async () => {
|
it('fails for version 1.0.0 on OTP 17 (without OTP)', async () => {
|
||||||
const exVersion = 'v1.0.0-otp-17'
|
const exVersion = 'v1.0.0-otp-17'
|
||||||
assert.rejects(
|
await assert.rejects(
|
||||||
async () => {
|
async () => {
|
||||||
await setupBeam.install('elixir', {
|
await setupBeam.install('elixir', {
|
||||||
hexMirror: 'https://builds.hex.pm',
|
hexMirror: 'https://builds.hex.pm',
|
||||||
@@ -131,7 +133,7 @@ describe('Elixir install', () => {
|
|||||||
describe('Gleam install', () => {
|
describe('Gleam install', () => {
|
||||||
it('fails for unknown OTP', async () => {
|
it('fails for unknown OTP', async () => {
|
||||||
const gleamVersion = '0.1.3'
|
const gleamVersion = '0.1.3'
|
||||||
assert.rejects(
|
await assert.rejects(
|
||||||
async () => {
|
async () => {
|
||||||
await setupBeam.install('gleam', { gleamVersion })
|
await setupBeam.install('gleam', { gleamVersion })
|
||||||
},
|
},
|
||||||
@@ -147,7 +149,7 @@ describe('Gleam install', () => {
|
|||||||
describe('rebar3 install', () => {
|
describe('rebar3 install', () => {
|
||||||
it('fails for unknown OTP', async () => {
|
it('fails for unknown OTP', async () => {
|
||||||
const r3Version = '0.14.4'
|
const r3Version = '0.14.4'
|
||||||
assert.rejects(
|
await assert.rejects(
|
||||||
async () => {
|
async () => {
|
||||||
await setupBeam.install('rebar3', { r3Version })
|
await setupBeam.install('rebar3', { r3Version })
|
||||||
},
|
},
|
||||||
@@ -177,14 +179,6 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
process.env.RUNNER_ARCH = 'X64'
|
process.env.RUNNER_ARCH = 'X64'
|
||||||
|
|
||||||
it('is Ok for known linux version', async () => {
|
it('is Ok for known linux version', async () => {
|
||||||
before = simulateInput('version-type', 'strict')
|
|
||||||
spec = '26'
|
|
||||||
osVersion = 'ubuntu-24.04'
|
|
||||||
expected = 'maint-26'
|
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
|
||||||
assert.deepStrictEqual(got, expected)
|
|
||||||
simulateInput('version-type', before)
|
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = '27.0'
|
spec = '27.0'
|
||||||
osVersion = 'ubuntu-24.04'
|
osVersion = 'ubuntu-24.04'
|
||||||
@@ -309,19 +303,46 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
it('is Ok for known linux ARM64 version', async () => {
|
it('is main-... only if strict/maint-... is used as input', async () => {
|
||||||
const arm64Options = setupBeam.githubARMRunnerArchs()
|
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = '26'
|
await assert.rejects(
|
||||||
osVersion = 'ubuntu-24.04'
|
async () => {
|
||||||
expected = 'maint-26'
|
await setupBeam.getOTPVersion('27', 'ubuntu-24.04')
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
},
|
||||||
assert.deepStrictEqual(got, expected)
|
(err) => {
|
||||||
|
assert.ok(err instanceof Error)
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
`Fetching strict OTP version maint-<v> with input <v> is supposed to fail`,
|
||||||
|
)
|
||||||
simulateInput('version-type', before)
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
|
before = simulateInput('version-type', 'strict')
|
||||||
|
assert.strictEqual(
|
||||||
|
await setupBeam.getOTPVersion('maint-27', 'ubuntu-24.04'),
|
||||||
|
'maint-27',
|
||||||
|
)
|
||||||
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
|
before = simulateInput('version-type', 'loose')
|
||||||
|
assert.strictEqual(
|
||||||
|
await setupBeam.getOTPVersion('maint-27', 'ubuntu-24.04'),
|
||||||
|
'maint-27',
|
||||||
|
)
|
||||||
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
|
process.env.RUNNER_ARCH = previousRunnerArch
|
||||||
|
})
|
||||||
|
|
||||||
|
it('is Ok for known linux ARM64 version', async () => {
|
||||||
|
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||||
|
process.env.RUNNER_ARCH =
|
||||||
|
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = '27.0'
|
spec = '27.0'
|
||||||
osVersion = 'ubuntu-24.04'
|
osVersion = 'ubuntu-24.04'
|
||||||
@@ -386,14 +407,6 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
amd64Options[Math.floor(Math.random() * amd64Options.length)]
|
amd64Options[Math.floor(Math.random() * amd64Options.length)]
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
|
||||||
spec = '26'
|
|
||||||
osVersion = 'ubuntu-24.04'
|
|
||||||
expected = 'maint-26'
|
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
|
||||||
assert.deepStrictEqual(got, expected)
|
|
||||||
simulateInput('version-type', before)
|
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = '27.0'
|
spec = '27.0'
|
||||||
osVersion = 'ubuntu-24.04'
|
osVersion = 'ubuntu-24.04'
|
||||||
@@ -473,6 +486,35 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
|
it('is main-... only if strict/maint-... is used as input', async () => {
|
||||||
|
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||||
|
process.env.RUNNER_ARCH =
|
||||||
|
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||||
|
|
||||||
|
before = simulateInput('version-type', 'strict')
|
||||||
|
await assert.rejects(
|
||||||
|
async () => {
|
||||||
|
await setupBeam.getOTPVersion('27')
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
assert.ok(err instanceof Error)
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
`Fetching strict OTP version maint-<v> with input <v> is supposed to fail`,
|
||||||
|
)
|
||||||
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
|
before = simulateInput('version-type', 'strict')
|
||||||
|
assert.strictEqual(await setupBeam.getOTPVersion('maint-27'), 'maint-27')
|
||||||
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
|
before = simulateInput('version-type', 'loose')
|
||||||
|
assert.strictEqual(await setupBeam.getOTPVersion('maint-27'), 'maint-27')
|
||||||
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
|
process.env.RUNNER_ARCH = previousRunnerArch
|
||||||
|
})
|
||||||
|
|
||||||
it('is Ok for known macos ARM64 version', async () => {
|
it('is Ok for known macos ARM64 version', async () => {
|
||||||
const arm64Options = setupBeam.githubARMRunnerArchs()
|
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
@@ -515,7 +557,7 @@ describe('OTP arch-specific install', () => {
|
|||||||
const spec = '26'
|
const spec = '26'
|
||||||
const osVersion = 'ubuntu-24.04'
|
const osVersion = 'ubuntu-24.04'
|
||||||
|
|
||||||
assert.rejects(
|
await assert.rejects(
|
||||||
async () => {
|
async () => {
|
||||||
await setupBeam.getOTPVersion(spec, osVersion)
|
await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
},
|
},
|
||||||
@@ -536,77 +578,70 @@ describe('.getOTPVersion(_) - Elixir', () => {
|
|||||||
let spec
|
let spec
|
||||||
let otpVersion
|
let otpVersion
|
||||||
let before
|
let before
|
||||||
const hexMirrors = simulateInput('hexpm-mirrors', 'https://repo.hex.pm', {
|
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||||
multiline: true,
|
|
||||||
})
|
if (process.platform === 'linux') {
|
||||||
|
process.env.RUNNER_ARCH = 'X64'
|
||||||
|
|
||||||
it('returns the expected value', async () => {
|
it('returns the expected value', async () => {
|
||||||
spec = '1.1.x'
|
spec = '1.18.x'
|
||||||
otpVersion = 'OTP-17'
|
otpVersion = 'OTP-27'
|
||||||
expected = 'v1.1.1-otp-17'
|
expected = 'v1.18.4-otp-27'
|
||||||
|
await setupBeam.installOTP(otpVersion)
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '1.10.4'
|
spec = '1.18.2'
|
||||||
otpVersion = 'OTP-23'
|
otpVersion = 'OTP-27'
|
||||||
expected = 'v1.10.4-otp-23'
|
expected = 'v1.18.2-otp-27'
|
||||||
|
await setupBeam.installOTP(otpVersion)
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '1.16.2-otp-26'
|
spec = '1.16.2-otp-26'
|
||||||
otpVersion = 'OTP-27'
|
otpVersion = 'OTP-27'
|
||||||
expected = 'v1.16.2-otp-26'
|
expected = 'v1.16.2-otp-26'
|
||||||
|
await setupBeam.installOTP(otpVersion)
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '1.12.1'
|
spec = '1.12.1'
|
||||||
otpVersion = 'OTP-24.0.2'
|
otpVersion = 'OTP-24.3.4'
|
||||||
expected = 'v1.12.1-otp-24'
|
expected = 'v1.12.1-otp-24'
|
||||||
|
await setupBeam.installOTP(otpVersion)
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = '1.14.0'
|
spec = '1.17'
|
||||||
otpVersion = 'main'
|
otpVersion = 'master'
|
||||||
expected = 'v1.14.0'
|
expected = 'v1.17-otp-27'
|
||||||
|
await setupBeam.installOTP(otpVersion)
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
simulateInput('version-type', before)
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = 'v1.11.0-rc.0'
|
spec = 'v1.15.0-rc.2'
|
||||||
otpVersion = 'OTP-23'
|
otpVersion = 'OTP-26.0'
|
||||||
expected = 'v1.11.0-rc.0-otp-23'
|
expected = 'v1.15.0-rc.2-otp-26'
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
await setupBeam.installOTP(otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
|
||||||
simulateInput('version-type', before)
|
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
|
||||||
spec = 'v1.11.0-rc.0-otp-23'
|
|
||||||
otpVersion = 'OTP-23'
|
|
||||||
expected = 'v1.11.0-rc.0-otp-23'
|
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
|
||||||
assert.deepStrictEqual(got, expected)
|
|
||||||
simulateInput('version-type', before)
|
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
|
||||||
spec = 'v1.11.0'
|
|
||||||
otpVersion = '22.3.4.2'
|
|
||||||
expected = 'v1.11.0-otp-22'
|
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
simulateInput('version-type', before)
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = 'main'
|
spec = 'main'
|
||||||
otpVersion = '23.1'
|
otpVersion = '25.2'
|
||||||
expected = 'main-otp-23'
|
expected = 'main-otp-25'
|
||||||
|
await setupBeam.installOTP(otpVersion)
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
simulateInput('version-type', before)
|
simulateInput('version-type', before)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
simulateInput('hexpm-mirrors', hexMirrors, { multiline: true })
|
process.env.RUNNER_ARCH = previousRunnerArch
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('.getOTPVersion(_) - Gleam', () => {
|
describe('.getOTPVersion(_) - Gleam', () => {
|
||||||
@@ -622,6 +657,12 @@ describe('.getOTPVersion(_) - Gleam', () => {
|
|||||||
got = await setupBeam.getGleamVersion(spec, otpVersion)
|
got = await setupBeam.getGleamVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
spec = 'nightly'
|
||||||
|
otpVersion = '28'
|
||||||
|
expected = 'nightly'
|
||||||
|
got = await setupBeam.getGleamVersion(spec, otpVersion)
|
||||||
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '0.13.2'
|
spec = '0.13.2'
|
||||||
otpVersion = 'OTP-24'
|
otpVersion = 'OTP-24'
|
||||||
expected = 'v0.13.2'
|
expected = 'v0.13.2'
|
||||||
@@ -875,11 +916,21 @@ describe('.getVersionFromSpec(_)', () => {
|
|||||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-20.04'])
|
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-20.04'])
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
spec = '> 0'
|
||||||
|
expected = 'OTP-26.2.5'
|
||||||
|
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-22.04'])
|
||||||
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = 'latest'
|
spec = 'latest'
|
||||||
expected = 'OTP-27.0-rc3'
|
expected = 'OTP-27.0-rc3'
|
||||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-22.04'])
|
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-22.04'])
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
spec = '> 0'
|
||||||
|
expected = 'OTP-27.0'
|
||||||
|
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-24.04'])
|
||||||
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = 'latest'
|
spec = 'latest'
|
||||||
expected = 'OTP-27.0'
|
expected = 'OTP-27.0'
|
||||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-24.04'])
|
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-24.04'])
|
||||||
@@ -921,19 +972,21 @@ describe('version file', () => {
|
|||||||
const otpVersion = unsimulateInput('otp-version')
|
const otpVersion = unsimulateInput('otp-version')
|
||||||
const elixirVersion = unsimulateInput('elixir-version')
|
const elixirVersion = unsimulateInput('elixir-version')
|
||||||
const gleamVersion = unsimulateInput('gleam-version')
|
const gleamVersion = unsimulateInput('gleam-version')
|
||||||
const rebar3Version = unsimulateInput('rebar3-version')
|
|
||||||
|
|
||||||
it('is parsed correctly', async () => {
|
it('is parsed correctly', async () => {
|
||||||
const erlang = '27'
|
const erlang = '27.3.4.1'
|
||||||
const elixir = '1.17.0'
|
const elixir = '1.18.4'
|
||||||
const gleam = '0.23.0'
|
const gleam = '1.9.1'
|
||||||
const rebar3 = '3.24.0'
|
let toolVersions = `# a comment
|
||||||
const toolVersions = `# a comment
|
erlang ref:v${erlang}
|
||||||
erlang ref:v${erlang}# comment, no space, and ref:v
|
|
||||||
elixir ref:${elixir} # comment, with space and ref:
|
elixir ref:${elixir} # comment, with space and ref:
|
||||||
not-gleam 0.23 # not picked up
|
not-gleam 0.23 # not picked up
|
||||||
gleam ${gleam} \nrebar ${rebar3}`
|
gleam ${gleam} \n`
|
||||||
const filename = 'test/.tool-versions'
|
const filename = 'test/.tool-versions'
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
// Force \r\n to test in Windows
|
||||||
|
toolVersions = toolVersions.replace(/\n/g, '\r\n')
|
||||||
|
}
|
||||||
fs.writeFileSync(filename, toolVersions)
|
fs.writeFileSync(filename, toolVersions)
|
||||||
process.env.GITHUB_WORKSPACE = ''
|
process.env.GITHUB_WORKSPACE = ''
|
||||||
const appVersions = setupBeam.parseVersionFile(filename)
|
const appVersions = setupBeam.parseVersionFile(filename)
|
||||||
@@ -957,15 +1010,11 @@ gleam ${gleam} \nrebar ${rebar3}`
|
|||||||
assert.ok(async () => {
|
assert.ok(async () => {
|
||||||
await setupBeam.install('gleam', { toolVersion: gleam })
|
await setupBeam.install('gleam', { toolVersion: gleam })
|
||||||
})
|
})
|
||||||
assert.ok(async () => {
|
|
||||||
await setupBeam.install('rebar3', { toolVersion: rebar3 })
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
simulateInput('otp-version', otpVersion)
|
simulateInput('otp-version', otpVersion)
|
||||||
simulateInput('elixir-version', elixirVersion)
|
simulateInput('elixir-version', elixirVersion)
|
||||||
simulateInput('gleam-version', gleamVersion)
|
simulateInput('gleam-version', gleamVersion)
|
||||||
simulateInput('rebar3-version', rebar3Version)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('.get(_)', () => {
|
describe('.get(_)', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user