mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a541161e4 | |||
| b8e9da70d1 | |||
| 6292fa4771 | |||
| 829ea8ebdc | |||
| 618f13887e | |||
| 90f5b2c068 | |||
| 73acf2617f | |||
| cb77d73385 | |||
| 2a23eb6a60 | |||
| f780b59067 | |||
| df8398692a | |||
| db0f43e56e | |||
| b5cdb7499d | |||
| ae6e9db1bf | |||
| cd1df4cd09 | |||
| 2f0cc07b4b | |||
| c36fc0ca1b | |||
| 7c4882bbdd | |||
| cdb7a12eb6 | |||
| 904c511e63 | |||
| 4f558159e6 | |||
| 0430fb6cc6 | |||
| 48f1d0ccc2 | |||
| 4ec4e80c33 |
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: action
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
@@ -27,6 +34,7 @@ jobs:
|
||||
git add dist/index.js
|
||||
git commit -m "Automation: update setup-beam version output to ${SHA}"
|
||||
git push origin main
|
||||
|
||||
check_integrity:
|
||||
name: Expected local npm actions
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: hexpm-mirrors
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
test-failing-first-mirror:
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: ubuntu
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
integration_test:
|
||||
@@ -15,6 +22,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
combo:
|
||||
- otp-version: '27'
|
||||
elixir-version: 'v1.17.0-rc.0'
|
||||
rebar3-version: '3.23'
|
||||
os: 'ubuntu-latest'
|
||||
- otp-version: '26.0'
|
||||
elixir-version: 'v1.14-otp-25'
|
||||
os: 'ubuntu-latest'
|
||||
@@ -30,12 +41,20 @@ 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'
|
||||
elixir-version: '1'
|
||||
os: 'ubuntu-24.04'
|
||||
- otp-version: '25'
|
||||
elixir-version: '1.16'
|
||||
rebar3-version: '3'
|
||||
os: 'ubuntu-22.04'
|
||||
- otp-version: '24'
|
||||
elixir-version: '1'
|
||||
elixir-version: '1.16'
|
||||
rebar3-version: '3'
|
||||
os: 'ubuntu-22.04'
|
||||
- otp-version: '25.0'
|
||||
@@ -174,6 +193,7 @@ jobs:
|
||||
mix escript.install --force ${{matrix.combo.escript_packages}}
|
||||
${{matrix.combo.escript_script}}
|
||||
if: ${{matrix.combo.escript_packages && matrix.combo.escript_script}}
|
||||
|
||||
environment_variables:
|
||||
name: Environment variables
|
||||
runs-on: ${{matrix.combo.os}}
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: windows
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
integration_test:
|
||||
@@ -15,6 +22,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
combo:
|
||||
- otp-version: '27'
|
||||
elixir-version: 'v1.17.0-rc.0'
|
||||
rebar3-version: '3.23'
|
||||
os: 'windows-latest'
|
||||
- otp-version: '26.0'
|
||||
elixir-version: 'main'
|
||||
os: 'windows-latest'
|
||||
@@ -112,6 +123,7 @@ jobs:
|
||||
mix escript.install --force ${{matrix.combo.escript_packages}}
|
||||
${{matrix.combo.escript_script}}
|
||||
if: ${{matrix.combo.escript_packages && matrix.combo.escript_script}}
|
||||
|
||||
environment_variables:
|
||||
name: Environment variables
|
||||
runs-on: ${{matrix.combo.os}}
|
||||
|
||||
+30
-56
@@ -2,32 +2,6 @@ THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY B
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: @aashutoshrathi/word-wrap, is-extglob. A copy of the source code may be downloaded from git+https://github.com/aashutoshrathi/word-wrap.git (@aashutoshrathi/word-wrap), https://github.com/jonschlinkert/is-extglob.git (is-extglob). This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2016, Jon Schlinkert
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: @actions/core, @actions/exec, @actions/io, @actions/tool-cache. A copy of the source code may be downloaded from git+https://github.com/actions/toolkit.git (@actions/core), git+https://github.com/actions/toolkit.git (@actions/exec), git+https://github.com/actions/toolkit.git (@actions/io), git+https://github.com/actions/toolkit.git (@actions/tool-cache). This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
@@ -118,7 +92,7 @@ THE SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: @fastify/busboy. A copy of the source code may be downloaded from https://github.com/fastify/busboy.git. This software contains the following license and notice below:
|
||||
The following software may be included in this product: @fastify/busboy. A copy of the source code may be downloaded from git+https://github.com/fastify/busboy.git. This software contains the following license and notice below:
|
||||
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
@@ -935,11 +909,11 @@ SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: braces. A copy of the source code may be downloaded from https://github.com/micromatch/braces.git. This software contains the following license and notice below:
|
||||
The following software may be included in this product: braces, fill-range, is-number, micromatch. A copy of the source code may be downloaded from https://github.com/micromatch/braces.git (braces), https://github.com/jonschlinkert/fill-range.git (fill-range), https://github.com/jonschlinkert/is-number.git (is-number), https://github.com/micromatch/micromatch.git (micromatch). This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2018, Jon Schlinkert.
|
||||
Copyright (c) 2014-present, Jon Schlinkert.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -2125,32 +2099,6 @@ THE SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: fill-range, is-number, micromatch. A copy of the source code may be downloaded from https://github.com/jonschlinkert/fill-range.git (fill-range), https://github.com/jonschlinkert/is-number.git (is-number), https://github.com/micromatch/micromatch.git (micromatch). This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-present, Jon Schlinkert.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: flat-cache. A copy of the source code may be downloaded from https://github.com/jaredwray/flat-cache.git. This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
@@ -2696,7 +2644,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: ini, isexe, json-stringify-safe, lru-cache, minimatch, once, rimraf, semver, which, wrappy, yallist. A copy of the source code may be downloaded from git://github.com/isaacs/ini.git (ini), git+https://github.com/isaacs/isexe.git (isexe), git://github.com/isaacs/json-stringify-safe (json-stringify-safe), git://github.com/isaacs/node-lru-cache.git (lru-cache), git://github.com/isaacs/minimatch.git (minimatch), git://github.com/isaacs/once (once), git://github.com/isaacs/rimraf.git (rimraf), https://github.com/npm/node-semver.git (semver), git://github.com/isaacs/node-which.git (which), https://github.com/npm/wrappy (wrappy), git+https://github.com/isaacs/yallist.git (yallist). This software contains the following license and notice below:
|
||||
The following software may be included in this product: ini, isexe, json-stringify-safe, lru-cache, minimatch, once, rimraf, semver, which, wrappy, yallist. A copy of the source code may be downloaded from git://github.com/isaacs/ini.git (ini), git+https://github.com/isaacs/isexe.git (isexe), git://github.com/isaacs/json-stringify-safe (json-stringify-safe), git://github.com/isaacs/node-lru-cache.git (lru-cache), git://github.com/isaacs/minimatch.git (minimatch), git://github.com/isaacs/once (once), git://github.com/isaacs/rimraf.git (rimraf), git+https://github.com/npm/node-semver.git (semver), git://github.com/isaacs/node-which.git (which), https://github.com/npm/wrappy (wrappy), git+https://github.com/isaacs/yallist.git (yallist). This software contains the following license and notice below:
|
||||
|
||||
The ISC License
|
||||
|
||||
@@ -2716,6 +2664,32 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: is-extglob, word-wrap. A copy of the source code may be downloaded from https://github.com/jonschlinkert/is-extglob.git (is-extglob), https://github.com/jonschlinkert/word-wrap.git (word-wrap). This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2016, Jon Schlinkert
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: is-glob. A copy of the source code may be downloaded from https://github.com/micromatch/is-glob.git. This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -27,6 +27,13 @@ Here are a few things you can do that will increase the likelihood of your pull
|
||||
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
||||
- Execute `npm run build-dist` and fix any issues arising from that
|
||||
|
||||
## Running tests
|
||||
|
||||
When running tests locally, a valid classic GitHub token with the `repo` scope is required for tests to pass.
|
||||
|
||||
- Export the token in the current shell: `export GITHUB_TOKEN=<contents>`
|
||||
- Run tests `npm test`
|
||||
|
||||
## Resources
|
||||
|
||||
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
|
||||
|
||||
@@ -49,13 +49,14 @@ opt-in, so `1.11.x` will not match a pre-release.
|
||||
This list presents the known working version combos between the target operating system
|
||||
and Erlang/OTP.
|
||||
|
||||
| Operating system | Erlang/OTP | Status
|
||||
|- |- |-
|
||||
| ubuntu-18.04 | 17 - 25 | ✅
|
||||
| ubuntu-20.04 | 20 - 25 | ✅
|
||||
| ubuntu-22.04 | 24.2 - 25 | ✅
|
||||
| windows-2019 | 21* - 25 | ✅
|
||||
| windows-2022 | 21* - 25 | ✅
|
||||
| Operating system | Erlang/OTP | Status
|
||||
|- |- |-
|
||||
| ubuntu-18.04 | 17.0 - 25.3 | ✅
|
||||
| ubuntu-20.04 | 20.0 - 27 | ✅
|
||||
| ubuntu-22.04 | 24.2 - 27 | ✅
|
||||
| ubuntu-24.04 | 24.3 - 27 | ✅
|
||||
| windows-2019 | 21* - 25 | ✅
|
||||
| windows-2022 | 21* - 27 | ✅
|
||||
|
||||
**Note** *: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3, 22.0, etc.
|
||||
|
||||
@@ -69,6 +70,7 @@ uses that to download assets:
|
||||
| ubuntu18 | ubuntu-18.04
|
||||
| ubuntu20 | ubuntu-20.04
|
||||
| ubuntu22 | ubuntu-22.04
|
||||
| ubuntu24 | ubuntu-24.04
|
||||
| win19 | windows-2019
|
||||
| win22 | windows-2022
|
||||
|
||||
@@ -122,11 +124,11 @@ with the following correspondence.
|
||||
#### `.tool-versions` format
|
||||
|
||||
| YML | `.tool-versions` |
|
||||
|- |-
|
||||
| `otp-version` | `erlang`
|
||||
| `elixir-version` | `elixir`
|
||||
| `gleam-version` | `gleam`
|
||||
| `rebar3-version` | `rebar`
|
||||
|- |- |
|
||||
| `otp-version` | `erlang` |
|
||||
| `elixir-version` | `elixir` |
|
||||
| `gleam-version` | `gleam` |
|
||||
| `rebar3-version` | `rebar` |
|
||||
|
||||
### Example (Erlang/OTP + Elixir, on Ubuntu)
|
||||
|
||||
@@ -248,7 +250,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '25'
|
||||
otp-version: '26'
|
||||
# Use `cdn.jsdelivr.net/hex` as an alternative to `builds.hex.pm`
|
||||
hexpm-mirrors: https://cdn.jsdelivr.net/hex
|
||||
```
|
||||
@@ -266,7 +268,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '25'
|
||||
otp-version: '26'
|
||||
hexpm-mirrors: |
|
||||
https://builds.hex.pm
|
||||
https://cdn.jsdelivr.net/hex
|
||||
|
||||
Vendored
+22
-11
@@ -9885,7 +9885,7 @@ async function main() {
|
||||
await maybeInstallRebar3(rebar3Spec)
|
||||
|
||||
// undefined is replaced by a function, post- main branch merge
|
||||
const setupBeamVersion = 'eb31c4c'
|
||||
const setupBeamVersion = 'b8e9da7'
|
||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||
}
|
||||
|
||||
@@ -10314,6 +10314,7 @@ function getRunnerOSVersion() {
|
||||
ubuntu18: 'ubuntu-18.04',
|
||||
ubuntu20: 'ubuntu-20.04',
|
||||
ubuntu22: 'ubuntu-22.04',
|
||||
ubuntu24: 'ubuntu-24.04',
|
||||
win19: 'windows-2019',
|
||||
win22: 'windows-2022',
|
||||
}
|
||||
@@ -10422,7 +10423,7 @@ alongside ${alternativeName}=${alternativeValue} \
|
||||
}
|
||||
|
||||
function parseVersionFile(versionFilePath0) {
|
||||
const versionFilePath = path.join(
|
||||
const versionFilePath = path.resolve(
|
||||
process.env.GITHUB_WORKSPACE,
|
||||
versionFilePath0,
|
||||
)
|
||||
@@ -10562,8 +10563,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'erl'
|
||||
const args = ['-version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -10579,8 +10581,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'erl.exe'
|
||||
const args = ['+V']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -10608,8 +10611,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'elixir'
|
||||
const args = ['-v']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -10648,8 +10652,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'gleam'
|
||||
const args = ['--version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -10681,8 +10686,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'gleam.exe'
|
||||
const args = ['--version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -10713,8 +10719,12 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'rebar3'
|
||||
const args = ['version']
|
||||
const env = {
|
||||
REBAR_GLOBAL_CONFIG_DIR: '/fake-dir',
|
||||
REBAR_CONFIG: 'fake.config',
|
||||
}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -10749,8 +10759,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'rebar3.cmd'
|
||||
const args = ['version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -10804,8 +10815,8 @@ async function installTool(opts) {
|
||||
core.exportVariable(installDirForVarName, runnerToolPath)
|
||||
|
||||
core.info(`Installed ${installOpts.tool} version`)
|
||||
const [cmd, args] = platformOpts.reportVersion()
|
||||
await exec(cmd, args)
|
||||
const [cmd, args, env] = platformOpts.reportVersion()
|
||||
await exec(cmd, args, { env: { ...process.env, ...env } })
|
||||
}
|
||||
|
||||
function checkPlatform() {
|
||||
|
||||
+22
-11
@@ -49,7 +49,7 @@ async function main() {
|
||||
await maybeInstallRebar3(rebar3Spec)
|
||||
|
||||
// undefined is replaced by a function, post- main branch merge
|
||||
const setupBeamVersion = 'eb31c4c'
|
||||
const setupBeamVersion = 'b8e9da7'
|
||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||
}
|
||||
|
||||
@@ -483,6 +483,7 @@ function getRunnerOSVersion() {
|
||||
ubuntu18: 'ubuntu-18.04',
|
||||
ubuntu20: 'ubuntu-20.04',
|
||||
ubuntu22: 'ubuntu-22.04',
|
||||
ubuntu24: 'ubuntu-24.04',
|
||||
win19: 'windows-2019',
|
||||
win22: 'windows-2022',
|
||||
}
|
||||
@@ -591,7 +592,7 @@ alongside ${alternativeName}=${alternativeValue} \
|
||||
}
|
||||
|
||||
function parseVersionFile(versionFilePath0) {
|
||||
const versionFilePath = path.join(
|
||||
const versionFilePath = path.resolve(
|
||||
process.env.GITHUB_WORKSPACE,
|
||||
versionFilePath0,
|
||||
)
|
||||
@@ -731,8 +732,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'erl'
|
||||
const args = ['-version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -748,8 +750,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'erl.exe'
|
||||
const args = ['+V']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -777,8 +780,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'elixir'
|
||||
const args = ['-v']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -817,8 +821,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'gleam'
|
||||
const args = ['--version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -850,8 +855,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'gleam.exe'
|
||||
const args = ['--version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -882,8 +888,12 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'rebar3'
|
||||
const args = ['version']
|
||||
const env = {
|
||||
REBAR_GLOBAL_CONFIG_DIR: '/fake-dir',
|
||||
REBAR_CONFIG: 'fake.config',
|
||||
}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -918,8 +928,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'rebar3.cmd'
|
||||
const args = ['version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -973,8 +984,8 @@ async function installTool(opts) {
|
||||
core.exportVariable(installDirForVarName, runnerToolPath)
|
||||
|
||||
core.info(`Installed ${installOpts.tool} version`)
|
||||
const [cmd, args] = platformOpts.reportVersion()
|
||||
await exec(cmd, args)
|
||||
const [cmd, args, env] = platformOpts.reportVersion()
|
||||
await exec(cmd, args, { env: { ...process.env, ...env } })
|
||||
}
|
||||
|
||||
function checkPlatform() {
|
||||
|
||||
@@ -8,6 +8,8 @@ simulateInput('hexpm-mirrors', 'https://builds.hex.pm', { multiline: true })
|
||||
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const core = require('@actions/core')
|
||||
const setupBeam = require('../src/setup-beam')
|
||||
const { problemMatcher } = require('../matchers/elixir-matchers.json')
|
||||
@@ -128,6 +130,20 @@ async function testOTPVersions() {
|
||||
|
||||
if (process.platform === 'linux') {
|
||||
before = simulateInput('version-type', 'strict')
|
||||
spec = '26'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
expected = 'maint-26'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion, hexMirrors)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
spec = '27.0'
|
||||
osVersion = 'ubuntu-24.04'
|
||||
expected = 'OTP-27.0'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion, hexMirrors)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
simulateInput('version-type', before)
|
||||
spec = '25.3.2.1'
|
||||
osVersion = 'ubuntu-20.04'
|
||||
expected = 'OTP-25.3.2.1'
|
||||
@@ -535,6 +551,14 @@ rebar ${rebar3}`
|
||||
assert.strictEqual(appVersions.get('erlang'), erlang)
|
||||
assert.strictEqual(appVersions.get('elixir'), elixir)
|
||||
|
||||
const absoluteFilename = path.join(os.tmpdir(), '.tool-versions')
|
||||
fs.writeFileSync(absoluteFilename, toolVersions)
|
||||
|
||||
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 })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user