mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-22 22:56:07 +00:00
Compare commits
166 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a808ab128 | |||
| 8736e92447 | |||
| f4f179b825 | |||
| a228c4f190 | |||
| 730131f5b9 | |||
| 7782cf9cde | |||
| 324994a2c5 | |||
| 551a8c58c5 | |||
| 74e4a9879b | |||
| 992182bb93 | |||
| 837c16fb56 | |||
| 50a47d8240 | |||
| 149ca49ab5 | |||
| 48f5ea24e9 | |||
| fa471919e3 | |||
| b59f4962e3 | |||
| 35983496a6 | |||
| fad8771ace | |||
| c35be0e285 | |||
| e6d7811738 | |||
| b15302821e | |||
| b0ba423105 | |||
| c648472e6f | |||
| 3809396843 | |||
| f8797dd823 | |||
| a433e6bd12 | |||
| e0a7f48cee | |||
| c21f568d4c | |||
| fe26b2283c | |||
| 54075bcc5e | |||
| ea45c8043f | |||
| b4b8d851b6 | |||
| 20df794ab3 | |||
| 9d5c5ca125 | |||
| ad4294342c | |||
| 135c095dff | |||
| a04cfbb50e | |||
| cd1472f941 | |||
| c80fdc938c | |||
| aecd7abd75 | |||
| 6e9312bce0 | |||
| 3985c7c047 | |||
| 35f52551d2 | |||
| 0510550330 | |||
| 9eabb2c115 | |||
| e5f1a7b722 | |||
| 7a27046239 | |||
| fc68ffb904 | |||
| 190c3a5e7b | |||
| 92dab893ed | |||
| 5dfda65506 | |||
| ef385d6edc | |||
| bf3c3af135 | |||
| e7645e4102 | |||
| a36098e741 | |||
| 87781dc68a | |||
| d5f3979a5f | |||
| 930b3281ba | |||
| 30056ca086 | |||
| 1f3f354e6a | |||
| 3e49772722 | |||
| 2ac22cd739 | |||
| c4782c7b58 | |||
| 0afadf6bdd | |||
| e539b1ee26 | |||
| c5f0656346 | |||
| ee09b1e59b | |||
| f8b54b559e | |||
| bf1ce74034 | |||
| 559a930751 | |||
| 1380ebe712 | |||
| 0a549596b0 | |||
| 3a3c94fd9e | |||
| cfafb69ddd | |||
| b3cbb6afbf | |||
| 2abe6cda7a | |||
| d55fdba43f | |||
| eb86ad6523 | |||
| af6da5da48 | |||
| f018c1e6d8 | |||
| d843ebb78b | |||
| c8e09547a7 | |||
| 9d5b75ddfd | |||
| 98c13a9ed3 | |||
| 0f13bcf18a | |||
| c3137f5cd5 | |||
| 4cbacdb2a9 | |||
| 687000ab96 | |||
| 9ba6605098 | |||
| 722d91de6e | |||
| f79887d1ba | |||
| 30a0896082 | |||
| 41c0004487 | |||
| 9fc15d548d | |||
| 19003af5f4 | |||
| 53a564f4bb | |||
| 6ee130ce6b | |||
| 11a1f27b1e | |||
| 83bf0e8bac | |||
| 47d6c3c4af | |||
| 0d2a6cb44d | |||
| 0f6ba5d884 | |||
| 58166ce788 | |||
| 4a07ed84ac | |||
| de78da9a9d | |||
| 9928a16c11 | |||
| 3964390c66 | |||
| 1dacaf8a01 | |||
| fa8ba5f70e | |||
| daf8797d04 | |||
| de72677f00 | |||
| 334f76ce04 | |||
| 86b5ecbf21 | |||
| b8fc6e435e | |||
| e7fda7af4e | |||
| a50e3e2f89 | |||
| 7bc1e4ca67 | |||
| baf2bc3313 | |||
| 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 |
@@ -24,7 +24,7 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- name: Version it!
|
||||
run: |
|
||||
# We expect a string such as const setupBeamVersion = 'undefined' in the code
|
||||
@@ -45,10 +45,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref != 'refs/heads/main'
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- uses: actions/setup-node@v6.3.0
|
||||
with:
|
||||
node-version: '20'
|
||||
node-version: '24'
|
||||
- run: npm run build-dist
|
||||
- name: Check if build left artifacts
|
||||
run: git diff --exit-code --ignore-space-at-eol
|
||||
@@ -58,45 +58,74 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref != 'refs/heads/main'
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: raven-actions/actionlint@v2.0.1
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- uses: raven-actions/actionlint@v2.2.0
|
||||
|
||||
unit_tests_ubuntu:
|
||||
name: Unit tests (Ubuntu)
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-24.04-arm # ARM64
|
||||
- ubuntu-latest # x86_64
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- uses: actions/setup-node@v6.3.0
|
||||
with:
|
||||
node-version: '20'
|
||||
node-version: '24'
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
env:
|
||||
NODE_ENV: 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_windows:
|
||||
name: Unit tests (Windows)
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- windows-latest # x86_64
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- uses: actions/setup-node@v6.3.0
|
||||
with:
|
||||
node-version: '20'
|
||||
node-version: '24'
|
||||
- run: npm install --production
|
||||
- run: npm test
|
||||
env:
|
||||
NODE_ENV: 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:
|
||||
name: Unit tests (macOS)
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- macos-latest # ARM64
|
||||
- macos-15-intel # x86_64
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- uses: actions/setup-node@v6.3.0
|
||||
with:
|
||||
node-version: '20'
|
||||
node-version: '24'
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
env:
|
||||
NODE_ENV: test
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
install-rebar: [true, false]
|
||||
install-hex: [true, false]
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
|
||||
+21
-16
@@ -16,6 +16,7 @@ on:
|
||||
jobs:
|
||||
integration_test:
|
||||
name: >
|
||||
OS ${{matrix.combo.os}},
|
||||
OTP ${{matrix.combo.otp-version}},
|
||||
Elixir ${{matrix.combo.elixir-version}},
|
||||
rebar3 ${{matrix.combo.rebar3-version}}
|
||||
@@ -24,6 +25,22 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
combo:
|
||||
# macOS 14 - per README
|
||||
- otp-version: '25'
|
||||
os: 'macos-14'
|
||||
- otp-version: '29'
|
||||
os: 'macos-14'
|
||||
# macOS 15 - per README
|
||||
- otp-version: '25'
|
||||
os: 'macos-15'
|
||||
- otp-version: '29'
|
||||
os: 'macos-15'
|
||||
# macOS 26 - per README
|
||||
- otp-version: '25'
|
||||
os: 'macos-26'
|
||||
- otp-version: '29'
|
||||
os: 'macos-26'
|
||||
# macOS latest
|
||||
- otp-version: '27'
|
||||
elixir-version: 'v1.17.0'
|
||||
rebar3-version: '3.23'
|
||||
@@ -43,25 +60,13 @@ jobs:
|
||||
elixir-version: '1.14.3'
|
||||
os: 'macos-latest'
|
||||
version-type: 'strict'
|
||||
- otp-version: '27'
|
||||
os: 'macos-15'
|
||||
version-type: 'strict'
|
||||
- otp-version: '26'
|
||||
os: 'macos-15'
|
||||
version-type: 'strict'
|
||||
- otp-version: '25'
|
||||
os: 'macos-15'
|
||||
- otp-version: '26'
|
||||
elixir-version: '1.16'
|
||||
rebar3-version: '3.25'
|
||||
os: 'macos-14'
|
||||
- otp-version: '25.0'
|
||||
elixir-version: 'v1.13.4-otp-25'
|
||||
elixir-version: 'v1.16.3-otp-25'
|
||||
rebar3-version: '3.18.0'
|
||||
os: 'macos-latest'
|
||||
version-type: 'strict'
|
||||
- otp-version: '25.0'
|
||||
elixir-version: 'v1.13.4'
|
||||
elixir-version: 'v1.16.3'
|
||||
rebar3-version: '3.18.0'
|
||||
os: 'macos-latest'
|
||||
version-type: 'strict'
|
||||
@@ -71,7 +76,7 @@ jobs:
|
||||
rebar3-version: 'latest'
|
||||
os: 'macos-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
@@ -124,7 +129,7 @@ jobs:
|
||||
rebar3-version: 3.24
|
||||
os: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
|
||||
@@ -16,6 +16,7 @@ on:
|
||||
jobs:
|
||||
integration_test:
|
||||
name: >
|
||||
OS ${{matrix.combo.os}},
|
||||
OTP ${{matrix.combo.otp-version}},
|
||||
Elixir ${{matrix.combo.elixir-version}},
|
||||
Gleam ${{matrix.combo.gleam-version}},
|
||||
@@ -25,6 +26,22 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
combo:
|
||||
# Ubuntu 22.04 - per README
|
||||
- otp-version: '24.2'
|
||||
os: 'ubuntu-22.04'
|
||||
- otp-version: '29'
|
||||
os: 'ubuntu-22.04'
|
||||
# Ubuntu 24.04 - per README
|
||||
- otp-version: '24.3'
|
||||
os: 'ubuntu-24.04'
|
||||
- otp-version: '29'
|
||||
os: 'ubuntu-24.04'
|
||||
# Ubuntu 26.04 - per README
|
||||
- otp-version: '26'
|
||||
os: 'ubuntu-26.04'
|
||||
- otp-version: '29'
|
||||
os: 'ubuntu-26.04'
|
||||
# Ubuntu latest
|
||||
- otp-version: '27'
|
||||
elixir-version: 'v1.17.0'
|
||||
rebar3-version: '3.23'
|
||||
@@ -44,25 +61,13 @@ jobs:
|
||||
elixir-version: '1.14.3'
|
||||
os: 'ubuntu-latest'
|
||||
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'
|
||||
os: 'ubuntu-24.04'
|
||||
- otp-version: '26'
|
||||
elixir-version: '1.16'
|
||||
rebar3-version: '3.25'
|
||||
os: 'ubuntu-22.04'
|
||||
- otp-version: '25.0'
|
||||
elixir-version: 'v1.13.4-otp-25'
|
||||
elixir-version: 'v1.16.2-otp-25'
|
||||
rebar3-version: '3.18.0'
|
||||
os: 'ubuntu-latest'
|
||||
version-type: 'strict'
|
||||
- otp-version: '25.0'
|
||||
elixir-version: 'v1.13.4'
|
||||
elixir-version: 'v1.16.3'
|
||||
rebar3-version: '3.18.0'
|
||||
os: 'ubuntu-latest'
|
||||
version-type: 'strict'
|
||||
@@ -77,13 +82,13 @@ jobs:
|
||||
otp-version: false
|
||||
os: 'ubuntu-latest'
|
||||
disable_problem_matchers: true
|
||||
- elixir-version: 'v1.13'
|
||||
- elixir-version: 'v1.16'
|
||||
otp-version: '24'
|
||||
escript_packages: 'hex protobuf'
|
||||
escript_script: 'protoc-gen-elixir --version'
|
||||
os: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
@@ -151,7 +156,7 @@ jobs:
|
||||
rebar3-version: 3.24
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
|
||||
@@ -3,6 +3,7 @@ name: Update 3rd party licenses (automation)
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -14,7 +15,7 @@ jobs:
|
||||
name: Update 3rd party licenses
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- run:
|
||||
./.github/workflows/update_3rd_party_licenses.sh
|
||||
env:
|
||||
|
||||
@@ -16,6 +16,7 @@ on:
|
||||
jobs:
|
||||
integration_test:
|
||||
name: >
|
||||
OS ${{matrix.combo.os}},
|
||||
OTP ${{matrix.combo.otp-version}},
|
||||
Elixir ${{matrix.combo.elixir-version}},
|
||||
Gleam ${{matrix.combo.gleam-version}},
|
||||
@@ -25,6 +26,20 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
combo:
|
||||
# Windows 2022 - per README
|
||||
- otp-version: '26' # 21 is "so old", at this moment, we can't find it in latest 100
|
||||
os: 'windows-2022'
|
||||
- otp-version: '29'
|
||||
os: 'windows-2022'
|
||||
# Windows 2025 - per README
|
||||
- otp-version: '26' # 21 is "so old", at this moment, we can't find it in latest 100
|
||||
os: 'windows-2025'
|
||||
- otp-version: '29'
|
||||
os: 'windows-2025'
|
||||
# Windows latest
|
||||
- otp-version: '<26'
|
||||
elixir-version: '<1.17'
|
||||
os: 'windows-latest'
|
||||
- otp-version: '27'
|
||||
elixir-version: 'v1.17.0'
|
||||
rebar3-version: '3.23'
|
||||
@@ -41,30 +56,24 @@ jobs:
|
||||
elixir-version: '1.14.5'
|
||||
os: 'windows-latest'
|
||||
version-type: 'strict'
|
||||
- otp-version: '24.0.2'
|
||||
rebar3-version: '3.16'
|
||||
os: 'windows-2022'
|
||||
- otp-version: '23.0'
|
||||
rebar3-version: '3.15'
|
||||
os: 'windows-2022'
|
||||
- elixir-version: 'v1.10'
|
||||
otp-version: '23'
|
||||
rebar3-version: '3.14'
|
||||
os: 'windows-latest'
|
||||
- elixir-version: 'v1.13'
|
||||
- elixir-version: 'v1.16'
|
||||
otp-version: '24'
|
||||
rebar3-version: '3.15'
|
||||
os: 'windows-latest'
|
||||
- gleam-version: '1.9.0'
|
||||
otp-version: '27'
|
||||
os: 'windows-latest'
|
||||
- elixir-version: 'v1.13'
|
||||
- elixir-version: 'v1.16'
|
||||
otp-version: '24'
|
||||
escript_packages: 'hex protobuf'
|
||||
escript_script: 'protoc-gen-elixir --version'
|
||||
os: 'windows-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
@@ -131,7 +140,7 @@ jobs:
|
||||
rebar3-version: 3.24
|
||||
os: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
|
||||
+4
-2
@@ -1,2 +1,4 @@
|
||||
node_modules/**
|
||||
test/.tool-versions
|
||||
/node_modules
|
||||
/test/.tool-versions
|
||||
/test/mise.toml
|
||||
/dist/package.json
|
||||
|
||||
+1169
-6963
File diff suppressed because it is too large
Load Diff
@@ -53,38 +53,50 @@ end up being parsed as `23`, which is not equivalent.
|
||||
|
||||
#### Pre-release versions
|
||||
|
||||
For pre-release versions, such as `v1.11.0-rc.0`, use the full version
|
||||
specifier (`v1.11.0-rc.0`) and set option `version-type` to `strict`. Pre-release versions are
|
||||
opt-in, so `1.11.x` will not match a pre-release.
|
||||
To use a pre-release version such as `v1.11.0-rc.0`, specify the exact version
|
||||
(`v1.11.0-rc.0`) and set `version-type` to `strict`.
|
||||
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
|
||||
|
||||
Set a tool's version to `latest` to retrieve the latest version of a given tool.
|
||||
The latest version is (locally) calculated by the action based on the (retrieved) versions
|
||||
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).
|
||||
To retrieve the most recent available version of a tool, set the version to `latest`.
|
||||
This may include pre-release versions such as release candidates.
|
||||
|
||||
If in doubt do a test run and compare the obtained release with the one you were expecting to
|
||||
be the latest.
|
||||
If you want to target only the latest stable release and exclude pre-releases, use a
|
||||
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
|
||||
|
||||
This list presents the known working version combos between the target operating system
|
||||
and Erlang/OTP.
|
||||
|
||||
| Operating system | Erlang/OTP | OTP Architecture | Status
|
||||
|- |- | - |-
|
||||
| `ubuntu-22.04` | 24.2 - 28 | x86_64, arm64 | ✅
|
||||
| `ubuntu-24.04` | 24.3 - 28 | x86_64, arm64 | ✅
|
||||
| `windows-2019` | 21\* - 25 | x86_64, x86 | ✅
|
||||
| `windows-2022` | 21\* - 28 | x86_64, x86 | ✅
|
||||
| `macOS-13` | 25.0 - 28 | x86_64, arm64 | ✅
|
||||
| `macOS-14` | 25.0 - 28 | x86_64, arm64 | ✅
|
||||
| `macOS-15` | 25.0 - 28 | x86_64, arm64 | ✅
|
||||
| Operating system | Erlang/OTP | OTP Architecture | Status
|
||||
|- |- | - |-
|
||||
| `ubuntu-22.04` | 24.2 - 29 | x86_64, arm64 | ✅
|
||||
| `ubuntu-24.04` | 24.3 - 29 | x86_64, arm64 | ✅
|
||||
| `ubuntu-26.04` | 26 - 29 | x86_64, arm64 | ✅
|
||||
| `windows-2022` | 21\* - 29 | x86_64, x86 | ✅
|
||||
| `windows-2025` | 21\* - 29 | x86_64, x86 | ✅
|
||||
| `macOS-14` | 25 - 29 | x86_64, arm64 | ✅
|
||||
| `macOS-15` | 25 - 29 | x86_64, arm64 | ✅
|
||||
| `macOS-26` | 25 - 29 | x86_64, arm64 | ✅
|
||||
|
||||
**Note** \*: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3,
|
||||
22.0, etc.
|
||||
|
||||
### Compatibility between Erlang/OTP and rebar3
|
||||
|
||||
Check [version compatibility](https://github.com/erlang/rebar3?tab=readme-ov-file#compatibility-between-rebar3-and-erlangotp)
|
||||
in `erlang/rebar3`.
|
||||
|
||||
### Self-hosted runners
|
||||
|
||||
Self-hosted runners need to set env. variable `ImageOS` to one of the following, since the action
|
||||
@@ -93,12 +105,17 @@ uses that to download assets:
|
||||
| ImageOS | Operating system
|
||||
|- |-
|
||||
| `ubuntu22` | `ubuntu-22.04`
|
||||
| `ubuntu22-arm64` | `ubuntu-22.04`
|
||||
| `ubuntu24` | `ubuntu-24.04`
|
||||
| `win19` | `windows-2019`
|
||||
| `ubuntu24-arm64` | `ubuntu-24.04`
|
||||
| `ubuntu26` | `ubuntu-26.04`
|
||||
| `ubuntu26-arm64` | `ubuntu-26.04`
|
||||
| `win22` | `windows-2022`
|
||||
| `macos13` | `macOS-13`
|
||||
| `win25` | `windows-2025`
|
||||
| `win25-vs2026` | `windows-2025`
|
||||
| `macos14` | `macOS-14`
|
||||
| `macos15` | `macOS-15`
|
||||
| `macos26` | `macOS-26`
|
||||
|
||||
as per the following example:
|
||||
|
||||
@@ -133,23 +150,22 @@ e.g. `${{steps.setup-beam.outputs.erlang-version}}`
|
||||
|
||||
### Version file
|
||||
|
||||
A version file is specified via input `version-file` (e.g.`.tool-versions`). This
|
||||
allows not having to use YML input for versions, though the action does check (and
|
||||
A version file is specified via input `version-file` (e.g. `.tool-versions` or `mise.toml`).
|
||||
The file type is inferred from the filename: files ending in `.toml` are parsed as
|
||||
[mise](https://mise.jdx.dev/configuration.html#tools-dev-tools) configuration, and all others
|
||||
are parsed as [`.tool-versions`](https://asdf-vm.com/manage/configuration.html) (asdf format).
|
||||
This allows not having to use YML input for versions, though the action does check (and
|
||||
will exit with error) if both inputs are set.
|
||||
|
||||
**Note**: if you're using a version file, option `version-type` is checked to be `strict`,
|
||||
and will make the action exit with error otherwise.
|
||||
|
||||
The following version file formats are supported:
|
||||
|
||||
- `.tool-versions`, as specified by [asdf: Configuration](https://asdf-vm.com/manage/configuration.html)
|
||||
|
||||
Supported version elements are the same as the ones defined for the YML portion of the action,
|
||||
with the following correspondence.
|
||||
|
||||
#### `.tool-versions` format
|
||||
#### `.tool-versions` / `mise.toml` format
|
||||
|
||||
| YML | `.tool-versions`
|
||||
| YML | Version file key
|
||||
|- |-
|
||||
| `otp-version` | `erlang`
|
||||
| `elixir-version` | `elixir`
|
||||
@@ -283,6 +299,34 @@ jobs:
|
||||
- run: rebar3 ct
|
||||
```
|
||||
|
||||
### Compatibility
|
||||
|
||||
To execute matrix testing with specific dependency versions, configure the environment matrix to
|
||||
use pinned, compatible releases:
|
||||
|
||||
```yaml
|
||||
test:
|
||||
runs-on: ${{matrix.compat.os}}
|
||||
name: Erlang/OTP ${{matrix.compat.otp}} / rebar3 ${{matrix.compat.rebar3}}
|
||||
strategy:
|
||||
matrix:
|
||||
compat:
|
||||
- otp: "26.2.5.5"
|
||||
rebar3: "3.22.1"
|
||||
os: ubuntu-24.04
|
||||
- otp: "27.1.2"
|
||||
rebar3: "3.22.1"
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: ${{matrix.compat.otp}}
|
||||
rebar3-version: ${{matrix.compat.rebar3}}
|
||||
version-type: strict
|
||||
- run: rebar3 eunit
|
||||
```
|
||||
|
||||
### Erlang/OTP + `rebar3`, on Windows
|
||||
|
||||
```yaml
|
||||
@@ -291,7 +335,7 @@ on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: windows-2022
|
||||
runs-on: windows-2025
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
|
||||
+4
-2
@@ -69,7 +69,9 @@ inputs:
|
||||
required: false
|
||||
|
||||
version-file:
|
||||
description: a versions file (e.g. as used by `asdf`), which defines inputs
|
||||
description: >-
|
||||
a versions file (e.g. `.tool-versions` as used by `asdf`, or `mise.toml`
|
||||
as used by `mise`), which defines inputs
|
||||
default: ''
|
||||
required: false
|
||||
|
||||
@@ -96,5 +98,5 @@ outputs:
|
||||
description: The commit unique id of the execution action version
|
||||
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: dist/index.js
|
||||
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "erlc-warning",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(\\S+):(\\d+):(\\d+): [wW]arning: (.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "erlc-error",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(\\S+):(\\d+):(\\d+): (?![wW]arning)(.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "ct-failure",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(\\S+) failed on line (\\d+)$",
|
||||
"file": 1,
|
||||
"line": 2
|
||||
},
|
||||
{
|
||||
"regexp": "^Reason: (.+)$",
|
||||
"message": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "eunit-failure",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\S+: .+\\.\\.\\.\\*failed\\*$"
|
||||
},
|
||||
{
|
||||
"regexp": "^in function .+ \\((.+), line (\\d+)\\)$",
|
||||
"file": 1,
|
||||
"line": 2
|
||||
},
|
||||
{
|
||||
"regexp": "^in call from .+$"
|
||||
},
|
||||
{
|
||||
"regexp": "^\\*\\*error:(.+)$",
|
||||
"message": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+34390
-24277
File diff suppressed because one or more lines are too long
+19
-22
@@ -1,30 +1,27 @@
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import { defineConfig } from 'eslint/config'
|
||||
import eslintPluginYml from 'eslint-plugin-yml'
|
||||
import yml from 'eslint-plugin-yml'
|
||||
import * as yamlParser from 'yaml-eslint-parser'
|
||||
|
||||
export default defineConfig([
|
||||
...eslintPluginYml.configs['flat/recommended'],
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
{
|
||||
extends: ['js/recommended'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
globals: globals.node,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.yml'],
|
||||
languageOptions: {
|
||||
parser: yamlParser,
|
||||
},
|
||||
plugins: {
|
||||
js,
|
||||
yml,
|
||||
},
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
rules: {
|
||||
...yml.configs.recommended.rules,
|
||||
},
|
||||
},
|
||||
{
|
||||
extends: eslintPluginYml.configs['flat/recommended'],
|
||||
files: ['*.yml'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
parser: 'yaml-eslint-parser',
|
||||
defaultYAMLVersion: '1.2',
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
]
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "erlc-warning",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(\\S+):(\\d+):(\\d+): [wW]arning: (.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "erlc-error",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(\\S+):(\\d+):(\\d+): (?![wW]arning)(.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "ct-failure",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(\\S+) failed on line (\\d+)$",
|
||||
"file": 1,
|
||||
"line": 2
|
||||
},
|
||||
{
|
||||
"regexp": "^Reason: (.+)$",
|
||||
"message": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "eunit-failure",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\S+: .+\\.\\.\\.\\*failed\\*$"
|
||||
},
|
||||
{
|
||||
"regexp": "^in function .+ \\((.+), line (\\d+)\\)$",
|
||||
"file": 1,
|
||||
"line": 2
|
||||
},
|
||||
{
|
||||
"regexp": "^in call from .+$"
|
||||
},
|
||||
{
|
||||
"regexp": "^\\*\\*error:(.+)$",
|
||||
"message": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Generated
+1313
-951
File diff suppressed because it is too large
Load Diff
+16
-15
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "setup-beam",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -16,25 +17,25 @@
|
||||
"build-dist": "npm run clean-dist && npm install && npm run build && npm run format && npm run lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "1.11.1",
|
||||
"@actions/exec": "1.1.1",
|
||||
"@actions/tool-cache": "2.0.2",
|
||||
"csv-parse": "5.6.0",
|
||||
"semver": "7.7.2",
|
||||
"lodash": "4.17.21"
|
||||
"@actions/core": "3.0.0",
|
||||
"@actions/exec": "3.0.0",
|
||||
"@actions/tool-cache": "4.0.0",
|
||||
"csv-parse": "7.0.1",
|
||||
"semver": "7.7.4",
|
||||
"smol-toml": "1.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "0.38.3",
|
||||
"eslint": "9.29.0",
|
||||
"@eslint/js": "9.29.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/js": "10.0.1",
|
||||
"@vercel/ncc": "0.44.1",
|
||||
"eslint": "10.6.0",
|
||||
"eslint-plugin-yml": "3.5.0",
|
||||
"globals": "17.7.0",
|
||||
"markdownlint-cli": "0.49.0",
|
||||
"prettier": "3.9.5",
|
||||
"shellcheck": "4.1.0",
|
||||
"yarn": "1.22.22"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
"node": ">=24"
|
||||
}
|
||||
}
|
||||
|
||||
+223
-103
@@ -1,18 +1,24 @@
|
||||
const core = require('@actions/core')
|
||||
const { exec } = require('@actions/exec')
|
||||
const tc = require('@actions/tool-cache')
|
||||
const path = require('path')
|
||||
const semver = require('semver')
|
||||
const fs = require('fs')
|
||||
const os = require('os')
|
||||
const csv = require('csv-parse/sync')
|
||||
const _ = require('lodash')
|
||||
import path from 'node:path'
|
||||
import fs from 'node:fs'
|
||||
import os from 'node:os'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import * as core from '@actions/core'
|
||||
import { exec } from '@actions/exec'
|
||||
import * as tc from '@actions/tool-cache'
|
||||
import * as semver from 'semver'
|
||||
import * as csv from 'csv-parse/sync'
|
||||
import toml from 'smol-toml'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
const MAX_HTTP_RETRIES = 3
|
||||
const APPS = ['erlang', 'elixir', 'gleam', 'rebar']
|
||||
|
||||
main().catch((err) => {
|
||||
core.setFailed(err.message)
|
||||
})
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
main().catch((err) => {
|
||||
core.setFailed(err.message)
|
||||
})
|
||||
}
|
||||
|
||||
async function main() {
|
||||
checkOtpArchitecture()
|
||||
@@ -28,15 +34,14 @@ async function main() {
|
||||
versions = parseVersionFile(versionFilePath)
|
||||
}
|
||||
|
||||
const osVersion = getRunnerOSVersion()
|
||||
const otpSpec = getInput('otp-version', true, 'erlang', versions)
|
||||
const elixirSpec = getInput('elixir-version', false, 'elixir', versions)
|
||||
const gleamSpec = getInput('gleam-version', false, 'gleam', versions)
|
||||
const rebar3Spec = getInput('rebar3-version', false, 'rebar', versions)
|
||||
|
||||
if (otpSpec !== 'false') {
|
||||
await installOTP(otpSpec, osVersion)
|
||||
const elixirInstalled = await maybeInstallElixir(elixirSpec, otpSpec)
|
||||
await installOTP(otpSpec)
|
||||
const elixirInstalled = await maybeInstallElixir(elixirSpec)
|
||||
if (elixirInstalled === true) {
|
||||
const shouldMixRebar = getInput('install-rebar', false)
|
||||
await mix(shouldMixRebar, 'rebar')
|
||||
@@ -52,11 +57,12 @@ async function main() {
|
||||
await maybeInstallRebar3(rebar3Spec)
|
||||
|
||||
// undefined is replaced by a function, post- main branch merge
|
||||
const setupBeamVersion = 'a8bc27e'
|
||||
const setupBeamVersion = 'f4f179b'
|
||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||
}
|
||||
|
||||
async function installOTP(otpSpec, osVersion) {
|
||||
async function installOTP(otpSpec) {
|
||||
const osVersion = getRunnerOSVersion()
|
||||
const otpVersion = await getOTPVersion(otpSpec, osVersion)
|
||||
core.startGroup(
|
||||
`Installing Erlang/OTP ${otpVersion} - built on ${getRunnerOSArchitecture()}/${osVersion}`,
|
||||
@@ -73,15 +79,16 @@ async function installOTP(otpSpec, osVersion) {
|
||||
},
|
||||
})
|
||||
core.setOutput('otp-version', otpVersion)
|
||||
maybeEnableProblemMatchers('erlang')
|
||||
core.endGroup()
|
||||
|
||||
return otpVersion
|
||||
}
|
||||
|
||||
async function maybeInstallElixir(elixirSpec, otpSpec) {
|
||||
async function maybeInstallElixir(elixirSpec) {
|
||||
let installed = false
|
||||
if (elixirSpec) {
|
||||
const elixirVersion = await getElixirVersion(elixirSpec, otpSpec)
|
||||
const elixirVersion = await getElixirVersion(elixirSpec)
|
||||
core.startGroup(`Installing Elixir ${elixirVersion}`)
|
||||
await doWithMirrors({
|
||||
hexMirrors: hexMirrorsInput(),
|
||||
@@ -94,7 +101,7 @@ async function maybeInstallElixir(elixirSpec, otpSpec) {
|
||||
},
|
||||
})
|
||||
core.setOutput('elixir-version', elixirVersion)
|
||||
maybeEnableElixirProblemMatchers()
|
||||
maybeEnableProblemMatchers('elixir')
|
||||
core.endGroup()
|
||||
|
||||
installed = true
|
||||
@@ -103,16 +110,18 @@ async function maybeInstallElixir(elixirSpec, otpSpec) {
|
||||
return installed
|
||||
}
|
||||
|
||||
function maybeEnableElixirProblemMatchers() {
|
||||
const disableProblemMatchers = getInput('disable_problem_matchers', false)
|
||||
if (disableProblemMatchers === 'false') {
|
||||
const elixirMatchers = path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
'matchers',
|
||||
'elixir-matchers.json',
|
||||
)
|
||||
core.info(`##[add-matcher]${elixirMatchers}`)
|
||||
function problemMatchersEnabled() {
|
||||
return getInput('disable_problem_matchers', false) === 'false'
|
||||
}
|
||||
|
||||
// path.join with static strings helps ncc resolve and bundle the JSON files
|
||||
function maybeEnableProblemMatchers(language) {
|
||||
if (problemMatchersEnabled()) {
|
||||
const matcherFiles = {
|
||||
erlang: path.join(`${__dirname}/../matchers/erlang-matchers.json`),
|
||||
elixir: path.join(`${__dirname}/../matchers/elixir-matchers.json`),
|
||||
}
|
||||
core.info(`##[add-matcher]${matcherFiles[language]}`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,10 +177,14 @@ async function maybeInstallRebar3(rebar3Spec) {
|
||||
return installed
|
||||
}
|
||||
|
||||
function maybeRemoveOTPPrefix(otpSpec) {
|
||||
return otpSpec.replace(/^OTP-/, '')
|
||||
}
|
||||
|
||||
async function getOTPVersion(otpSpec0, osVersion) {
|
||||
const [otpVersions, originListing, hexMirrors] =
|
||||
await getOTPVersions(osVersion)
|
||||
let spec = otpSpec0.replace(/^OTP-/, '')
|
||||
let spec = maybeRemoveOTPPrefix(otpSpec0)
|
||||
const versions = otpVersions
|
||||
const otpVersion = getVersionFromSpec(spec, versions)
|
||||
|
||||
@@ -185,26 +198,50 @@ async function getOTPVersion(otpSpec0, osVersion) {
|
||||
}
|
||||
|
||||
function requestedVersionFor(tool, version, originListing, mirrors) {
|
||||
return (
|
||||
`Requested ${tool} version (${version}) not found in version list, ` +
|
||||
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}; ` +
|
||||
"should you be using option 'version-type': 'strict'?"
|
||||
)
|
||||
const isVersionTypeStrict = isStrictVersion()
|
||||
|
||||
let versionType = 'loose'
|
||||
if (isVersionTypeStrict) {
|
||||
versionType = 'strict'
|
||||
}
|
||||
|
||||
let ret =
|
||||
`Requested ${versionType} ${tool} version (${version}) not found in version list, ` +
|
||||
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.`
|
||||
if (!isVersionTypeStrict) {
|
||||
ret = `${ret} Should you be using option 'version-type': 'strict'?`
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
const knownBranches = ['main', 'master', 'maint']
|
||||
const nonSpecificVersions = ['nightly', 'latest']
|
||||
|
||||
async function getElixirVersion(exSpec0, otpVersion0) {
|
||||
const otpVersion = otpVersion0.match(/^(?:OTP-)?(.+)$/)[1]
|
||||
const regex = `^(\\d{1,3}|${knownBranches.join('|')}|${nonSpecificVersions.join('|')})?.*$`
|
||||
let otpVersionMajor = otpVersion.match(new RegExp(regex))[1]
|
||||
|
||||
async function getElixirVersion(exSpec0) {
|
||||
const otpSuffix = /-otp-(\d+)/
|
||||
const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null
|
||||
let otpVersionMajor = ''
|
||||
|
||||
if (userSuppliedOtp && isVersion(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] =
|
||||
@@ -219,18 +256,30 @@ async function getElixirVersion(exSpec0, otpVersion0) {
|
||||
)
|
||||
}
|
||||
|
||||
const elixirVersionComp = otpVersionsForElixirMap[elixirVersionFromSpec]
|
||||
if (
|
||||
(elixirVersionComp && elixirVersionComp.includes(otpVersionMajor)) ||
|
||||
!isVersion(otpVersionMajor)
|
||||
) {
|
||||
core.info(
|
||||
`Using Elixir ${elixirVersionFromSpec} (built for Erlang/OTP ${otpVersionMajor})`,
|
||||
)
|
||||
} else {
|
||||
let foundCombo = false
|
||||
let otpVersionMajorIter = parseInt(otpVersionMajor)
|
||||
let otpVersionsMajor = []
|
||||
while (otpVersionMajorIter > otpVersionMajor - 3) {
|
||||
otpVersionMajorIter += ''
|
||||
otpVersionsMajor.push(otpVersionMajorIter)
|
||||
const elixirVersionComp = otpVersionsForElixirMap[elixirVersionFromSpec]
|
||||
if (
|
||||
(elixirVersionComp && elixirVersionComp.includes(otpVersionMajorIter)) ||
|
||||
!isVersion(otpVersionMajorIter)
|
||||
) {
|
||||
core.info(
|
||||
`Using Elixir ${elixirVersionFromSpec} (built for Erlang/OTP ${otpVersionMajorIter})`,
|
||||
)
|
||||
foundCombo = true
|
||||
break
|
||||
}
|
||||
otpVersionMajorIter = parseInt(otpVersionMajorIter) - 1
|
||||
}
|
||||
|
||||
if (!foundCombo) {
|
||||
throw new Error(
|
||||
`Requested Elixir / Erlang/OTP version (${exSpec0} / ${otpVersion0}) not ` +
|
||||
'found in version list (did you check Compatibility between Elixir and Erlang/OTP?).' +
|
||||
`Requested Elixir / Erlang/OTP version (${exSpec0} / tried ${otpVersionsMajor}) not ` +
|
||||
'found in version list (did you check Compatibility between Elixir and Erlang/OTP?). ' +
|
||||
'Elixir and Erlang/OTP compatibility can be found at: ' +
|
||||
'https://hexdocs.pm/elixir/compatibility-and-deprecations.html',
|
||||
)
|
||||
@@ -238,8 +287,8 @@ async function getElixirVersion(exSpec0, otpVersion0) {
|
||||
|
||||
let elixirVersionForDownload = elixirVersionFromSpec
|
||||
|
||||
if (isVersion(otpVersionMajor)) {
|
||||
elixirVersionForDownload = `${elixirVersionFromSpec}-otp-${otpVersionMajor}`
|
||||
if (isVersion(otpVersionMajorIter)) {
|
||||
elixirVersionForDownload = `${elixirVersionFromSpec}-otp-${otpVersionMajorIter}`
|
||||
}
|
||||
|
||||
return maybePrependWithV(elixirVersionForDownload)
|
||||
@@ -321,29 +370,24 @@ async function getOTPVersions(osVersion) {
|
||||
.trim()
|
||||
.split('\n')
|
||||
.forEach((line) => {
|
||||
const otpMatch = line
|
||||
.match(/^([^ ]+)?( .+)/)[1]
|
||||
.match(/^([^-]+-)?(.+)$/)
|
||||
const otpVersion = otpMatch[2]
|
||||
const otpVersionOrig = otpMatch[0]
|
||||
debugLog('OTP line and parsing', [line, otpVersion, otpMatch])
|
||||
const otpVersionOrig = line.match(/^([^ ]+)?( .+)/)[1]
|
||||
const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig)
|
||||
debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig])
|
||||
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
||||
})
|
||||
} else if (process.platform === 'win32') {
|
||||
const otpArch = otpArchitecture()
|
||||
const file_regex = new RegExp(
|
||||
`^otp_win${_.escapeRegExp(otpArch)}_(.*).exe$`,
|
||||
)
|
||||
const file_regex = new RegExp(`^otp_win${RegExp.escape(otpArch)}_(.*).exe$`)
|
||||
otpVersionsListings.forEach((otpVersionsListing) => {
|
||||
otpVersionsListing
|
||||
.map((x) => x.assets)
|
||||
.flat()
|
||||
.filter((x) => x.name.match(file_regex))
|
||||
.forEach((x) => {
|
||||
const otpMatch = x.name.match(file_regex)
|
||||
const otpVersion = otpMatch[1]
|
||||
debugLog('OTP line and parsing', [otpMatch, otpVersion])
|
||||
otpVersions[otpVersion] = otpVersion
|
||||
const otpVersionOrig = x.name.match(file_regex)[1]
|
||||
const otpVersion = otpVersionOrig
|
||||
debugLog('OTP line and parsing', [x.name, otpVersion, otpVersionOrig])
|
||||
otpVersions[otpVersion] = otpVersionOrig
|
||||
})
|
||||
})
|
||||
} else if (process.platform === 'darwin') {
|
||||
@@ -352,10 +396,9 @@ async function getOTPVersions(osVersion) {
|
||||
columns: true,
|
||||
})
|
||||
.forEach((line) => {
|
||||
const otpMatch = line.ref_name.match(/^([^-]+-)?(.+)$/)
|
||||
const otpVersion = otpMatch[2]
|
||||
const otpVersionOrig = otpMatch[0]
|
||||
debugLog('OTP line and parsing', [line, otpVersion, otpMatch])
|
||||
const otpVersionOrig = line.ref_name
|
||||
const otpVersion = maybeRemoveOTPPrefix(otpVersionOrig)
|
||||
debugLog('OTP line and parsing', [line, otpVersion, otpVersionOrig])
|
||||
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
|
||||
})
|
||||
}
|
||||
@@ -448,6 +491,7 @@ function validVersion(v) {
|
||||
v.match(
|
||||
new RegExp(`${knownBranches.join('|')}|${nonSpecificVersions.join('|')}`),
|
||||
) == null &&
|
||||
// these ones are for rebar3, which has alpha and beta releases
|
||||
!v.startsWith('a') &&
|
||||
!v.startsWith('b')
|
||||
)
|
||||
@@ -474,8 +518,14 @@ function getVersionFromSpec(spec0, versions0) {
|
||||
const altVersions = {}
|
||||
Object.entries(versions0).forEach(([version, altVersion]) => {
|
||||
let coerced
|
||||
if (isStrictVersion() || isRC(version)) {
|
||||
// If `version-type: strict` or version is RC, we just try to remove a potential initial v
|
||||
if (
|
||||
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)
|
||||
} else {
|
||||
// Otherwise, we place the version into a version bucket
|
||||
@@ -492,13 +542,19 @@ function getVersionFromSpec(spec0, versions0) {
|
||||
const rangeMax = semver.maxSatisfying(versions, rangeForMax)
|
||||
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 `version-type: strict` or version is RC, we obtain it directly
|
||||
// We obtain it directly
|
||||
version = versions0[spec]
|
||||
}
|
||||
} else if (spec0 === 'latest') {
|
||||
version = versions0[versions0.latest]
|
||||
} else if (rangeMax !== null) {
|
||||
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
|
||||
const thatVersion = spec
|
||||
@@ -525,7 +581,7 @@ function getVersionFromSpec(spec0, versions0) {
|
||||
}
|
||||
|
||||
function maybeCoerced(v) {
|
||||
let ret = null
|
||||
let ret
|
||||
try {
|
||||
if (!isRC(v)) {
|
||||
ret = semver.coerce(v).version
|
||||
@@ -602,18 +658,30 @@ function getRunnerOSArchitecture() {
|
||||
|
||||
function getRunnerOSVersion() {
|
||||
// List from https://github.com/actions/runner-images?tab=readme-ov-file#available-images
|
||||
// at e065a395d52f491c58eb8fba8ab1dde2c7cfada1
|
||||
// Not considered, at the moment (though it might be easy to adapt to...):
|
||||
// - ubuntu-slim
|
||||
// - all macOS intel, large, and xlarge variants
|
||||
// - all win arm variants
|
||||
const ImageOSToContainer = {
|
||||
ubuntu22: 'ubuntu-22.04',
|
||||
'ubuntu22-arm64': 'ubuntu-22.04',
|
||||
ubuntu24: 'ubuntu-24.04',
|
||||
win19: 'windows-2019',
|
||||
'ubuntu24-arm64': 'ubuntu-24.04',
|
||||
ubuntu26: 'ubuntu-26.04',
|
||||
'ubuntu26-arm64': 'ubuntu-26.04',
|
||||
win22: 'windows-2022',
|
||||
macos13: 'macOS-13',
|
||||
win25: 'windows-2025',
|
||||
'win25-vs2026': 'windows-2025',
|
||||
macos14: 'macOS-14',
|
||||
macos15: 'macOS-15',
|
||||
macos26: 'macOS-26',
|
||||
}
|
||||
const deprecatedImageOSToContainer = {
|
||||
ubuntu18: 'ubuntu-18.04',
|
||||
ubuntu20: 'ubuntu-20.04',
|
||||
win19: 'windows-2019',
|
||||
macos13: 'macOS-13',
|
||||
}
|
||||
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
|
||||
if (!containerFromEnvImageOS) {
|
||||
@@ -717,7 +785,7 @@ function xyzAbcVersion(pref, suf) {
|
||||
// https://www.erlang.org/doc/system_principles/versions.html
|
||||
const dd = '\\.?(\\d+)?'
|
||||
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}`,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -749,28 +817,14 @@ alongside ${alternativeName}=${alternativeValue} \
|
||||
return input
|
||||
}
|
||||
|
||||
function parseVersionFile(versionFilePath0) {
|
||||
const versionFilePath = path.resolve(
|
||||
process.env.GITHUB_WORKSPACE,
|
||||
versionFilePath0,
|
||||
)
|
||||
if (!fs.existsSync(versionFilePath)) {
|
||||
throw new Error(
|
||||
`The specified version file, ${versionFilePath0}, does not exist`,
|
||||
)
|
||||
}
|
||||
|
||||
core.startGroup(`Parsing version file at ${versionFilePath0}`)
|
||||
function parseToolVersionsFile(versionFilePath) {
|
||||
const appVersions = new Map()
|
||||
const versions = fs.readFileSync(versionFilePath, 'utf8')
|
||||
// For the time being we parse .tool-versions
|
||||
// If we ever start parsing something else, this should
|
||||
// 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?)?([^ #]+)/)
|
||||
if (appVersion) {
|
||||
const app = appVersion[1]
|
||||
if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) {
|
||||
if (APPS.includes(app)) {
|
||||
const [, , , version] = appVersion
|
||||
core.info(`Consuming ${app} at version ${version}`)
|
||||
appVersions.set(app, version)
|
||||
@@ -787,6 +841,46 @@ function parseVersionFile(versionFilePath0) {
|
||||
return appVersions
|
||||
}
|
||||
|
||||
function parseMiseTomlFile(versionFilePath) {
|
||||
const appVersions = new Map()
|
||||
const miseToml = fs.readFileSync(versionFilePath, 'utf8')
|
||||
const miseTomlParsed = toml.parse(miseToml)
|
||||
for (const app in miseTomlParsed.tools) {
|
||||
if (APPS.includes(app)) {
|
||||
const appVersion = miseTomlParsed.tools[app]
|
||||
const version =
|
||||
typeof appVersion == 'object' ? appVersion.version : appVersion
|
||||
|
||||
core.info(`Consuming ${app} at version ${version}`)
|
||||
appVersions.set(app, version)
|
||||
}
|
||||
}
|
||||
|
||||
return appVersions
|
||||
}
|
||||
|
||||
function parseVersionFile(versionFilePath0) {
|
||||
const versionFilePath = path.resolve(
|
||||
process.env.GITHUB_WORKSPACE,
|
||||
versionFilePath0,
|
||||
)
|
||||
if (!fs.existsSync(versionFilePath)) {
|
||||
throw new Error(
|
||||
`The specified version file, ${versionFilePath0}, does not exist`,
|
||||
)
|
||||
}
|
||||
|
||||
if (versionFilePath0.endsWith('.toml')) {
|
||||
core.startGroup(
|
||||
`Parsing ${path.basename(versionFilePath0)} file at ${versionFilePath0}`,
|
||||
)
|
||||
return parseMiseTomlFile(versionFilePath)
|
||||
}
|
||||
|
||||
core.startGroup(`Parsing .tool-versions file at ${versionFilePath0}`)
|
||||
return parseToolVersionsFile(versionFilePath)
|
||||
}
|
||||
|
||||
function debugLog(groupName, message) {
|
||||
const group = `Debugging for ${groupName}`
|
||||
core.debug(
|
||||
@@ -885,7 +979,7 @@ async function install(toolName, opts) {
|
||||
const otpArch = otpArchitecture()
|
||||
return (
|
||||
'https://github.com/erlang/otp/releases/download/' +
|
||||
`OTP-${toolVersion}/otp_win${_.escapeRegExp(otpArch)}_${toolVersion}.exe`
|
||||
`OTP-${toolVersion}/otp_win${otpArch}_${toolVersion}.exe`
|
||||
)
|
||||
},
|
||||
extract: async () => ['file', 'otp.exe'],
|
||||
@@ -969,12 +1063,14 @@ async function install(toolName, opts) {
|
||||
tool: 'Gleam',
|
||||
linux: {
|
||||
downloadToolURL: () => {
|
||||
const arch = getRunnerOSArchitecture()
|
||||
let gz
|
||||
if (
|
||||
versionSpec === 'nightly' ||
|
||||
semver.gt(versionSpec, 'v0.22.1')
|
||||
) {
|
||||
gz = `gleam-${versionSpec}-x86_64-unknown-linux-musl.tar.gz`
|
||||
const target = arch === 'arm64' ? 'aarch64' : 'x86_64'
|
||||
gz = `gleam-${versionSpec}-${target}-unknown-linux-musl.tar.gz`
|
||||
} else {
|
||||
gz = `gleam-${versionSpec}-linux-amd64.tar.gz`
|
||||
}
|
||||
@@ -1038,7 +1134,26 @@ async function install(toolName, opts) {
|
||||
},
|
||||
},
|
||||
}
|
||||
installOpts.darwin = installOpts.linux
|
||||
installOpts.darwin = {
|
||||
downloadToolURL: () => {
|
||||
const arch = getRunnerOSArchitecture()
|
||||
let gz
|
||||
if (versionSpec === 'nightly' || semver.gt(versionSpec, 'v0.22.1')) {
|
||||
const target = arch === 'arm64' ? 'aarch64' : 'x86_64'
|
||||
gz = `gleam-${versionSpec}-${target}-apple-darwin.tar.gz`
|
||||
} else {
|
||||
gz =
|
||||
arch === 'arm64'
|
||||
? `gleam-${versionSpec}-macos-arm64.tar.gz`
|
||||
: `gleam-${versionSpec}-macos.tar.gz`
|
||||
}
|
||||
|
||||
return `https://github.com/gleam-lang/gleam/releases/download/${versionSpec}/${gz}`
|
||||
},
|
||||
extract: installOpts.linux.extract,
|
||||
postExtract: installOpts.linux.postExtract,
|
||||
reportVersion: installOpts.linux.reportVersion,
|
||||
}
|
||||
break
|
||||
case 'rebar3':
|
||||
installOpts = {
|
||||
@@ -1185,15 +1300,20 @@ function debugLoggingEnabled() {
|
||||
return !!process.env.RUNNER_DEBUG
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
get,
|
||||
getOTPVersion,
|
||||
getElixirVersion,
|
||||
getGleamVersion,
|
||||
getOTPVersion,
|
||||
getRebar3Version,
|
||||
getRunnerOSVersion,
|
||||
getVersionFromSpec,
|
||||
githubAMDRunnerArchs,
|
||||
githubARMRunnerArchs,
|
||||
install,
|
||||
installOTP,
|
||||
maybeInstallElixir,
|
||||
maybeInstallGleam,
|
||||
maybeInstallRebar3,
|
||||
parseVersionFile,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
OTP-26.0 8c0ea6bd3306cfd6ca19730d180a2a93a716e1ee 2026-04-24T21:11:44Z 9210a9e4b3f12cf32dd2f42857dc980e2776d52505c0c34858ef6d50a186dd22
|
||||
OTP-26.0.1 b54b86ad4f1253f46fd4552a73923756660c1d53 2026-04-24T21:10:25Z f1c399db68ea5885434201dd48313bebdccf2222e68268b09214dd3401400faa
|
||||
OTP-26.0.2 d051172925a5c84b2f21850a188a533f885f201c 2026-04-24T21:08:41Z d0260e2f76ddfffa46dfd5090cfb6464eed2aa3f09dfb032b01cd2882a760e10
|
||||
OTP-26.1 e962af35263618665c1df57df5135c0c703ad502 2026-04-24T20:58:59Z 623ea1623afbb19feeb257fdc92d17a82a35a8ecea32925c0c89a2a6d3dd9853
|
||||
OTP-26.1.1 2bdd30b872ab91dc376998d2c417f2a8b514d1aa 2026-04-24T20:42:54Z 68eb1802931e87c70c9ea8bcc6de68062785cd6c67abc0696f2e07803403f12c
|
||||
OTP-26.1.2 c41d424db42ba84b72f3e25167470c3555723d87 2026-04-24T20:41:58Z 6851172f8d6bbeed99e9aeb73dc0e8df4cdfb69ec4275ccfbd6c85d402786608
|
||||
OTP-26.2 7fc0898502cb3370b7c6d523a7393cd101808493 2026-04-24T20:40:23Z 8c0f14ec76b26ca0a8bc7fe1d536b3edc7513ab48096d5c09452953140a01f61
|
||||
OTP-26.2.1 ca8b893f9d5bdd0957b78514ba523032e762c644 2026-04-24T20:29:53Z 7569ff704e74b681825dd14577ec4784a43822da84e2590fc93d13160cd71716
|
||||
OTP-26.2.2 b83df13eec5446beab06dd24315d37a5b0633fd2 2026-04-24T20:13:25Z 85c443095df61087f288601af92af7c07f7190570a4aa55eee9114a2d00ccf2b
|
||||
OTP-26.2.3 928d03e6da416208fce7b9a7dbbfbb4f25d26c37 2026-04-24T20:12:42Z 067b97c62cc5bc4753dedc7e63f1b6503bc02e89d67eda49c1c23ba9e54beaa4
|
||||
OTP-26.2.4 e26c5206dc98ec1b8f978fceaa61fd1354266ccb 2026-04-24T20:11:19Z f6a83da7f5fab9285d1c3e5731dcd65b6a93a5f7285fe4ef08e9c2347d241b30
|
||||
OTP-26.2.5 412bff5196fc0ab88a61fe37ca30e5226fc7872d 2026-04-24T20:00:51Z 53ab42240cbacaa9e33682527abf7991cde3653401a2216f0f83e26cb50a9f8b
|
||||
OTP-26.2.5.1 858efd5b35b572c71a8010ad323c4127eef5bc29 2026-04-24T19:43:57Z 833b9a2e7955e3d09d872ba821fa8eb1fbad55e63ef119209e93bd445d82f90d
|
||||
OTP-26.2.5.10 f607645b971572b03f9f45551b1804f41fac8fa7 2026-04-24T18:43:56Z c0023d40d000daddd979b494172c0ba51c33857082e598d962448ed3c617f568
|
||||
OTP-26.2.5.11 9f6c4eb54823324d1e6f8cb95c15feb09f09044e 2026-04-24T18:43:17Z 500f8aa1a0784c17715e6bcc10ea9761cc56ad196c335e4c90909e0e4a05c075
|
||||
OTP-26.2.5.12 7335f79eeaa0094c274dab2aa2ced9e138027c75 2026-04-24T18:31:47Z 1c6deef6d752ed7b838820b973be5078f2f110daa9208c9a29a59709787126da
|
||||
OTP-26.2.5.13 0ac548b57c0491196c27e39518b5f6acf9326c1e 2026-04-24T18:14:48Z 325b0c25d2981d064edce1188c7583e02f89b366a22571299461b62b323f6cea
|
||||
OTP-26.2.5.14 c1ce39f1f7bafa253514a8fa646dc00112b066bb 2026-04-24T18:14:10Z 0aa90ffab8371e2f32114564254eb2c706aefa6163107739301e7373db4a3dc0
|
||||
OTP-26.2.5.15 4d9b61940e8d4dd00059306983022e3114fdf245 2026-04-24T18:13:42Z b25e8597f9e9fa21c7ccdcea268370ef0eec3897be46975cb128c34072d3ddb9
|
||||
OTP-26.2.5.16 ce72bbc20a4236d69ac716624ccb799921ac5903 2026-04-24T18:02:15Z 84b96e04576832cbebcc98bae783152efb290d09913de160ab926b00a0e0dc9e
|
||||
OTP-26.2.5.17 3532818e19647ae5675396eb501400783e5ca693 2026-04-24T17:45:04Z 15b674046eefa090491609f151f9d7f9c3eb355d38bbd4bf34108f09c373cae2
|
||||
OTP-26.2.5.18 8c304e09e4d9301f56f6d7b2c4c9f60b4f9d9425 2026-04-24T17:44:16Z 795ca3e87bda7564182f9f5a9c1450c00f719d64e26ce5e2dca905ecb83e5437
|
||||
OTP-26.2.5.19 cdb375af6b456946b1ff3fc993d122018f20b031 2026-04-24T17:43:44Z 33603c379bef7f41a459bfea2c308d885f38118fc67430fd1745fbd22a3b72b7
|
||||
OTP-26.2.5.2 c1805ad6200cec57bf86640fb9a1c715db515b78 2026-04-24T19:43:13Z 18d7bafd68d9030144632674e2d2c08285d6c5ce3ae210af4e8642f83d8f5e37
|
||||
OTP-26.2.5.20 e5d6d95c9aac559b59b78c66eb558ee54bd4e006 2026-04-24T17:33:05Z f11bea66d601ff23affb32158d18b209e6e475a063706572c3be835e6edd9fdc
|
||||
OTP-26.2.5.21 c9ce879f4ca194adc5393f52b2c4cd57b3c3d89d 2026-05-31T16:45:05Z 98897de6d71ef8c5542c822598a538f3269a32c56d819fdb69858fbe7329e403
|
||||
OTP-26.2.5.3 84152c2c9d85128d3cce471f645f154c34132d82 2026-04-24T19:42:01Z ea3e17728b77b1cd7c7386e0fe5fe927f26f772e595930f09bc70abde6365115
|
||||
OTP-26.2.5.4 b6e7e233d0b781728e745dc04f4cb2645c6632ec 2026-04-24T19:31:30Z 753f5b0fcb908fa0b7a1e00234feea24ae71e5ed9f73284b501ae089f202ce59
|
||||
OTP-26.2.5.5 57f154f5ceb592ffa5360f7e338577fa04aa0d5f 2026-04-24T19:14:05Z 6e16453c2e32f7c8e81f26a0aa7ba6bd2cbeeaaebe8c174518cce813d4938931
|
||||
OTP-26.2.5.6 51548614b588c667a4230c17e2b187474dd70d63 2026-04-24T19:13:25Z 1867dc3687b07bac702247c02cd8284d0b5175ebf0aa3b069f86394cbdfabc4a
|
||||
OTP-26.2.5.7 3b059b6caf4e087c8c207ae7012bb50736fdf18c 2026-04-24T19:12:19Z 6259f7e5dcfe4fa0808ae09a06d43492c8b8f21215ca07a1e510ed4e01e2859c
|
||||
OTP-26.2.5.8 a7a875106c7af7f094b04a765e93dd90522ef7da 2026-04-24T19:01:05Z 2f5c1866af6bab64e4c49c05536e0acd687545809368c0bc7859af7c90477d0d
|
||||
OTP-26.2.5.9 a2da0bad3f2d49dc1878f46f2d2961144ae0e0cb 2026-04-24T18:44:30Z 600704ad8c34abf66cda2e013ce4e386c8439d63b4c4d1522b74286a5ceea7b0
|
||||
OTP-27.0 601a012837ea0a5c8095bf24223132824177124d 2026-04-24T17:05:00Z 98ad5cbd4a74cee15697b8cf973afd6c39264d104206aab6bc4864cad97c37cd
|
||||
OTP-27.0-rc1 b74bd21d5cb52e0fdc5ea321439c428783feea23 2026-04-24T17:15:43Z 587a51911d99d2696c020a9dd73fedd37172c955a3c3b5e700614a601df35f43
|
||||
OTP-27.0-rc2 e651174c569694c92b1794ddd0a1a4a199610091 2026-04-24T17:14:33Z 5c8928cd68e1c86b65a7f771201d0135aa2616ea28aecd9fba03b5e4ccc7ae4f
|
||||
OTP-27.0-rc3 5df3992d695da4d7e8777cf7605279ce9d131f1c 2026-04-24T17:14:17Z 62604f6c2a4345f452f82122aee67afd5d366c4a04cb9aa52cd3ad18ce5b32ea
|
||||
OTP-27.0.1 ee9628e7ed09ef02e767994a6da5b7a225316aaa 2026-04-24T17:02:00Z a854f39d318ba6133c41ba9275b2d1613e85bc8446086998dd927c7ff8d22fa9
|
||||
OTP-27.1 9ae2ef54fc6dacb5bfbe2dc6fc6f2522d57ce1fb 2026-04-24T17:00:08Z 80df8276b9d03827cab3b9989d08acf6f98dc65f025deae0554de377f3472618
|
||||
OTP-27.1.1 f4d130fd3512875ee95ce05b30f77e7c7689915f 2026-04-24T17:00:04Z b6a9963e6c02e5cf6338248ef20328c0a6974f8ecfc3ecc606656bead6567451
|
||||
OTP-27.1.2 44ffe8811dfcf3d2fe04d530c6e8fac5ca384e02 2026-04-24T16:51:20Z 6a7ebd11ebc4998c658eb1738c4f91ae262809814dc22705d5a2e19118935ae2
|
||||
OTP-27.1.3 800613cca84970750658b294ddd7977843b3bc5d 2026-04-24T16:47:44Z 50ed511fb2a63cecdbaff83377119e63a93b8ae4276322fadf5204a112696920
|
||||
OTP-27.2 6bf99d64a0df3feceb25c166c3a3cb3f80594f59 2026-04-24T16:45:54Z b44c23696d0e97d440a0565f9a8c8438c44908efa008e7642bfd7402390a0b12
|
||||
OTP-27.2.1 4726e39654c7a7412f7c2f66c7eb567c978a9947 2026-04-24T16:45:47Z 38282ac000f0278d99cbe379b4f7f67e3ddda96e2be3eea5cce2b7e3eac34c6d
|
||||
OTP-27.2.2 8a4e04e9c48d94ef1216b0426fa71ccfdd78f7d3 2026-04-24T16:37:48Z 1935890b96e104a4545b50ba3184c74a7820438425966ea6637ca6777f981804
|
||||
OTP-27.2.3 b6ab3a385ec72e346a44807d53e2109a51cde613 2026-04-24T16:34:00Z bde8c6311cc8242481dad5f1e3f33c920a1be71885fa8e779d9a006fb8cc0764
|
||||
OTP-27.2.4 fc23816894479e0da3a22faaf90c16db3071ade5 2026-04-24T16:31:37Z a560882f429d425c2acc96c634b8ae05eb7b317beca0981e2b8f6ae1a324cb79
|
||||
OTP-27.3 05737d130706c7189a8e6750d9c2252d2cc7987e 2026-04-24T16:31:34Z 8375d270d91a93fb00c4bb472fe3865575b76d7b602c373080c8c7e345d19734
|
||||
OTP-27.3.1 76266a91989378ce53159eee4bd16773e248f5f3 2026-04-24T16:24:17Z ef2a695e00f6fb661d59592448574a9e44e763252d957a48afeaeabf966adf78
|
||||
OTP-27.3.2 7b8942ef7b540bbd1393999e56d0e96b6ab3c276 2026-04-24T16:20:13Z c3c94d3abeea1438abf957bc2b707b1cefdef6b6e3f807440be7eb961d74dde5
|
||||
OTP-27.3.3 10e20b1dbe39b056fab430e50b08cb4f3696ae87 2026-04-24T21:22:04Z bce0743ff5eac77d07217f8c2e624b703c44c2e83d987f3202f7bb9e69348dfa
|
||||
OTP-27.3.4 c388a2d1b3f9918652276d4798692dd4d8ef97fc 2026-04-24T16:17:08Z e3325746961fb1280848038ff06c4cfc2b903cf793f9113303aaf8e43f6e2c7e
|
||||
OTP-27.3.4.1 9b7b5431260e05a16eec3ecd530a232d0995d932 2026-04-24T16:03:35Z 40475e473e5d9e45edce59ec13442ee43062ad8a0380280253d10312623df9c1
|
||||
OTP-27.3.4.10 0aa261a7765c9698aabc7f7c5be878a8850a9c5f 2026-04-24T15:30:13Z c8d7b7d8a0a0a338304b6919bb1b4934bf553fcf8bf7a7e5719634f4077492d0
|
||||
OTP-27.3.4.11 c0ce26bb20ab5fcd6e214fa285aec5a409772e61 2026-04-24T15:30:00Z ebccce035c0b3d890f72ae6868a7bbbbc8530147158df206bff12a448793cc16
|
||||
OTP-27.3.4.12 a2394acad3e3b8fa74d40905cb79bac2ab68258a 2026-05-31T15:52:31Z 6ea6ce3c3195a5a8b190a1f96b8f2b78d9ec3383218e37ef68a7882c5531335b
|
||||
OTP-27.3.4.13 f835a5a32aeeb70778c958b5c01a401973e8fbe2 2026-06-10T13:08:02Z 8f4feb43f4370f8d2e47ceaa572fdeb20c726b831c3eb4a4b3fdc241e9db9884
|
||||
OTP-27.3.4.2 ccff5995c5adf4b5f54adee7ba1a5948053384f9 2026-04-24T16:10:44Z e14df30b6e0422f64b5ac4896c2d4957ec7a87e3c23bf3f1f1a4407e28a3e040
|
||||
OTP-27.3.4.3 940ec0f6f0370ecf5cd93cae31fd91f4651ddca6 2026-04-24T16:04:51Z d2f8046e4be2f4be98af4eeb584fb17affe9421e1a4a0b7d7ae938f20253abb7
|
||||
OTP-27.3.4.4 3a2e1c435fe547a93b1a8c27c2554da72b49f16d 2026-04-24T16:07:12Z 371ec67c2ae4e389737c0d16a44288103407f075a6a4aef9afd02ba43eae6040
|
||||
OTP-27.3.4.5 36239aebc3bc6b873da9ea519c41fb3befbc518d 2026-04-24T15:49:38Z aab9a6bac28cf7c1d3800f8201d02953753415119716ca6a80b103ffd9d22160
|
||||
OTP-27.3.4.6 f1b17a1fb4d2bc74501608852547f8d9b504f7e3 2026-04-24T15:52:26Z a278a261c37fd3f32d8c04240e99d258103857d6af15fd7ad201c6aa0a1ffd1a
|
||||
OTP-27.3.4.7 e56f9815d9f9389768afa2bc45c7233a7db838fd 2026-04-24T15:47:46Z c03da29e8eae9fe36c74976c13bd027f0eeea7713a7dd8c96bb823f1674b2131
|
||||
OTP-27.3.4.8 61633c62611720cc27f92026d075a1f2862ce522 2026-04-24T15:50:33Z a8c645b6720463f4fea2d13e2c5f677a628c6fac6480d7588ae3d63d2dc8a0d6
|
||||
OTP-27.3.4.9 4aa809ae4eb4a20ad89c23837376acf179877f39 2026-04-24T15:43:28Z 1d00d44c7ea910e6f828dffef1d386cc86c18f98e0260c72bfb23c54dc915e04
|
||||
OTP-28.0 9e6f6742c4d9e9915ee8af0dcb7d97cf1f836116 2026-04-24T21:19:07Z b54d35fc7df5f9045694f7d855126effca8b5fc440df7b9ecd269a7eb0b37a98
|
||||
OTP-28.0-rc1 74ed6b0ed20da257f11fc64399a1c8dd4f967fe7 2026-04-24T15:28:16Z 25591d8a6e3b97b8a8fa39e46015084b5fbab99a359be6fd28477f4ef4149cd8
|
||||
OTP-28.0-rc2 b7c33191648c8b280c3bc8baf5434b125e88f0ef 2026-04-24T15:16:49Z 95cd0eb89ce5e27f1fe2a190d569e2cb875558ed8a3cecbe0a0045b33f5c993f
|
||||
OTP-28.0-rc3 feae4e669818cb794a1755036c1b11f672634f8f 2026-04-24T15:16:46Z ba9e38b3d3299cd80a0a14770d3c167e0575a721638e2d68232443868aa0999e
|
||||
OTP-28.0-rc4 56f63ad95cd71ee00b535e6db4e8be180baa6066 2026-04-24T15:15:45Z 016dc114bf08f7c7698c472603c47d70ef56d8cf147dd9d2f6b7aca6958e9fbf
|
||||
OTP-28.0.1 d9454dbccbaaad4b8796095c8e653b71b066dfaf 2026-04-24T15:03:16Z 7329d39b4008ecb35769a2f8cb5f92832c465767d5bc8131caa7708fb00acbd1
|
||||
OTP-28.0.2 d04f6a0b261cf23e316e48e2febe14b30c592dc5 2026-04-24T15:03:05Z bd8ed588c263d5f7f27371718265582cd9d87e04d8a3c72e87831601132d4420
|
||||
OTP-28.0.3 756621cebe01ec43df61d9627380ca7e1e301c9b 2026-04-24T15:02:47Z 0ad74c4a455cad900aa56bde2c04dc4dfa46c0c0217afc440786f83547ba6df0
|
||||
OTP-28.0.4 eec5ff40a2ae2c3b3c6d952709ba4f16a6769024 2026-04-24T14:47:33Z 19aa151e9e2a610fddc018066ffd7ec98162a8a021184f70a2771127e665ca58
|
||||
OTP-28.1 34316363201de07437e14e79ef559fde7becb0ee 2026-04-24T14:47:30Z c9728fc7975d03e8a3299ed6e564c62dd9a2d130420f6066d1c2f179f01c390e
|
||||
OTP-28.1.1 b2e2bc472deeb5deb6fcddf7406364e42f6c3d0a 2026-04-24T14:47:26Z 07514587f9187cc75abf7759310332e95a4b6ac9b2fa0e2de919f3b8bb9c1406
|
||||
OTP-28.2 dff037f64e8eaa0a591866e967ee2b7164329376 2026-04-24T14:47:14Z b0cd18e0d5e09ba12e37cd5944ec8c6aceb0266583fb4209f144bcac4494ba44
|
||||
OTP-28.3 ab489c0b260c637a9487f8753909ea94dacbbec2 2026-04-24T14:31:40Z 401b8ef30f50587488f884da7d1f61d67638d71cad4496fea2d196479124e9c5
|
||||
OTP-28.3.1 aa5b1d3366762ff8f420f2aa6a52604b481530c9 2026-04-24T14:31:36Z 04e88c160c3b55eea59175798b52745e111ba36649cbc6d35f947e8e8b413a33
|
||||
OTP-28.3.2 b74eae92e1dee97d57a9ab3ea3c36e8b701a9ca6 2026-04-24T14:31:29Z ea8be9b0a374602b080570eb0244720d643ecb54ff7611a9f3945c116087d2c6
|
||||
OTP-28.3.3 dfd646eef0dd6b1f3674a7b6c7c7ff944939139b 2026-04-24T14:31:21Z 34b0dd70b1eb74b9de0ed82f69b6db664f6d90e603cfcfa3d3c060f65b7777bc
|
||||
OTP-28.4 927bcc220b923ba1fef574618e82a3b7a2a4471d 2026-04-24T14:16:07Z 257e53beb1143154a80a7c2454261d6abd824b09629d79b99eb4588804247557
|
||||
OTP-28.4.1 c8fca7e34e4db5d977ccf292cc2490ddb05b5879 2026-04-24T14:15:55Z 73eba3639b9873c267b7f4df62078d6f22b146882fd6d5241dbab3be9e0b616c
|
||||
OTP-28.4.2 002fa5032baa0f6a8c4587c81f60e3273775a4d1 2026-04-24T14:15:52Z 1e25cfb65127e2e94913482a2486d38b5ce44c59b1c2858689df9de31a5ddcbd
|
||||
OTP-28.4.3 359d91e66ffdede8f7855565087d324581c28f2e 2026-04-24T14:15:47Z 81d53e2ec4230b521b2f66ac64458e66cd634b2f205ee59e72ea54733644f0d0
|
||||
OTP-28.5 f4506ee46d68694a1d23ca81c314092fd83e8f85 2026-04-24T14:00:14Z 6deadb6b6252376aaac89e5c837c72ec24c44bf3025856ade71d3c14afe66014
|
||||
OTP-28.5.0.1 5770157eabdd4e8b0b83d64fd8b207c0150c2b64 2026-05-31T15:14:41Z 9fa866ad9abea5807b77919c27be3bbbe3806b4998abf6350d06e42068e290ec
|
||||
OTP-28.5.0.2 4567096bddd1ecddb7c973019ca7e769f486aa8f 2026-06-10T10:54:11Z 01b02af31fb20937b146cf68a2a3ee5b129c45be5f74e65b101058d5650c1dc8
|
||||
OTP-29.0 550d7b7898706c7822362c42e7b93120c1d1f29a 2026-05-13T09:41:44Z d20385dfafb49ef36303858c7577de8d8931102b6482fcbbdd83991638c122bd
|
||||
OTP-29.0-rc1 04f1ebb18053d48f18e2a52e6ebe09b5f3d25580 2026-04-24T14:00:36Z b0a44585175f50d1170e0dd5606b3a502bbd82ce8d61daebe294b6c97812408b
|
||||
OTP-29.0-rc2 92322002e7287640f7615fed89a677505b44bfdd 2026-04-24T14:00:19Z b952e731d7ee6d51822d2d261c809a2d4464efd1a87463bcf2c7f4495e7431e6
|
||||
OTP-29.0-rc3 7721ab7462a426c107964b0f1e47207475e085e3 2026-04-24T13:59:40Z 83ecffb614710e05867ba28175e2b9e90d0b68157bf8c1c83793d7d75d5b6d97
|
||||
OTP-29.0.1 f26c7e590c5d1b3afa0dee38093442df117822e3 2026-05-31T14:36:40Z 05b41f99f8d4eeb6944d0201054bc38edb293503353f676df3afbf1042475486
|
||||
OTP-29.0.2 36b336d7675edfb976768465c5067bc8bc16ee9a 2026-06-10T08:39:21Z 905919b09cf6c27decdabc4367af81a9ed248acd340a4b80fa55c3df14489093
|
||||
maint d31b060b5c25715a47cc3611be7ef017c341bcd5 2026-06-11T13:02:03Z dd981f09ae93c4030de6a33f65b655e3257cfe15477d6a83c61d79317e298905
|
||||
maint-27 f835a5a32aeeb70778c958b5c01a401973e8fbe2 2026-06-10T13:02:32Z 4e3ea4facd9f5f8023628412f35a4ec13991cb5879093de99692002b187a94ff
|
||||
maint-28 4567096bddd1ecddb7c973019ca7e769f486aa8f 2026-06-10T10:48:53Z 0656c4606790a6d84faef3b1c46cba705de9e6a7dea4787d3fdeb0dc3d738721
|
||||
maint-29 36b336d7675edfb976768465c5067bc8bc16ee9a 2026-06-10T08:33:37Z 3d7b337c4b2ba12d797c493154a79ee32ae7a8f156b14f943b9216b47e77af4f
|
||||
master 56f75c4dd241431978e6e13788822e4c1a18b0f7 2026-06-11T13:02:03Z 493650afcdeead215e8a10c16605a430e64c24fc4476ba90aa69cf5e0f314279
|
||||
+869
-72
File diff suppressed because it is too large
Load Diff
+388
-129
@@ -1,3 +1,17 @@
|
||||
import assert from 'node:assert'
|
||||
import http from 'node:http'
|
||||
import fs from 'node:fs'
|
||||
import os from 'node:os'
|
||||
import path from 'node:path'
|
||||
import { describe, it } from 'node:test'
|
||||
import * as csv from 'csv-parse/sync'
|
||||
import elixirMatchers from '../matchers/elixir-matchers.json' with { type: 'json' }
|
||||
import erlangMatchers from '../matchers/erlang-matchers.json' with { type: 'json' }
|
||||
const { problemMatcher } = elixirMatchers
|
||||
const { problemMatcher: erlangProblemMatcher } = erlangMatchers
|
||||
|
||||
process.env.NODE_ENV = 'test'
|
||||
|
||||
simulateInput('otp-version', '25.1.2')
|
||||
simulateInput('otp-architecture', '64')
|
||||
simulateInput('elixir-version', '1.14.2')
|
||||
@@ -7,15 +21,7 @@ simulateInput('install-hex', 'true')
|
||||
simulateInput('github-token', process.env.GITHUB_TOKEN)
|
||||
simulateInput('hexpm-mirrors', 'https://builds.hex.pm', { multiline: true })
|
||||
|
||||
const assert = require('assert')
|
||||
const http = require('http')
|
||||
const fs = require('fs')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const setupBeam = require('../src/setup-beam')
|
||||
const { problemMatcher } = require('../matchers/elixir-matchers.json')
|
||||
const { describe, it } = require('node:test')
|
||||
const csv = require('csv-parse/sync')
|
||||
const { default: setupBeam } = await import('../src/setup-beam.js')
|
||||
|
||||
const matrix = {
|
||||
otp: {
|
||||
@@ -23,6 +29,7 @@ const matrix = {
|
||||
'ubuntu-20.04': parseBuild('test/otp/ubuntu-20.04/builds.txt'),
|
||||
'ubuntu-22.04': parseBuild('test/otp/ubuntu-22.04/builds.txt'),
|
||||
'ubuntu-24.04': parseBuild('test/otp/ubuntu-24.04/builds.txt'),
|
||||
'ubuntu-26.04': parseBuild('test/otp/ubuntu-26.04/builds.txt'),
|
||||
windows: parseReleases('test/otp/releases.json'),
|
||||
'macos-aarch64': parseCsv('test/otp/macos/aarch64-apple-darwin.csv'),
|
||||
'macos-x86_64': parseCsv('test/otp/macos/x86_64-apple-darwin.csv'),
|
||||
@@ -75,7 +82,7 @@ describe('OTP install', () => {
|
||||
const otpOSVersion = 'ubuntu-08.04'
|
||||
const otpVersion = 'OTP-23.2'
|
||||
|
||||
assert.rejects(
|
||||
await assert.rejects(
|
||||
async () => {
|
||||
await setupBeam.install('otp', {
|
||||
hexMirror: 'https://builds.hex.pm',
|
||||
@@ -95,7 +102,7 @@ describe('OTP install', () => {
|
||||
describe('Elixir install', () => {
|
||||
it('fails for version 0.11 without OTP', async () => {
|
||||
const exVersion = '0.11'
|
||||
assert.rejects(
|
||||
await assert.rejects(
|
||||
async () => {
|
||||
await setupBeam.install('elixir', {
|
||||
hexMirror: 'https://builds.hex.pm',
|
||||
@@ -112,7 +119,7 @@ describe('Elixir install', () => {
|
||||
|
||||
it('fails for version 1.0.0 on OTP 17 (without OTP)', async () => {
|
||||
const exVersion = 'v1.0.0-otp-17'
|
||||
assert.rejects(
|
||||
await assert.rejects(
|
||||
async () => {
|
||||
await setupBeam.install('elixir', {
|
||||
hexMirror: 'https://builds.hex.pm',
|
||||
@@ -131,7 +138,7 @@ describe('Elixir install', () => {
|
||||
describe('Gleam install', () => {
|
||||
it('fails for unknown OTP', async () => {
|
||||
const gleamVersion = '0.1.3'
|
||||
assert.rejects(
|
||||
await assert.rejects(
|
||||
async () => {
|
||||
await setupBeam.install('gleam', { gleamVersion })
|
||||
},
|
||||
@@ -147,7 +154,7 @@ describe('Gleam install', () => {
|
||||
describe('rebar3 install', () => {
|
||||
it('fails for unknown OTP', async () => {
|
||||
const r3Version = '0.14.4'
|
||||
assert.rejects(
|
||||
await assert.rejects(
|
||||
async () => {
|
||||
await setupBeam.install('rebar3', { r3Version })
|
||||
},
|
||||
@@ -171,23 +178,20 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
'https://repo.hex.pm, https://cdn.jsdelivr.net/hex',
|
||||
{ multiline: true },
|
||||
)
|
||||
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||
|
||||
if (process.platform === 'linux') {
|
||||
process.env.RUNNER_ARCH = 'X64'
|
||||
|
||||
it('is Ok for known linux version', async () => {
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '26'
|
||||
spec = '27.0'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
expected = 'maint-26'
|
||||
expected = 'OTP-27.0'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '27.0'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
osVersion = 'ubuntu-26.04'
|
||||
expected = 'OTP-27.0'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
@@ -201,21 +205,21 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
|
||||
spec = '19.3.x'
|
||||
osVersion = 'ubuntu-16.04'
|
||||
expected = 'OTP-19.3.6.13'
|
||||
spec = '20.3.x'
|
||||
osVersion = 'ubuntu-20.04'
|
||||
expected = 'OTP-20.3.8.26'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '^19.3.6'
|
||||
osVersion = 'ubuntu-16.04'
|
||||
expected = 'OTP-19.3.6.13'
|
||||
spec = '^20.3.8'
|
||||
osVersion = 'ubuntu-20.04'
|
||||
expected = 'OTP-20.3.8.26'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '^19.3'
|
||||
osVersion = 'ubuntu-18.04'
|
||||
expected = 'OTP-19.3.6.13'
|
||||
spec = '^20.3'
|
||||
osVersion = 'ubuntu-20.04'
|
||||
expected = 'OTP-20.3.8.26'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
@@ -278,7 +282,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '23.0'
|
||||
osVersion = 'windows-2019'
|
||||
osVersion = 'windows-2022'
|
||||
expected = '23.0.4'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
@@ -299,7 +303,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '23.0'
|
||||
osVersion = 'windows-2019'
|
||||
osVersion = 'windows-2022'
|
||||
expected = '23.0.4'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
@@ -309,19 +313,48 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
}
|
||||
|
||||
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 previousRunnerArch = process.env.RUNNER_ARCH
|
||||
process.env.RUNNER_ARCH =
|
||||
arm64Options[Math.floor(Math.random() * arm64Options.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)
|
||||
await assert.rejects(
|
||||
async () => {
|
||||
await setupBeam.getOTPVersion('27', 'ubuntu-24.04')
|
||||
},
|
||||
(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', '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()
|
||||
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||
process.env.RUNNER_ARCH =
|
||||
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '27.0'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
@@ -379,21 +412,16 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
expected = 'master'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
process.env.RUNNER_ARCH = previousRunnerArch
|
||||
})
|
||||
|
||||
it('is Ok for known linux AMD64 version', async () => {
|
||||
const amd64Options = setupBeam.githubAMDRunnerArchs()
|
||||
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||
process.env.RUNNER_ARCH =
|
||||
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')
|
||||
spec = '27.0'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
@@ -469,12 +497,45 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
expected = 'master'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
process.env.RUNNER_ARCH = previousRunnerArch
|
||||
})
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
it('is main-... only if strict/maint-... is used as input', async () => {
|
||||
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||
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 () => {
|
||||
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||
process.env.RUNNER_ARCH =
|
||||
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||
|
||||
@@ -485,10 +546,13 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
|
||||
process.env.RUNNER_ARCH = previousRunnerArch
|
||||
})
|
||||
|
||||
it('is Ok for known macos AMD64 version', async () => {
|
||||
const amd64Options = setupBeam.githubARMRunnerArchs()
|
||||
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||
process.env.RUNNER_ARCH =
|
||||
amd64Options[Math.floor(Math.random() * amd64Options.length)]
|
||||
|
||||
@@ -499,11 +563,12 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
|
||||
process.env.RUNNER_ARCH = previousRunnerArch
|
||||
})
|
||||
}
|
||||
|
||||
simulateInput('hexpm-mirrors', hexMirrors, { multiline: true })
|
||||
process.env.RUNNER_ARCH = previousRunnerArch
|
||||
})
|
||||
|
||||
describe('OTP arch-specific install', () => {
|
||||
@@ -515,7 +580,7 @@ describe('OTP arch-specific install', () => {
|
||||
const spec = '26'
|
||||
const osVersion = 'ubuntu-24.04'
|
||||
|
||||
assert.rejects(
|
||||
await assert.rejects(
|
||||
async () => {
|
||||
await setupBeam.getOTPVersion(spec, osVersion)
|
||||
},
|
||||
@@ -526,87 +591,114 @@ describe('OTP arch-specific install', () => {
|
||||
`Fetching OTP Version with invalid Github runner architecture is supposed to fail`,
|
||||
)
|
||||
}
|
||||
|
||||
process.env.RUNNER_ARCH = previousRunnerArch
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getRunnerOSVersion(_)', () => {
|
||||
it('maps x86 ImageOS values to their container', async () => {
|
||||
const previousImageOS = process.env.ImageOS
|
||||
|
||||
process.env.ImageOS = 'ubuntu22'
|
||||
assert.strictEqual(setupBeam.getRunnerOSVersion(), 'ubuntu-22.04')
|
||||
|
||||
process.env.ImageOS = 'ubuntu24'
|
||||
assert.strictEqual(setupBeam.getRunnerOSVersion(), 'ubuntu-24.04')
|
||||
|
||||
process.env.ImageOS = previousImageOS
|
||||
})
|
||||
|
||||
it('maps arm64 ImageOS variants to the same container as x86', async () => {
|
||||
const previousImageOS = process.env.ImageOS
|
||||
|
||||
process.env.ImageOS = 'ubuntu22-arm64'
|
||||
assert.strictEqual(setupBeam.getRunnerOSVersion(), 'ubuntu-22.04')
|
||||
|
||||
process.env.ImageOS = 'ubuntu24-arm64'
|
||||
assert.strictEqual(setupBeam.getRunnerOSVersion(), 'ubuntu-24.04')
|
||||
|
||||
process.env.ImageOS = previousImageOS
|
||||
})
|
||||
|
||||
it('throws for genuinely unknown ImageOS values', async () => {
|
||||
const previousImageOS = process.env.ImageOS
|
||||
|
||||
process.env.ImageOS = 'plan9'
|
||||
assert.throws(
|
||||
() => setupBeam.getRunnerOSVersion(),
|
||||
/Tried to map a target OS/,
|
||||
)
|
||||
|
||||
process.env.ImageOS = previousImageOS
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getOTPVersion(_) - Elixir', () => {
|
||||
let got
|
||||
let expected
|
||||
let spec
|
||||
let otpVersion
|
||||
let before
|
||||
const hexMirrors = simulateInput('hexpm-mirrors', 'https://repo.hex.pm', {
|
||||
multiline: true,
|
||||
})
|
||||
|
||||
it('returns the expected value', async () => {
|
||||
spec = '1.1.x'
|
||||
otpVersion = 'OTP-17'
|
||||
expected = 'v1.1.1-otp-17'
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
if (process.platform === 'linux') {
|
||||
it('returns the expected value', async () => {
|
||||
spec = '1.18.x'
|
||||
otpVersion = 'OTP-27'
|
||||
expected = 'v1.18.4-otp-27'
|
||||
await setupBeam.installOTP(otpVersion)
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '1.10.4'
|
||||
otpVersion = 'OTP-23'
|
||||
expected = 'v1.10.4-otp-23'
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
spec = '1.18.2'
|
||||
otpVersion = 'OTP-27'
|
||||
expected = 'v1.18.2-otp-27'
|
||||
await setupBeam.installOTP(otpVersion)
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '1.16.2-otp-26'
|
||||
otpVersion = 'OTP-27'
|
||||
expected = 'v1.16.2-otp-26'
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
spec = '1.16.2-otp-26'
|
||||
otpVersion = 'OTP-27'
|
||||
expected = 'v1.16.2-otp-26'
|
||||
await setupBeam.installOTP(otpVersion)
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '1.12.1'
|
||||
otpVersion = 'OTP-24.0.2'
|
||||
expected = 'v1.12.1-otp-24'
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
spec = '1.12.1'
|
||||
otpVersion = 'OTP-24.3.4'
|
||||
expected = 'v1.12.1-otp-24'
|
||||
await setupBeam.installOTP(otpVersion)
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '1.14.0'
|
||||
otpVersion = 'main'
|
||||
expected = 'v1.14.0'
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '1.19'
|
||||
otpVersion = 'master'
|
||||
expected = 'v1.19-otp-28'
|
||||
await setupBeam.installOTP(otpVersion)
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = 'v1.11.0-rc.0'
|
||||
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.15.0-rc.2'
|
||||
otpVersion = 'OTP-26.0'
|
||||
expected = 'v1.15.0-rc.2-otp-26'
|
||||
await setupBeam.installOTP(otpVersion)
|
||||
got = await setupBeam.getElixirVersion(spec, 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)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = 'main'
|
||||
otpVersion = '23.1'
|
||||
expected = 'main-otp-23'
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
})
|
||||
|
||||
simulateInput('hexpm-mirrors', hexMirrors, { multiline: true })
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = 'main'
|
||||
otpVersion = '25.2'
|
||||
expected = 'main-otp-25'
|
||||
await setupBeam.installOTP(otpVersion)
|
||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
simulateInput('version-type', before)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
describe('.getOTPVersion(_) - Gleam', () => {
|
||||
@@ -622,6 +714,12 @@ describe('.getOTPVersion(_) - Gleam', () => {
|
||||
got = await setupBeam.getGleamVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = 'nightly'
|
||||
otpVersion = '28'
|
||||
expected = 'nightly'
|
||||
got = await setupBeam.getGleamVersion(spec, otpVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '0.13.2'
|
||||
otpVersion = 'OTP-24'
|
||||
expected = 'v0.13.2'
|
||||
@@ -644,18 +742,18 @@ describe('.getOTPVersion(_) - rebar3', () => {
|
||||
let spec
|
||||
|
||||
it('returns the expected value', async () => {
|
||||
spec = '3.10.x'
|
||||
expected = '3.10.0'
|
||||
spec = '3.26.x'
|
||||
expected = '3.26.0'
|
||||
got = await setupBeam.getRebar3Version(spec)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '3.11'
|
||||
expected = '3.11.1'
|
||||
spec = '3.25'
|
||||
expected = '3.25.1'
|
||||
got = await setupBeam.getRebar3Version(spec)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '3.10'
|
||||
expected = '3.10.0'
|
||||
spec = '3.26'
|
||||
expected = '3.26.0'
|
||||
got = await setupBeam.getRebar3Version(spec)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
})
|
||||
@@ -875,16 +973,36 @@ describe('.getVersionFromSpec(_)', () => {
|
||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-20.04'])
|
||||
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'
|
||||
expected = 'OTP-27.0-rc3'
|
||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-22.04'])
|
||||
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'
|
||||
expected = 'OTP-27.0'
|
||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-24.04'])
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = '> 0'
|
||||
expected = 'OTP-29.0.2'
|
||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-26.04'])
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = 'latest'
|
||||
expected = 'OTP-29.0.2'
|
||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-26.04'])
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = 'latest'
|
||||
expected = '27.0-rc3'
|
||||
got = setupBeam.getVersionFromSpec(spec, matrix.otp.windows)
|
||||
@@ -911,29 +1029,31 @@ describe('.getVersionFromSpec(_)', () => {
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = 'latest'
|
||||
expected = '3.23.0'
|
||||
expected = '3.27.0'
|
||||
got = setupBeam.getVersionFromSpec(spec, matrix.rebar3)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
})
|
||||
})
|
||||
|
||||
describe('version file', () => {
|
||||
describe('.tool-versions file', () => {
|
||||
const otpVersion = unsimulateInput('otp-version')
|
||||
const elixirVersion = unsimulateInput('elixir-version')
|
||||
const gleamVersion = unsimulateInput('gleam-version')
|
||||
const rebar3Version = unsimulateInput('rebar3-version')
|
||||
|
||||
it('is parsed correctly', async () => {
|
||||
const erlang = '27'
|
||||
const elixir = '1.17.0'
|
||||
const gleam = '0.23.0'
|
||||
const rebar3 = '3.24.0'
|
||||
const toolVersions = `# a comment
|
||||
erlang ref:v${erlang}# comment, no space, and ref:v
|
||||
const erlang = '27.3.4.1'
|
||||
const elixir = '1.18.4'
|
||||
const gleam = '1.9.1'
|
||||
let toolVersions = `# a comment
|
||||
erlang ref:v${erlang}
|
||||
elixir ref:${elixir} # comment, with space and ref:
|
||||
not-gleam 0.23 # not picked up
|
||||
gleam ${gleam} \nrebar ${rebar3}`
|
||||
gleam ${gleam} \n`
|
||||
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)
|
||||
process.env.GITHUB_WORKSPACE = ''
|
||||
const appVersions = setupBeam.parseVersionFile(filename)
|
||||
@@ -957,15 +1077,62 @@ gleam ${gleam} \nrebar ${rebar3}`
|
||||
assert.ok(async () => {
|
||||
await setupBeam.install('gleam', { toolVersion: gleam })
|
||||
})
|
||||
})
|
||||
|
||||
simulateInput('otp-version', otpVersion)
|
||||
simulateInput('elixir-version', elixirVersion)
|
||||
simulateInput('gleam-version', gleamVersion)
|
||||
})
|
||||
|
||||
describe('mise.toml file', () => {
|
||||
const otpVersion = unsimulateInput('otp-version')
|
||||
const elixirVersion = unsimulateInput('elixir-version')
|
||||
const gleamVersion = unsimulateInput('gleam-version')
|
||||
|
||||
it('is parsed correctly', async () => {
|
||||
const erlang = '27.3.4.1'
|
||||
const elixir = '1.18.4'
|
||||
const gleam = '1.9.1'
|
||||
let miseToml = `[tools]
|
||||
"erlang" = "${erlang}"
|
||||
elixir = { version = "${elixir}", postinstall="mix deps.get" } # comment, with space and ref:
|
||||
"not-gleam" = 0.23 # not picked up
|
||||
"gleam" = "${gleam}"
|
||||
[env]
|
||||
_.file = ".env"\n`
|
||||
const filename = 'test/mise.toml'
|
||||
if (process.platform === 'win32') {
|
||||
// Force \r\n to test in Windows
|
||||
miseToml = miseToml.replace(/\n/g, '\r\n')
|
||||
}
|
||||
fs.writeFileSync(filename, miseToml)
|
||||
process.env.GITHUB_WORKSPACE = ''
|
||||
const appVersions = setupBeam.parseVersionFile(filename)
|
||||
assert.strictEqual(appVersions.get('erlang'), erlang)
|
||||
assert.strictEqual(appVersions.get('elixir'), elixir)
|
||||
|
||||
const absoluteFilename = path.join(os.tmpdir(), 'mise.toml')
|
||||
fs.writeFileSync(absoluteFilename, miseToml)
|
||||
|
||||
process.env.GITHUB_WORKSPACE = process.cwd()
|
||||
const absoluteAppVersions = setupBeam.parseVersionFile(absoluteFilename)
|
||||
assert.strictEqual(absoluteAppVersions.get('erlang'), erlang)
|
||||
assert.strictEqual(absoluteAppVersions.get('elixir'), elixir)
|
||||
|
||||
assert.ok(async () => {
|
||||
await setupBeam.install('rebar3', { toolVersion: rebar3 })
|
||||
await setupBeam.install('otp', { toolVersion: erlang })
|
||||
})
|
||||
assert.ok(async () => {
|
||||
await setupBeam.install('elixir', { toolVersion: elixir })
|
||||
})
|
||||
assert.ok(async () => {
|
||||
await setupBeam.install('gleam', { toolVersion: gleam })
|
||||
})
|
||||
})
|
||||
|
||||
simulateInput('otp-version', otpVersion)
|
||||
simulateInput('elixir-version', elixirVersion)
|
||||
simulateInput('gleam-version', gleamVersion)
|
||||
simulateInput('rebar3-version', rebar3Version)
|
||||
})
|
||||
|
||||
describe('.get(_)', () => {
|
||||
@@ -1059,6 +1226,98 @@ describe("Elixir Mix matcher's", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("Erlang matcher's", () => {
|
||||
it('erlc errors are properly matched', () => {
|
||||
const [matcher] = erlangProblemMatcher.find(
|
||||
({ owner }) => owner === 'erlc-error',
|
||||
).pattern
|
||||
|
||||
const output = 'src/mymod.erl:42:5: head mismatch'
|
||||
const match = output.match(matcher.regexp)
|
||||
assert.equal(match[1], 'src/mymod.erl')
|
||||
assert.equal(match[2], '42')
|
||||
assert.equal(match[3], '5')
|
||||
assert.equal(match[4], 'head mismatch')
|
||||
})
|
||||
|
||||
it('erlc errors do not match warnings', () => {
|
||||
const [matcher] = erlangProblemMatcher.find(
|
||||
({ owner }) => owner === 'erlc-error',
|
||||
).pattern
|
||||
|
||||
const output = 'src/mymod.erl:42:5: Warning: variable X is unused'
|
||||
const match = output.match(matcher.regexp)
|
||||
assert.equal(match, null)
|
||||
})
|
||||
|
||||
it('erlc warnings are properly matched', () => {
|
||||
const [matcher] = erlangProblemMatcher.find(
|
||||
({ owner }) => owner === 'erlc-warning',
|
||||
).pattern
|
||||
|
||||
const output = 'src/mymod.erl:10:3: Warning: variable X is unused'
|
||||
const match = output.match(matcher.regexp)
|
||||
assert.equal(match[1], 'src/mymod.erl')
|
||||
assert.equal(match[2], '10')
|
||||
assert.equal(match[3], '3')
|
||||
assert.equal(match[4], 'variable X is unused')
|
||||
})
|
||||
|
||||
it('dialyzer warnings are matched via erlc patterns', () => {
|
||||
const [matcher] = erlangProblemMatcher.find(
|
||||
({ owner }) => owner === 'erlc-warning',
|
||||
).pattern
|
||||
|
||||
const output =
|
||||
'src/mymod.erl:25:1: warning: Function foo/0 has no local return'
|
||||
const match = output.match(matcher.regexp)
|
||||
assert.equal(match[1], 'src/mymod.erl')
|
||||
assert.equal(match[2], '25')
|
||||
assert.equal(match[3], '1')
|
||||
assert.equal(match[4], 'Function foo/0 has no local return')
|
||||
})
|
||||
|
||||
it('CT failures are properly matched', () => {
|
||||
const [filePattern, reasonPattern] = erlangProblemMatcher.find(
|
||||
({ owner }) => owner === 'ct-failure',
|
||||
).pattern
|
||||
|
||||
const firstOutput = 'test/mymod_SUITE.erl failed on line 55'
|
||||
const secondOutput = 'Reason: {badmatch,{error,timeout}}'
|
||||
|
||||
const fileMatch = firstOutput.match(filePattern.regexp)
|
||||
assert.equal(fileMatch[1], 'test/mymod_SUITE.erl')
|
||||
assert.equal(fileMatch[2], '55')
|
||||
|
||||
const reasonMatch = secondOutput.match(reasonPattern.regexp)
|
||||
assert.equal(reasonMatch[1], '{badmatch,{error,timeout}}')
|
||||
})
|
||||
|
||||
it('EUnit failures are properly matched', () => {
|
||||
const [headerPattern, funcPattern, callPattern, errorPattern] =
|
||||
erlangProblemMatcher.find(
|
||||
({ owner }) => owner === 'eunit-failure',
|
||||
).pattern
|
||||
|
||||
const header = 'mymod_test: hello_test....*failed*'
|
||||
const func =
|
||||
'in function mymod_test:hello_test/0 (test/mymod_test.erl, line 12)'
|
||||
const call = 'in call from mymod_test:hello_test/0'
|
||||
const error = '**error:{badmatch,false}'
|
||||
|
||||
assert.ok(header.match(headerPattern.regexp))
|
||||
|
||||
const funcMatch = func.match(funcPattern.regexp)
|
||||
assert.equal(funcMatch[1], 'test/mymod_test.erl')
|
||||
assert.equal(funcMatch[2], '12')
|
||||
|
||||
assert.ok(call.match(callPattern.regexp))
|
||||
|
||||
const errorMatch = error.match(errorPattern.regexp)
|
||||
assert.equal(errorMatch[1], '{badmatch,false}')
|
||||
})
|
||||
})
|
||||
|
||||
function unsimulateInput(key) {
|
||||
return simulateInput(key, '')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user