mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
@@ -24,7 +24,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: Version it!
|
- name: Version it!
|
||||||
run: |
|
run: |
|
||||||
# We expect a string such as const setupBeamVersion = 'undefined' in the code
|
# We expect a string such as const setupBeamVersion = 'undefined' in the code
|
||||||
@@ -45,10 +45,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- uses: actions/setup-node@v6.1.0
|
- uses: actions/setup-node@v6.3.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '24'
|
||||||
- run: npm run build-dist
|
- run: npm run build-dist
|
||||||
- name: Check if build left artifacts
|
- name: Check if build left artifacts
|
||||||
run: git diff --exit-code --ignore-space-at-eol
|
run: git diff --exit-code --ignore-space-at-eol
|
||||||
@@ -58,19 +58,26 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- uses: raven-actions/actionlint@v2.1.0
|
- uses: raven-actions/actionlint@v2.1.2
|
||||||
|
|
||||||
unit_tests_ubuntu:
|
unit_tests_ubuntu:
|
||||||
name: 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:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- uses: actions/setup-node@v6.1.0
|
- uses: actions/setup-node@v6.3.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '24'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
env:
|
||||||
|
NODE_ENV: test
|
||||||
- name: .tool-versions test
|
- name: .tool-versions test
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -82,14 +89,20 @@ jobs:
|
|||||||
|
|
||||||
unit_tests_windows:
|
unit_tests_windows:
|
||||||
name: Unit tests (Windows)
|
name: Unit tests (Windows)
|
||||||
runs-on: windows-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- windows-latest # x86_64
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- uses: actions/setup-node@v6.1.0
|
- uses: actions/setup-node@v6.3.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '24'
|
||||||
- run: npm install --production
|
- run: npm install --production
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
env:
|
||||||
|
NODE_ENV: test
|
||||||
- name: .tool-versions test
|
- name: .tool-versions test
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -101,11 +114,18 @@ jobs:
|
|||||||
|
|
||||||
unit_tests_macos:
|
unit_tests_macos:
|
||||||
name: 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:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- uses: actions/setup-node@v6.1.0
|
- uses: actions/setup-node@v6.3.0
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '24'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
env:
|
||||||
|
NODE_ENV: test
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
install-rebar: [true, false]
|
install-rebar: [true, false]
|
||||||
install-hex: [true, false]
|
install-hex: [true, false]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
+21
-10
@@ -16,6 +16,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
integration_test:
|
integration_test:
|
||||||
name: >
|
name: >
|
||||||
|
OS ${{matrix.combo.os}},
|
||||||
OTP ${{matrix.combo.otp-version}},
|
OTP ${{matrix.combo.otp-version}},
|
||||||
Elixir ${{matrix.combo.elixir-version}},
|
Elixir ${{matrix.combo.elixir-version}},
|
||||||
rebar3 ${{matrix.combo.rebar3-version}}
|
rebar3 ${{matrix.combo.rebar3-version}}
|
||||||
@@ -24,6 +25,22 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
combo:
|
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'
|
- otp-version: '27'
|
||||||
elixir-version: 'v1.17.0'
|
elixir-version: 'v1.17.0'
|
||||||
rebar3-version: '3.23'
|
rebar3-version: '3.23'
|
||||||
@@ -43,19 +60,13 @@ jobs:
|
|||||||
elixir-version: '1.14.3'
|
elixir-version: '1.14.3'
|
||||||
os: 'macos-latest'
|
os: 'macos-latest'
|
||||||
version-type: 'strict'
|
version-type: 'strict'
|
||||||
- otp-version: '25'
|
|
||||||
os: 'macos-15'
|
|
||||||
- otp-version: '26'
|
|
||||||
elixir-version: '1.16'
|
|
||||||
rebar3-version: '3.25'
|
|
||||||
os: 'macos-14'
|
|
||||||
- otp-version: '25.0'
|
- otp-version: '25.0'
|
||||||
elixir-version: 'v1.13.4-otp-25'
|
elixir-version: 'v1.16.3-otp-25'
|
||||||
rebar3-version: '3.18.0'
|
rebar3-version: '3.18.0'
|
||||||
os: 'macos-latest'
|
os: 'macos-latest'
|
||||||
version-type: 'strict'
|
version-type: 'strict'
|
||||||
- otp-version: '25.0'
|
- otp-version: '25.0'
|
||||||
elixir-version: 'v1.13.4'
|
elixir-version: 'v1.16.3'
|
||||||
rebar3-version: '3.18.0'
|
rebar3-version: '3.18.0'
|
||||||
os: 'macos-latest'
|
os: 'macos-latest'
|
||||||
version-type: 'strict'
|
version-type: 'strict'
|
||||||
@@ -65,7 +76,7 @@ jobs:
|
|||||||
rebar3-version: 'latest'
|
rebar3-version: 'latest'
|
||||||
os: 'macos-latest'
|
os: 'macos-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -118,7 +129,7 @@ jobs:
|
|||||||
rebar3-version: 3.24
|
rebar3-version: 3.24
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
integration_test:
|
integration_test:
|
||||||
name: >
|
name: >
|
||||||
|
OS ${{matrix.combo.os}},
|
||||||
OTP ${{matrix.combo.otp-version}},
|
OTP ${{matrix.combo.otp-version}},
|
||||||
Elixir ${{matrix.combo.elixir-version}},
|
Elixir ${{matrix.combo.elixir-version}},
|
||||||
Gleam ${{matrix.combo.gleam-version}},
|
Gleam ${{matrix.combo.gleam-version}},
|
||||||
@@ -25,15 +26,22 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
combo:
|
combo:
|
||||||
- otp-version: '<26'
|
# Ubuntu 22.04 - per README
|
||||||
elixir-version: '<1.17'
|
- otp-version: '24.2'
|
||||||
os: 'ubuntu-22.04'
|
os: 'ubuntu-22.04'
|
||||||
- otp-version: 'master'
|
- otp-version: '29'
|
||||||
elixir-version: '> 0'
|
os: 'ubuntu-22.04'
|
||||||
|
# Ubuntu 24.04 - per README
|
||||||
|
- otp-version: '24.3'
|
||||||
os: 'ubuntu-24.04'
|
os: 'ubuntu-24.04'
|
||||||
- otp-version: 'master'
|
- otp-version: '29'
|
||||||
elixir-version: 'main'
|
|
||||||
os: 'ubuntu-24.04'
|
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'
|
- otp-version: '27'
|
||||||
elixir-version: 'v1.17.0'
|
elixir-version: 'v1.17.0'
|
||||||
rebar3-version: '3.23'
|
rebar3-version: '3.23'
|
||||||
@@ -53,19 +61,13 @@ jobs:
|
|||||||
elixir-version: '1.14.3'
|
elixir-version: '1.14.3'
|
||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
version-type: 'strict'
|
version-type: 'strict'
|
||||||
- otp-version: '25'
|
|
||||||
os: 'ubuntu-24.04'
|
|
||||||
- otp-version: '26'
|
|
||||||
elixir-version: '1.16'
|
|
||||||
rebar3-version: '3.25'
|
|
||||||
os: 'ubuntu-22.04'
|
|
||||||
- otp-version: '25.0'
|
- otp-version: '25.0'
|
||||||
elixir-version: 'v1.13.4-otp-25'
|
elixir-version: 'v1.16.2-otp-25'
|
||||||
rebar3-version: '3.18.0'
|
rebar3-version: '3.18.0'
|
||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
version-type: 'strict'
|
version-type: 'strict'
|
||||||
- otp-version: '25.0'
|
- otp-version: '25.0'
|
||||||
elixir-version: 'v1.13.4'
|
elixir-version: 'v1.16.3'
|
||||||
rebar3-version: '3.18.0'
|
rebar3-version: '3.18.0'
|
||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
version-type: 'strict'
|
version-type: 'strict'
|
||||||
@@ -80,13 +82,13 @@ jobs:
|
|||||||
otp-version: false
|
otp-version: false
|
||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
disable_problem_matchers: true
|
disable_problem_matchers: true
|
||||||
- elixir-version: 'v1.13'
|
- elixir-version: 'v1.16'
|
||||||
otp-version: '24'
|
otp-version: '24'
|
||||||
escript_packages: 'hex protobuf'
|
escript_packages: 'hex protobuf'
|
||||||
escript_script: 'protoc-gen-elixir --version'
|
escript_script: 'protoc-gen-elixir --version'
|
||||||
os: 'ubuntu-latest'
|
os: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -154,7 +156,7 @@ jobs:
|
|||||||
rebar3-version: 3.24
|
rebar3-version: 3.24
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ name: Update 3rd party licenses (automation)
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
@@ -14,7 +15,7 @@ jobs:
|
|||||||
name: Update 3rd party licenses
|
name: Update 3rd party licenses
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- run:
|
- run:
|
||||||
./.github/workflows/update_3rd_party_licenses.sh
|
./.github/workflows/update_3rd_party_licenses.sh
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
integration_test:
|
integration_test:
|
||||||
name: >
|
name: >
|
||||||
|
OS ${{matrix.combo.os}},
|
||||||
OTP ${{matrix.combo.otp-version}},
|
OTP ${{matrix.combo.otp-version}},
|
||||||
Elixir ${{matrix.combo.elixir-version}},
|
Elixir ${{matrix.combo.elixir-version}},
|
||||||
Gleam ${{matrix.combo.gleam-version}},
|
Gleam ${{matrix.combo.gleam-version}},
|
||||||
@@ -25,12 +26,20 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
combo:
|
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'
|
- otp-version: '<26'
|
||||||
elixir-version: '<1.17'
|
elixir-version: '<1.17'
|
||||||
os: 'ubuntu-22.04'
|
os: 'windows-latest'
|
||||||
- otp-version: 'master'
|
|
||||||
elixir-version: '> 0'
|
|
||||||
os: 'ubuntu-24.04'
|
|
||||||
- otp-version: '27'
|
- otp-version: '27'
|
||||||
elixir-version: 'v1.17.0'
|
elixir-version: 'v1.17.0'
|
||||||
rebar3-version: '3.23'
|
rebar3-version: '3.23'
|
||||||
@@ -47,30 +56,24 @@ jobs:
|
|||||||
elixir-version: '1.14.5'
|
elixir-version: '1.14.5'
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
version-type: 'strict'
|
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'
|
- elixir-version: 'v1.10'
|
||||||
otp-version: '23'
|
otp-version: '23'
|
||||||
rebar3-version: '3.14'
|
rebar3-version: '3.14'
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
- elixir-version: 'v1.13'
|
- elixir-version: 'v1.16'
|
||||||
otp-version: '24'
|
otp-version: '24'
|
||||||
rebar3-version: '3.15'
|
rebar3-version: '3.15'
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
- gleam-version: '1.9.0'
|
- gleam-version: '1.9.0'
|
||||||
otp-version: '27'
|
otp-version: '27'
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
- elixir-version: 'v1.13'
|
- elixir-version: 'v1.16'
|
||||||
otp-version: '24'
|
otp-version: '24'
|
||||||
escript_packages: 'hex protobuf'
|
escript_packages: 'hex protobuf'
|
||||||
escript_script: 'protoc-gen-elixir --version'
|
escript_script: 'protoc-gen-elixir --version'
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -137,7 +140,7 @@ jobs:
|
|||||||
rebar3-version: 3.24
|
rebar3-version: 3.24
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
id: setup-beam
|
id: setup-beam
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
+4
-2
@@ -1,2 +1,4 @@
|
|||||||
node_modules/**
|
/node_modules
|
||||||
test/.tool-versions
|
/test/.tool-versions
|
||||||
|
/test/mise.toml
|
||||||
|
/dist/package.json
|
||||||
|
|||||||
+1416
-7158
File diff suppressed because it is too large
Load Diff
@@ -80,18 +80,23 @@ and Erlang/OTP.
|
|||||||
|
|
||||||
| Operating system | Erlang/OTP | OTP Architecture | Status
|
| Operating system | Erlang/OTP | OTP Architecture | Status
|
||||||
|- |- | - |-
|
|- |- | - |-
|
||||||
| `ubuntu-22.04` | 24.2 - 28 | x86_64, arm64 | ✅
|
| `ubuntu-22.04` | 24.2 - 29 | x86_64, arm64 | ✅
|
||||||
| `ubuntu-24.04` | 24.3 - 28 | x86_64, arm64 | ✅
|
| `ubuntu-24.04` | 24.3 - 29 | x86_64, arm64 | ✅
|
||||||
| `windows-2019` | 21\* - 25 | x86_64, x86 | ✅
|
| `ubuntu-26.04` | 26 - 29 | x86_64, arm64 | ✅
|
||||||
| `windows-2022` | 21\* - 28 | x86_64, x86 | ✅
|
| `windows-2022` | 21\* - 29 | x86_64, x86 | ✅
|
||||||
| `windows-2025` | 21\* - 28 | x86_64, x86 | ✅
|
| `windows-2025` | 21\* - 29 | x86_64, x86 | ✅
|
||||||
| `macOS-13` | 25.0 - 28 | x86_64, arm64 | ✅
|
| `macOS-14` | 25 - 29 | x86_64, arm64 | ✅
|
||||||
| `macOS-14` | 25.0 - 28 | x86_64, arm64 | ✅
|
| `macOS-15` | 25 - 29 | x86_64, arm64 | ✅
|
||||||
| `macOS-15` | 25.0 - 28 | 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,
|
**Note** \*: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3,
|
||||||
22.0, etc.
|
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
|
||||||
|
|
||||||
Self-hosted runners need to set env. variable `ImageOS` to one of the following, since the action
|
Self-hosted runners need to set env. variable `ImageOS` to one of the following, since the action
|
||||||
@@ -100,13 +105,17 @@ uses that to download assets:
|
|||||||
| ImageOS | Operating system
|
| ImageOS | Operating system
|
||||||
|- |-
|
|- |-
|
||||||
| `ubuntu22` | `ubuntu-22.04`
|
| `ubuntu22` | `ubuntu-22.04`
|
||||||
|
| `ubuntu22-arm64` | `ubuntu-22.04`
|
||||||
| `ubuntu24` | `ubuntu-24.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`
|
| `win22` | `windows-2022`
|
||||||
| `win25` | `windows-2025`
|
| `win25` | `windows-2025`
|
||||||
| `macos13` | `macOS-13`
|
| `win25-vs2026` | `windows-2025`
|
||||||
| `macos14` | `macOS-14`
|
| `macos14` | `macOS-14`
|
||||||
| `macos15` | `macOS-15`
|
| `macos15` | `macOS-15`
|
||||||
|
| `macos26` | `macOS-26`
|
||||||
|
|
||||||
as per the following example:
|
as per the following example:
|
||||||
|
|
||||||
@@ -141,23 +150,22 @@ e.g. `${{steps.setup-beam.outputs.erlang-version}}`
|
|||||||
|
|
||||||
### Version file
|
### Version file
|
||||||
|
|
||||||
A version file is specified via input `version-file` (e.g.`.tool-versions`). This
|
A version file is specified via input `version-file` (e.g. `.tool-versions` or `mise.toml`).
|
||||||
allows not having to use YML input for versions, though the action does check (and
|
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.
|
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`,
|
**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.
|
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,
|
Supported version elements are the same as the ones defined for the YML portion of the action,
|
||||||
with the following correspondence.
|
with the following correspondence.
|
||||||
|
|
||||||
#### `.tool-versions` format
|
#### `.tool-versions` / `mise.toml` format
|
||||||
|
|
||||||
| YML | `.tool-versions`
|
| YML | Version file key
|
||||||
|- |-
|
|- |-
|
||||||
| `otp-version` | `erlang`
|
| `otp-version` | `erlang`
|
||||||
| `elixir-version` | `elixir`
|
| `elixir-version` | `elixir`
|
||||||
@@ -291,6 +299,34 @@ jobs:
|
|||||||
- run: rebar3 ct
|
- 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
|
### Erlang/OTP + `rebar3`, on Windows
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
+4
-2
@@ -69,7 +69,9 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
|
|
||||||
version-file:
|
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: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
@@ -96,5 +98,5 @@ outputs:
|
|||||||
description: The commit unique id of the execution action version
|
description: The commit unique id of the execution action version
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: node20
|
using: node24
|
||||||
main: dist/index.js
|
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
+33861
-24262
File diff suppressed because one or more lines are too long
+19
-22
@@ -1,30 +1,27 @@
|
|||||||
import js from '@eslint/js'
|
import js from '@eslint/js'
|
||||||
import globals from 'globals'
|
import globals from 'globals'
|
||||||
import { defineConfig } from 'eslint/config'
|
import yml from 'eslint-plugin-yml'
|
||||||
import eslintPluginYml from 'eslint-plugin-yml'
|
import * as yamlParser from 'yaml-eslint-parser'
|
||||||
|
|
||||||
export default defineConfig([
|
export default [
|
||||||
...eslintPluginYml.configs['flat/recommended'],
|
js.configs.recommended,
|
||||||
{
|
{
|
||||||
extends: ['js/recommended'],
|
languageOptions: {
|
||||||
|
ecmaVersion: 'latest',
|
||||||
|
sourceType: 'module',
|
||||||
|
globals: globals.node,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.yml'],
|
||||||
|
languageOptions: {
|
||||||
|
parser: yamlParser,
|
||||||
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
js,
|
yml,
|
||||||
},
|
},
|
||||||
languageOptions: {
|
rules: {
|
||||||
ecmaVersion: 2022,
|
...yml.configs.recommended.rules,
|
||||||
globals: {
|
|
||||||
...globals.node,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
]
|
||||||
{
|
|
||||||
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
+1028
-725
File diff suppressed because it is too large
Load Diff
+14
-13
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-beam",
|
"name": "setup-beam",
|
||||||
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -16,25 +17,25 @@
|
|||||||
"build-dist": "npm run clean-dist && npm install && npm run build && npm run format && npm run lint"
|
"build-dist": "npm run clean-dist && npm install && npm run build && npm run format && npm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "1.11.1",
|
"@actions/core": "3.0.0",
|
||||||
"@actions/exec": "1.1.1",
|
"@actions/exec": "3.0.0",
|
||||||
"@actions/tool-cache": "2.0.2",
|
"@actions/tool-cache": "4.0.0",
|
||||||
"csv-parse": "6.1.0",
|
"csv-parse": "6.2.1",
|
||||||
"lodash": "4.17.23",
|
"semver": "7.7.4",
|
||||||
"semver": "7.7.2"
|
"smol-toml": "1.6.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "9.38.0",
|
"@eslint/js": "10.0.1",
|
||||||
"@vercel/ncc": "0.38.4",
|
"@vercel/ncc": "0.38.4",
|
||||||
"eslint": "9.38.0",
|
"eslint": "10.6.0",
|
||||||
"eslint-plugin-yml": "1.18.0",
|
"eslint-plugin-yml": "3.3.1",
|
||||||
"globals": "17.3.0",
|
"globals": "17.7.0",
|
||||||
"markdownlint-cli": "0.47.0",
|
"markdownlint-cli": "0.48.0",
|
||||||
"prettier": "3.6.2",
|
"prettier": "3.9.1",
|
||||||
"shellcheck": "4.1.0",
|
"shellcheck": "4.1.0",
|
||||||
"yarn": "1.22.22"
|
"yarn": "1.22.22"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=24"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+113
-50
@@ -1,14 +1,18 @@
|
|||||||
const core = require('@actions/core')
|
import path from 'node:path'
|
||||||
const { exec } = require('@actions/exec')
|
import fs from 'node:fs'
|
||||||
const tc = require('@actions/tool-cache')
|
import os from 'node:os'
|
||||||
const path = require('path')
|
import { fileURLToPath } from 'node:url'
|
||||||
const semver = require('semver')
|
import * as core from '@actions/core'
|
||||||
const fs = require('fs')
|
import { exec } from '@actions/exec'
|
||||||
const os = require('os')
|
import * as tc from '@actions/tool-cache'
|
||||||
const csv = require('csv-parse/sync')
|
import * as semver from 'semver'
|
||||||
const _ = require('lodash')
|
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 MAX_HTTP_RETRIES = 3
|
||||||
|
const APPS = ['erlang', 'elixir', 'gleam', 'rebar']
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'test') {
|
if (process.env.NODE_ENV !== 'test') {
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
@@ -53,7 +57,7 @@ async function main() {
|
|||||||
await maybeInstallRebar3(rebar3Spec)
|
await maybeInstallRebar3(rebar3Spec)
|
||||||
|
|
||||||
// undefined is replaced by a function, post- main branch merge
|
// undefined is replaced by a function, post- main branch merge
|
||||||
const setupBeamVersion = 'fe5485f'
|
const setupBeamVersion = 'ea45c80'
|
||||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +79,7 @@ async function installOTP(otpSpec) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
core.setOutput('otp-version', otpVersion)
|
core.setOutput('otp-version', otpVersion)
|
||||||
|
maybeEnableProblemMatchers('erlang')
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
return otpVersion
|
return otpVersion
|
||||||
@@ -96,7 +101,7 @@ async function maybeInstallElixir(elixirSpec) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
core.setOutput('elixir-version', elixirVersion)
|
core.setOutput('elixir-version', elixirVersion)
|
||||||
maybeEnableElixirProblemMatchers()
|
maybeEnableProblemMatchers('elixir')
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
installed = true
|
installed = true
|
||||||
@@ -105,16 +110,18 @@ async function maybeInstallElixir(elixirSpec) {
|
|||||||
return installed
|
return installed
|
||||||
}
|
}
|
||||||
|
|
||||||
function maybeEnableElixirProblemMatchers() {
|
function problemMatchersEnabled() {
|
||||||
const disableProblemMatchers = getInput('disable_problem_matchers', false)
|
return getInput('disable_problem_matchers', false) === 'false'
|
||||||
if (disableProblemMatchers === 'false') {
|
}
|
||||||
const elixirMatchers = path.join(
|
|
||||||
__dirname,
|
// path.join with static strings helps ncc resolve and bundle the JSON files
|
||||||
'..',
|
function maybeEnableProblemMatchers(language) {
|
||||||
'matchers',
|
if (problemMatchersEnabled()) {
|
||||||
'elixir-matchers.json',
|
const matcherFiles = {
|
||||||
)
|
erlang: path.join(`${__dirname}/../matchers/erlang-matchers.json`),
|
||||||
core.info(`##[add-matcher]${elixirMatchers}`)
|
elixir: path.join(`${__dirname}/../matchers/elixir-matchers.json`),
|
||||||
|
}
|
||||||
|
core.info(`##[add-matcher]${matcherFiles[language]}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,17 +198,17 @@ async function getOTPVersion(otpSpec0, osVersion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function requestedVersionFor(tool, version, originListing, mirrors) {
|
function requestedVersionFor(tool, version, originListing, mirrors) {
|
||||||
const isStrictVersion = isStrictVersion()
|
const isVersionTypeStrict = isStrictVersion()
|
||||||
|
|
||||||
let versionType = 'loose'
|
let versionType = 'loose'
|
||||||
if (isStrictVersion) {
|
if (isVersionTypeStrict) {
|
||||||
versionType = 'strict'
|
versionType = 'strict'
|
||||||
}
|
}
|
||||||
|
|
||||||
let ret =
|
let ret =
|
||||||
`Requested ${versionType} ${tool} version (${version}) not found in version list, ` +
|
`Requested ${versionType} ${tool} version (${version}) not found in version list, ` +
|
||||||
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.`
|
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.`
|
||||||
if (!isStrictVersion) {
|
if (!isVersionTypeStrict) {
|
||||||
ret = `${ret} Should you be using option 'version-type': 'strict'?`
|
ret = `${ret} Should you be using option 'version-type': 'strict'?`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,9 +377,7 @@ async function getOTPVersions(osVersion) {
|
|||||||
})
|
})
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32') {
|
||||||
const otpArch = otpArchitecture()
|
const otpArch = otpArchitecture()
|
||||||
const file_regex = new RegExp(
|
const file_regex = new RegExp(`^otp_win${RegExp.escape(otpArch)}_(.*).exe$`)
|
||||||
`^otp_win${_.escapeRegExp(otpArch)}_(.*).exe$`,
|
|
||||||
)
|
|
||||||
otpVersionsListings.forEach((otpVersionsListing) => {
|
otpVersionsListings.forEach((otpVersionsListing) => {
|
||||||
otpVersionsListing
|
otpVersionsListing
|
||||||
.map((x) => x.assets)
|
.map((x) => x.assets)
|
||||||
@@ -576,7 +581,7 @@ function getVersionFromSpec(spec0, versions0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function maybeCoerced(v) {
|
function maybeCoerced(v) {
|
||||||
let ret = null
|
let ret
|
||||||
try {
|
try {
|
||||||
if (!isRC(v)) {
|
if (!isRC(v)) {
|
||||||
ret = semver.coerce(v).version
|
ret = semver.coerce(v).version
|
||||||
@@ -653,19 +658,30 @@ function getRunnerOSArchitecture() {
|
|||||||
|
|
||||||
function getRunnerOSVersion() {
|
function getRunnerOSVersion() {
|
||||||
// List from https://github.com/actions/runner-images?tab=readme-ov-file#available-images
|
// 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 = {
|
const ImageOSToContainer = {
|
||||||
ubuntu22: 'ubuntu-22.04',
|
ubuntu22: 'ubuntu-22.04',
|
||||||
|
'ubuntu22-arm64': 'ubuntu-22.04',
|
||||||
ubuntu24: 'ubuntu-24.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',
|
win22: 'windows-2022',
|
||||||
win25: 'windows-2025',
|
win25: 'windows-2025',
|
||||||
macos13: 'macOS-13',
|
'win25-vs2026': 'windows-2025',
|
||||||
macos14: 'macOS-14',
|
macos14: 'macOS-14',
|
||||||
macos15: 'macOS-15',
|
macos15: 'macOS-15',
|
||||||
|
macos26: 'macOS-26',
|
||||||
}
|
}
|
||||||
const deprecatedImageOSToContainer = {
|
const deprecatedImageOSToContainer = {
|
||||||
ubuntu18: 'ubuntu-18.04',
|
ubuntu18: 'ubuntu-18.04',
|
||||||
ubuntu20: 'ubuntu-20.04',
|
ubuntu20: 'ubuntu-20.04',
|
||||||
|
win19: 'windows-2019',
|
||||||
|
macos13: 'macOS-13',
|
||||||
}
|
}
|
||||||
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
|
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
|
||||||
if (!containerFromEnvImageOS) {
|
if (!containerFromEnvImageOS) {
|
||||||
@@ -801,28 +817,14 @@ alongside ${alternativeName}=${alternativeValue} \
|
|||||||
return input
|
return input
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseVersionFile(versionFilePath0) {
|
function parseToolVersionsFile(versionFilePath) {
|
||||||
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}`)
|
|
||||||
const appVersions = new Map()
|
const appVersions = new Map()
|
||||||
const versions = fs.readFileSync(versionFilePath, 'utf8')
|
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(/\r?\n/).forEach((line) => {
|
versions.split(/\r?\n/).forEach((line) => {
|
||||||
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
|
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
|
||||||
if (appVersion) {
|
if (appVersion) {
|
||||||
const app = appVersion[1]
|
const app = appVersion[1]
|
||||||
if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) {
|
if (APPS.includes(app)) {
|
||||||
const [, , , version] = appVersion
|
const [, , , version] = appVersion
|
||||||
core.info(`Consuming ${app} at version ${version}`)
|
core.info(`Consuming ${app} at version ${version}`)
|
||||||
appVersions.set(app, version)
|
appVersions.set(app, version)
|
||||||
@@ -839,6 +841,46 @@ function parseVersionFile(versionFilePath0) {
|
|||||||
return appVersions
|
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) {
|
function debugLog(groupName, message) {
|
||||||
const group = `Debugging for ${groupName}`
|
const group = `Debugging for ${groupName}`
|
||||||
core.debug(
|
core.debug(
|
||||||
@@ -937,7 +979,7 @@ async function install(toolName, opts) {
|
|||||||
const otpArch = otpArchitecture()
|
const otpArch = otpArchitecture()
|
||||||
return (
|
return (
|
||||||
'https://github.com/erlang/otp/releases/download/' +
|
'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'],
|
extract: async () => ['file', 'otp.exe'],
|
||||||
@@ -1021,12 +1063,14 @@ async function install(toolName, opts) {
|
|||||||
tool: 'Gleam',
|
tool: 'Gleam',
|
||||||
linux: {
|
linux: {
|
||||||
downloadToolURL: () => {
|
downloadToolURL: () => {
|
||||||
|
const arch = getRunnerOSArchitecture()
|
||||||
let gz
|
let gz
|
||||||
if (
|
if (
|
||||||
versionSpec === 'nightly' ||
|
versionSpec === 'nightly' ||
|
||||||
semver.gt(versionSpec, 'v0.22.1')
|
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 {
|
} else {
|
||||||
gz = `gleam-${versionSpec}-linux-amd64.tar.gz`
|
gz = `gleam-${versionSpec}-linux-amd64.tar.gz`
|
||||||
}
|
}
|
||||||
@@ -1090,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
|
break
|
||||||
case 'rebar3':
|
case 'rebar3':
|
||||||
installOpts = {
|
installOpts = {
|
||||||
@@ -1237,7 +1300,7 @@ function debugLoggingEnabled() {
|
|||||||
return !!process.env.RUNNER_DEBUG
|
return !!process.env.RUNNER_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
get,
|
get,
|
||||||
getElixirVersion,
|
getElixirVersion,
|
||||||
getGleamVersion,
|
getGleamVersion,
|
||||||
|
|||||||
+869
-72
File diff suppressed because it is too large
Load Diff
+192
-39
@@ -1,3 +1,15 @@
|
|||||||
|
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'
|
process.env.NODE_ENV = 'test'
|
||||||
|
|
||||||
simulateInput('otp-version', '25.1.2')
|
simulateInput('otp-version', '25.1.2')
|
||||||
@@ -9,15 +21,7 @@ simulateInput('install-hex', 'true')
|
|||||||
simulateInput('github-token', process.env.GITHUB_TOKEN)
|
simulateInput('github-token', process.env.GITHUB_TOKEN)
|
||||||
simulateInput('hexpm-mirrors', 'https://builds.hex.pm', { multiline: true })
|
simulateInput('hexpm-mirrors', 'https://builds.hex.pm', { multiline: true })
|
||||||
|
|
||||||
const assert = require('assert')
|
const { default: setupBeam } = await import('../src/setup-beam.js')
|
||||||
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 matrix = {
|
const matrix = {
|
||||||
otp: {
|
otp: {
|
||||||
@@ -173,11 +177,8 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
'https://repo.hex.pm, https://cdn.jsdelivr.net/hex',
|
'https://repo.hex.pm, https://cdn.jsdelivr.net/hex',
|
||||||
{ multiline: true },
|
{ multiline: true },
|
||||||
)
|
)
|
||||||
const previousRunnerArch = process.env.RUNNER_ARCH
|
|
||||||
|
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
process.env.RUNNER_ARCH = 'X64'
|
|
||||||
|
|
||||||
it('is Ok for known linux version', async () => {
|
it('is Ok for known linux version', async () => {
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = '27.0'
|
spec = '27.0'
|
||||||
@@ -195,21 +196,21 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
simulateInput('version-type', before)
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
spec = '19.3.x'
|
spec = '20.3.x'
|
||||||
osVersion = 'ubuntu-16.04'
|
osVersion = 'ubuntu-20.04'
|
||||||
expected = 'OTP-19.3.6.13'
|
expected = 'OTP-20.3.8.26'
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '^19.3.6'
|
spec = '^20.3.8'
|
||||||
osVersion = 'ubuntu-16.04'
|
osVersion = 'ubuntu-20.04'
|
||||||
expected = 'OTP-19.3.6.13'
|
expected = 'OTP-20.3.8.26'
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '^19.3'
|
spec = '^20.3'
|
||||||
osVersion = 'ubuntu-18.04'
|
osVersion = 'ubuntu-20.04'
|
||||||
expected = 'OTP-19.3.6.13'
|
expected = 'OTP-20.3.8.26'
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
@@ -272,7 +273,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '23.0'
|
spec = '23.0'
|
||||||
osVersion = 'windows-2019'
|
osVersion = 'windows-2022'
|
||||||
expected = '23.0.4'
|
expected = '23.0.4'
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
@@ -293,7 +294,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '23.0'
|
spec = '23.0'
|
||||||
osVersion = 'windows-2019'
|
osVersion = 'windows-2022'
|
||||||
expected = '23.0.4'
|
expected = '23.0.4'
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
@@ -305,6 +306,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
it('is main-... only if strict/maint-... is used as input', async () => {
|
it('is main-... only if strict/maint-... is used as input', async () => {
|
||||||
const arm64Options = setupBeam.githubARMRunnerArchs()
|
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||||
|
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||||
|
|
||||||
@@ -340,6 +342,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
|
|
||||||
it('is Ok for known linux ARM64 version', async () => {
|
it('is Ok for known linux ARM64 version', async () => {
|
||||||
const arm64Options = setupBeam.githubARMRunnerArchs()
|
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||||
|
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||||
|
|
||||||
@@ -400,10 +403,13 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
expected = 'master'
|
expected = 'master'
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
process.env.RUNNER_ARCH = previousRunnerArch
|
||||||
})
|
})
|
||||||
|
|
||||||
it('is Ok for known linux AMD64 version', async () => {
|
it('is Ok for known linux AMD64 version', async () => {
|
||||||
const amd64Options = setupBeam.githubAMDRunnerArchs()
|
const amd64Options = setupBeam.githubAMDRunnerArchs()
|
||||||
|
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
amd64Options[Math.floor(Math.random() * amd64Options.length)]
|
amd64Options[Math.floor(Math.random() * amd64Options.length)]
|
||||||
|
|
||||||
@@ -482,12 +488,15 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
expected = 'master'
|
expected = 'master'
|
||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
|
process.env.RUNNER_ARCH = previousRunnerArch
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
it('is main-... only if strict/maint-... is used as input', async () => {
|
it('is main-... only if strict/maint-... is used as input', async () => {
|
||||||
const arm64Options = setupBeam.githubARMRunnerArchs()
|
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||||
|
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||||
|
|
||||||
@@ -517,6 +526,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
|
|
||||||
it('is Ok for known macos ARM64 version', async () => {
|
it('is Ok for known macos ARM64 version', async () => {
|
||||||
const arm64Options = setupBeam.githubARMRunnerArchs()
|
const arm64Options = setupBeam.githubARMRunnerArchs()
|
||||||
|
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
arm64Options[Math.floor(Math.random() * arm64Options.length)]
|
||||||
|
|
||||||
@@ -527,10 +537,13 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
simulateInput('version-type', before)
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
|
process.env.RUNNER_ARCH = previousRunnerArch
|
||||||
})
|
})
|
||||||
|
|
||||||
it('is Ok for known macos AMD64 version', async () => {
|
it('is Ok for known macos AMD64 version', async () => {
|
||||||
const amd64Options = setupBeam.githubARMRunnerArchs()
|
const amd64Options = setupBeam.githubARMRunnerArchs()
|
||||||
|
const previousRunnerArch = process.env.RUNNER_ARCH
|
||||||
process.env.RUNNER_ARCH =
|
process.env.RUNNER_ARCH =
|
||||||
amd64Options[Math.floor(Math.random() * amd64Options.length)]
|
amd64Options[Math.floor(Math.random() * amd64Options.length)]
|
||||||
|
|
||||||
@@ -541,11 +554,12 @@ describe('.getOTPVersion(_) - Erlang', () => {
|
|||||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
simulateInput('version-type', before)
|
simulateInput('version-type', before)
|
||||||
|
|
||||||
|
process.env.RUNNER_ARCH = previousRunnerArch
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
simulateInput('hexpm-mirrors', hexMirrors, { multiline: true })
|
simulateInput('hexpm-mirrors', hexMirrors, { multiline: true })
|
||||||
process.env.RUNNER_ARCH = previousRunnerArch
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('OTP arch-specific install', () => {
|
describe('OTP arch-specific install', () => {
|
||||||
@@ -568,6 +582,7 @@ describe('OTP arch-specific install', () => {
|
|||||||
`Fetching OTP Version with invalid Github runner architecture is supposed to fail`,
|
`Fetching OTP Version with invalid Github runner architecture is supposed to fail`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
process.env.RUNNER_ARCH = previousRunnerArch
|
process.env.RUNNER_ARCH = previousRunnerArch
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -578,11 +593,8 @@ describe('.getOTPVersion(_) - Elixir', () => {
|
|||||||
let spec
|
let spec
|
||||||
let otpVersion
|
let otpVersion
|
||||||
let before
|
let before
|
||||||
const previousRunnerArch = process.env.RUNNER_ARCH
|
|
||||||
|
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
process.env.RUNNER_ARCH = 'X64'
|
|
||||||
|
|
||||||
it('returns the expected value', async () => {
|
it('returns the expected value', async () => {
|
||||||
spec = '1.18.x'
|
spec = '1.18.x'
|
||||||
otpVersion = 'OTP-27'
|
otpVersion = 'OTP-27'
|
||||||
@@ -613,9 +625,9 @@ describe('.getOTPVersion(_) - Elixir', () => {
|
|||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
before = simulateInput('version-type', 'strict')
|
before = simulateInput('version-type', 'strict')
|
||||||
spec = '1.17'
|
spec = '1.19'
|
||||||
otpVersion = 'master'
|
otpVersion = 'master'
|
||||||
expected = 'v1.17-otp-27'
|
expected = 'v1.19-otp-28'
|
||||||
await setupBeam.installOTP(otpVersion)
|
await setupBeam.installOTP(otpVersion)
|
||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
@@ -640,8 +652,6 @@ describe('.getOTPVersion(_) - Elixir', () => {
|
|||||||
simulateInput('version-type', before)
|
simulateInput('version-type', before)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
process.env.RUNNER_ARCH = previousRunnerArch
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('.getOTPVersion(_) - Gleam', () => {
|
describe('.getOTPVersion(_) - Gleam', () => {
|
||||||
@@ -685,18 +695,18 @@ describe('.getOTPVersion(_) - rebar3', () => {
|
|||||||
let spec
|
let spec
|
||||||
|
|
||||||
it('returns the expected value', async () => {
|
it('returns the expected value', async () => {
|
||||||
spec = '3.10.x'
|
spec = '3.26.x'
|
||||||
expected = '3.10.0'
|
expected = '3.26.0'
|
||||||
got = await setupBeam.getRebar3Version(spec)
|
got = await setupBeam.getRebar3Version(spec)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '3.11'
|
spec = '3.25'
|
||||||
expected = '3.11.1'
|
expected = '3.25.1'
|
||||||
got = await setupBeam.getRebar3Version(spec)
|
got = await setupBeam.getRebar3Version(spec)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = '3.10'
|
spec = '3.26'
|
||||||
expected = '3.10.0'
|
expected = '3.26.0'
|
||||||
got = await setupBeam.getRebar3Version(spec)
|
got = await setupBeam.getRebar3Version(spec)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
})
|
})
|
||||||
@@ -962,13 +972,13 @@ describe('.getVersionFromSpec(_)', () => {
|
|||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
|
|
||||||
spec = 'latest'
|
spec = 'latest'
|
||||||
expected = '3.23.0'
|
expected = '3.27.0'
|
||||||
got = setupBeam.getVersionFromSpec(spec, matrix.rebar3)
|
got = setupBeam.getVersionFromSpec(spec, matrix.rebar3)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('version file', () => {
|
describe('.tool-versions file', () => {
|
||||||
const otpVersion = unsimulateInput('otp-version')
|
const otpVersion = unsimulateInput('otp-version')
|
||||||
const elixirVersion = unsimulateInput('elixir-version')
|
const elixirVersion = unsimulateInput('elixir-version')
|
||||||
const gleamVersion = unsimulateInput('gleam-version')
|
const gleamVersion = unsimulateInput('gleam-version')
|
||||||
@@ -1017,6 +1027,57 @@ gleam ${gleam} \n`
|
|||||||
simulateInput('gleam-version', gleamVersion)
|
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('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)
|
||||||
|
})
|
||||||
|
|
||||||
describe('.get(_)', () => {
|
describe('.get(_)', () => {
|
||||||
it('retries as expected', async () => {
|
it('retries as expected', async () => {
|
||||||
let attempt = 0
|
let attempt = 0
|
||||||
@@ -1108,6 +1169,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) {
|
function unsimulateInput(key) {
|
||||||
return simulateInput(key, '')
|
return simulateInput(key, '')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user