Compare commits

...

30 Commits

Author SHA1 Message Date
GitHub Actions 0a541161e4 Automation: update setup-beam version output to b8e9da7 2024-05-31 15:29:11 +00:00
GitHub Actions b8e9da70d1 Automation: update setup-beam version output to 6292fa4 2024-05-25 19:08:57 +00:00
Paulo F. Oliveira 6292fa4771 Test over OTP 27 and rebar3 3.23 (#274) 2024-05-25 20:08:17 +01:00
GitHub Actions 829ea8ebdc Automation: update setup-beam version output to 618f138 2024-05-21 18:21:21 +00:00
Eric Saxby 618f13887e Add support for Ubuntu 24 (#271) 2024-05-21 19:20:56 +01:00
GitHub Actions 90f5b2c068 Automation: update setup-beam version output to 73acf26 2024-05-21 16:52:17 +00:00
github-actions[bot] 73acf2617f Update 3rd party licenses (automation) (#273)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-05-21 17:51:50 +01:00
GitHub Actions cb77d73385 Automation: update setup-beam version output to 2a23eb6 2024-05-20 21:22:27 +00:00
Eric Saxby 2a23eb6a60 Add GITHUB_TOKEN information to contributing guide (#272) 2024-05-20 23:22:07 +02:00
GitHub Actions f780b59067 Automation: update setup-beam version output to df83986 2024-05-08 20:10:01 +00:00
github-actions[bot] df8398692a Update 3rd party licenses (automation) (#268)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-05-08 21:09:37 +01:00
GitHub Actions db0f43e56e Automation: update setup-beam version output to b5cdb74 2024-04-30 18:37:40 +00:00
github-actions[bot] b5cdb7499d Update 3rd party licenses (automation) (#265)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-04-30 19:37:15 +01:00
GitHub Actions ae6e9db1bf Automation: update setup-beam version output to cd1df4c 2024-04-06 11:16:03 +00:00
GitHub Actions cd1df4cd09 Automation: update setup-beam version output to 2f0cc07 2024-03-24 03:50:21 +00:00
GitHub Actions 2f0cc07b4b Automation: update setup-beam version output to c36fc0c 2024-03-03 23:50:12 +00:00
Paulo F. Oliveira c36fc0ca1b Hack around rebar3 compiling your project to output its version (#256) 2024-03-03 17:49:50 -06:00
GitHub Actions 7c4882bbdd Automation: update setup-beam version output to cdb7a12 2024-03-03 23:49:23 +00:00
Paulo F. Oliveira cdb7a12eb6 Test on OTP-27.0-rc1 + a few minor README tweaks (#255) 2024-03-03 17:48:54 -06:00
GitHub Actions 904c511e63 Automation: update setup-beam version output to 4f55815 2024-02-29 22:37:38 +00:00
Jonatan Männchen 4f558159e6 Allow absolute version file paths (#258) 2024-02-29 22:37:17 +00:00
Paulo F. Oliveira 0430fb6cc6 Fix CI for pull requests (#259) 2024-02-29 22:03:16 +00:00
GitHub Actions 48f1d0ccc2 Automation: update setup-beam version output to 4ec4e80 2024-02-29 21:37:15 +00:00
github-actions[bot] 4ec4e80c33 Update 3rd party licenses (automation) (#257)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-02-29 21:36:50 +00:00
GitHub Actions a23b1fc445 Automation: update setup-beam version output to eb31c4c 2024-02-16 22:30:46 +00:00
github-actions[bot] eb31c4c998 Update 3rd party licenses (automation) (#254)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-02-16 22:30:20 +00:00
GitHub Actions 726c8cb9ac Automation: update setup-beam version output to 951dd85 2024-02-13 04:03:52 +00:00
Paulo F. Oliveira 951dd857ae Move bin path, in Windows, from D: to C: (#251) 2024-02-12 22:03:29 -06:00
GitHub Actions f2c1b65313 Automation: update setup-beam version output to 0352ab2 2024-02-04 21:22:13 +00:00
github-actions[bot] 0352ab2e65 Update 3rd party licenses (automation) (#253)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-02-04 21:21:48 +00:00
13 changed files with 1195 additions and 891 deletions
+9 -1
View File
@@ -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
+8 -1
View File
@@ -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:
+27 -7
View File
@@ -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}}
@@ -199,7 +219,7 @@ jobs:
- run: env
- name: Check environment variables
run: |
${INSTALL_DIR_FOR_ELIXIR}/elixir --version
${INSTALL_DIR_FOR_GLEAM}/gleam --version
${INSTALL_DIR_FOR_OTP}/erl -version
${INSTALL_DIR_FOR_REBAR3}/rebar3 version
${INSTALL_DIR_FOR_ELIXIR}/bin/elixir -v
${INSTALL_DIR_FOR_GLEAM}/bin/gleam --version
${INSTALL_DIR_FOR_OTP}/bin/erl -version
${INSTALL_DIR_FOR_REBAR3}/bin/rebar3 version
+18 -6
View File
@@ -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}}
@@ -137,8 +149,8 @@ jobs:
- run: env
- name: Check environment variables
run: |
${INSTALL_DIR_FOR_ELIXIR}/elixir --version
${INSTALL_DIR_FOR_GLEAM}/gleam --version
${INSTALL_DIR_FOR_OTP}/erl -version
${INSTALL_DIR_FOR_REBAR3}/rebar3 version
shell: bash
& "$Env:INSTALL_DIR_FOR_ELIXIR/bin/elixir" "-v"
& "$Env:INSTALL_DIR_FOR_GLEAM/bin/gleam.exe" "--version"
& "$Env:INSTALL_DIR_FOR_OTP/bin/erl.exe" "+V"
& "$Env:INSTALL_DIR_FOR_REBAR3/bin/rebar3.cmd" "version"
& "$Env:INSTALL_DIR_FOR_REBAR3/bin/rebar3.ps1" "version"
-1
View File
@@ -1,3 +1,2 @@
node_modules/**
dist/.github/workflows
test/.tool-versions
+56 -56
View File
@@ -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
@@ -1566,6 +1540,32 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----
The following software may be included in this product: es-define-property, es-errors. A copy of the source code may be downloaded from git+https://github.com/ljharb/es-define-property.git (es-define-property), git+https://github.com/ljharb/es-errors.git (es-errors). This software contains the following license and notice below:
MIT License
Copyright (c) 2024 Jordan Harband
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: es6-error. A copy of the source code may be downloaded from https://github.com/bjyoungblood/es6-error.git. This software contains the following license and notice below:
The MIT License (MIT)
@@ -2099,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)
@@ -2670,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
@@ -2690,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)
+7
View File
@@ -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/)
+19 -14
View File
@@ -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
@@ -282,6 +284,9 @@ environment variables:
- `INSTALL_DIR_FOR_GLEAM`: base folder for Gleam
- `INSTALL_DIR_FOR_REBAR3`: base folder for `rebar3`
In each of these you'll find folder `bin` where the appropriate binaries, platform-dependant,
are found (i.e. `erl`, `erl.exe`, `rebar3`, `rebar3.exe`, ...).
## Elixir Problem Matchers
The Elixir Problem Matchers in this repository are adapted from
+471 -442
View File
File diff suppressed because it is too large Load Diff
+515 -342
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -11,7 +11,9 @@
"shellcheck": "shellcheck .github/workflows/*.sh",
"test": "node test/setup-beam.test.js",
"yamllint": "yamllint .github/workflows/**.yml && yamllint .*.yml && yamllint *.yml",
"build-dist": "rm -rf ./dist && npm install && npm run build && npm run format && npm run markdownlint && npm run shellcheck && npm run yamllint && npm run jslint"
"clean-dist": "rm -rf ./dist",
"lint": "npm run markdownlint && npm run shellcheck && npm run yamllint && npm run jslint",
"build-dist": "npm run clean-dist && npm install && npm run build && npm run format && npm run lint"
},
"dependencies": {
"@actions/core": "1.10.0",
+38 -20
View File
@@ -49,7 +49,7 @@ async function main() {
await maybeInstallRebar3(rebar3Spec)
// undefined is replaced by a function, post- main branch merge
const setupBeamVersion = '6c8deb6'
const setupBeamVersion = 'b8e9da7'
core.setOutput('setup-beam-version', setupBeamVersion)
}
@@ -135,7 +135,6 @@ async function maybeInstallGleam(gleamSpec) {
core.startGroup(`Installing Gleam ${gleamVersion}`)
await install('gleam', { toolVersion: gleamVersion })
core.setOutput('gleam-version', gleamVersion)
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/gleam/bin`)
core.endGroup()
installed = true
@@ -156,7 +155,6 @@ async function maybeInstallRebar3(rebar3Spec) {
core.startGroup(`Installing rebar3 ${rebar3Version}`)
await install('rebar3', { toolVersion: rebar3Version })
core.setOutput('rebar3-version', rebar3Version)
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/rebar3/bin`)
core.endGroup()
installed = true
@@ -485,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',
}
@@ -593,7 +592,7 @@ alongside ${alternativeName}=${alternativeValue} \
}
function parseVersionFile(versionFilePath0) {
const versionFilePath = path.join(
const versionFilePath = path.resolve(
process.env.GITHUB_WORKSPACE,
versionFilePath0,
)
@@ -733,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: {
@@ -750,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]
},
},
}
@@ -779,8 +780,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'elixir'
const args = ['-v']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -819,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: {
@@ -852,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]
},
},
}
@@ -884,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: {
@@ -920,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]
},
},
}
@@ -954,20 +963,29 @@ async function installTool(opts) {
core.debug(` ... it is, at ${cachePath}`)
}
core.debug('Performing post extract operations...')
await platformOpts.postExtract(cachePath)
// This makes sure we run, e.g. in Windows, the installer in the runner
// We're not caching the install, just the downloaded tool
const runnerToolPath = path.join(
process.env.RUNNER_TEMP,
'.setup-beam',
toolName,
)
fs.cpSync(cachePath, runnerToolPath, { recursive: true })
core.debug(`Adding ${cachePath}'s bin to system path`)
const catchPathBin = path.join(cachePath, 'bin')
core.addPath(catchPathBin)
core.debug('Performing post extract operations...')
await platformOpts.postExtract(runnerToolPath)
core.debug(`Adding ${runnerToolPath}' bin to system path`)
const runnerToolPathBin = path.join(runnerToolPath, 'bin')
core.addPath(runnerToolPathBin)
const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase()
core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`)
core.exportVariable(installDirForVarName, catchPathBin)
core.debug(`Exporting ${installDirForVarName} as ${runnerToolPath}`)
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() {
+24
View File
@@ -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 })
})