mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Compare commits
43 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 | |||
| a23b1fc445 | |||
| eb31c4c998 | |||
| 726c8cb9ac | |||
| 951dd857ae | |||
| f2c1b65313 | |||
| 0352ab2e65 | |||
| 8b9cac4c04 | |||
| 6c8deb6007 | |||
| 98ca4dce66 | |||
| b8913643d6 | |||
| cf854bf149 | |||
| 4a641b1000 | |||
| 07193a0ba2 | |||
| 4c35984bbc | |||
| b60baf4753 | |||
| 213ca2eceb | |||
| bc84950393 | |||
| 980f47ea52 | |||
| 4678b57fab |
@@ -1,20 +1,49 @@
|
||||
---
|
||||
name: action
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
jobs:
|
||||
version:
|
||||
name: Version with commit unique id
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Version it!
|
||||
run: |
|
||||
# We expect a string such as const setupBeamVersion = 'undefined' in the code
|
||||
SHA=$(git rev-parse --short HEAD)
|
||||
sed -i'.bak' \
|
||||
-e "s/const setupBeamVersion = '.*'/const setupBeamVersion = '${SHA}'/g" \
|
||||
src/setup-beam.js
|
||||
npm run build-dist
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@user.noreply.github.com"
|
||||
git add src/setup-beam.js
|
||||
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
|
||||
if: github.ref != 'refs/heads/main'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '20'
|
||||
- run: npm run build-dist
|
||||
- name: Check if build left artifacts
|
||||
run: git diff --exit-code --ignore-space-at-eol
|
||||
@@ -23,10 +52,10 @@ jobs:
|
||||
name: Unit tests (Ubuntu)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '20'
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
- name: .tool-versions test
|
||||
@@ -40,9 +69,9 @@ jobs:
|
||||
name: Unit tests (Windows)
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '20'
|
||||
- run: npm install --production
|
||||
- run: npm test
|
||||
|
||||
@@ -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:
|
||||
@@ -16,7 +23,7 @@ jobs:
|
||||
install-rebar: [true, false]
|
||||
install-hex: [true, false]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
|
||||
@@ -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'
|
||||
@@ -24,18 +35,26 @@ jobs:
|
||||
os: 'ubuntu-latest'
|
||||
version-type: 'strict'
|
||||
- otp-version: '25.2'
|
||||
elixir-version: '1.14.3'
|
||||
elixir-version: '1.14.2'
|
||||
os: 'ubuntu-latest'
|
||||
- otp-version: '25.2'
|
||||
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'
|
||||
@@ -66,14 +85,6 @@ jobs:
|
||||
otp-version: '21'
|
||||
rebar3-version: '3.12'
|
||||
os: 'ubuntu-20.04'
|
||||
- elixir-version: 'v1.6'
|
||||
otp-version: '21'
|
||||
rebar3-version: '3.12'
|
||||
os: 'ubuntu-20.04'
|
||||
- elixir-version: 'v1.7'
|
||||
otp-version: '22'
|
||||
rebar3-version: '3.13'
|
||||
os: 'ubuntu-20.04'
|
||||
- elixir-version: 'v1.7'
|
||||
otp-version: '22'
|
||||
rebar3-version: '3.13'
|
||||
@@ -86,18 +97,10 @@ jobs:
|
||||
otp-version: '25.0.2'
|
||||
rebar3-version: '3.19'
|
||||
os: 'ubuntu-20.04'
|
||||
- elixir-version: 'v1.10'
|
||||
otp-version: '23'
|
||||
rebar3-version: '3.14'
|
||||
os: 'ubuntu-20.04'
|
||||
- elixir-version: 'v1.12'
|
||||
otp-version: '24'
|
||||
rebar3-version: '3.15'
|
||||
os: 'ubuntu-20.04'
|
||||
- elixir-version: 'v1.13.4'
|
||||
otp-version: '25.0.2'
|
||||
rebar3-version: '3.19'
|
||||
os: 'ubuntu-20.04'
|
||||
- elixir-version: 'v1.11.0'
|
||||
otp-version: '22.3.4.2'
|
||||
os: 'ubuntu-20.04'
|
||||
@@ -108,11 +111,11 @@ jobs:
|
||||
version-type: 'strict'
|
||||
- elixir-version: 'main'
|
||||
otp-version: '23.1'
|
||||
os: 'ubuntu-20.04'
|
||||
os: 'ubuntu-20.04'
|
||||
version-type: 'strict'
|
||||
- elixir-version: 'main'
|
||||
otp-version: '25'
|
||||
os: 'ubuntu-20.04'
|
||||
os: 'ubuntu-20.04'
|
||||
version-type: 'strict'
|
||||
- gleam-version: '0.23'
|
||||
otp-version: '24'
|
||||
@@ -126,7 +129,7 @@ jobs:
|
||||
otp-version: false
|
||||
os: 'ubuntu-latest'
|
||||
disable_problem_matchers: true
|
||||
- gleam-version: '0.22.0' # Version with Gleam's old archive naming convention
|
||||
- gleam-version: '0.22.0' # Version with Gleam's old archive naming convention
|
||||
otp-version: '24'
|
||||
os: 'ubuntu-latest'
|
||||
disable_problem_matchers: true
|
||||
@@ -136,7 +139,7 @@ jobs:
|
||||
escript_script: 'protoc-gen-elixir --version'
|
||||
os: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
@@ -190,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}}
|
||||
@@ -203,7 +207,7 @@ jobs:
|
||||
rebar3-version: 'nightly'
|
||||
os: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
@@ -213,9 +217,9 @@ jobs:
|
||||
gleam-version: ${{matrix.combo.gleam-version}}
|
||||
rebar3-version: ${{matrix.combo.rebar3-version}}
|
||||
- run: env
|
||||
- name: List environment variables
|
||||
- name: Check environment variables
|
||||
run: |
|
||||
[ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}"
|
||||
[ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}"
|
||||
[ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}"
|
||||
[ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}"
|
||||
${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
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
name: Update 3rd party licenses
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- run:
|
||||
./.github/workflows/update_3rd_party_licenses.sh
|
||||
env:
|
||||
|
||||
@@ -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'
|
||||
@@ -59,7 +70,7 @@ jobs:
|
||||
escript_script: 'protoc-gen-elixir --version'
|
||||
os: 'windows-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
@@ -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}}
|
||||
@@ -125,7 +137,7 @@ jobs:
|
||||
rebar3-version: 'nightly'
|
||||
os: 'windows-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use erlef/setup-beam
|
||||
id: setup-beam
|
||||
uses: ./
|
||||
@@ -135,10 +147,10 @@ jobs:
|
||||
gleam-version: ${{matrix.combo.gleam-version}}
|
||||
rebar3-version: ${{matrix.combo.rebar3-version}}
|
||||
- run: env
|
||||
- name: List environment variables
|
||||
- name: Check environment variables
|
||||
run: |
|
||||
[ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}"
|
||||
[ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}"
|
||||
[ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}"
|
||||
[ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}"
|
||||
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,3 +1,2 @@
|
||||
node_modules/**
|
||||
dist/.github/workflows
|
||||
test/.tool-versions
|
||||
|
||||
+56
-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
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -83,11 +85,26 @@ jobs:
|
||||
env:
|
||||
ImageOS: ubuntu20 # equivalent to runs-on ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
...
|
||||
```
|
||||
|
||||
### Outputs
|
||||
|
||||
The action provides the following outputs:
|
||||
|
||||
| Output | Content
|
||||
|- |-
|
||||
| otp-version | The Erlang version, e.g. `OTP-26.0`
|
||||
| elixir-version | The Elixir version, e.g. `v1.14-otp-26`
|
||||
| gleam-version | The Gleam version, e.g. `v0.23.0`
|
||||
| rebar3-version | The `rebar3` version, e.g. `3.18.0`
|
||||
| setup-beam-version | The commit unique id of the executed action version, e.g. `a34c98f`
|
||||
|
||||
accessible as `${{steps.<setup-beam-step-id>.outputs.<Output>}}`,
|
||||
e.g. `${{steps.setup-beam.outputs.erlang-version}}`
|
||||
|
||||
### Version file
|
||||
|
||||
A version file is specified via input `version-file` (e.g.`.tool-versions`). This
|
||||
@@ -107,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)
|
||||
|
||||
@@ -128,7 +145,7 @@ jobs:
|
||||
otp: ['20.3', '21.3', '22.2']
|
||||
elixir: ['1.8.2', '1.9.4']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: ${{matrix.otp}}
|
||||
@@ -152,7 +169,7 @@ jobs:
|
||||
otp: ['20.3', '21.3', '22.2']
|
||||
rebar3: ['3.14.1', '3.14.3']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: ${{matrix.otp}}
|
||||
@@ -170,7 +187,7 @@ jobs:
|
||||
test:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '24'
|
||||
@@ -188,7 +205,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '24'
|
||||
@@ -206,7 +223,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: false
|
||||
@@ -230,10 +247,10 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- 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
|
||||
```
|
||||
@@ -248,10 +265,10 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- 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
|
||||
@@ -267,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
|
||||
|
||||
+3
-1
@@ -58,6 +58,8 @@ outputs:
|
||||
description: Exact version of Gleam that was installed
|
||||
rebar3-version:
|
||||
description: Exact version of rebar3 that was installed
|
||||
setup-beam-version:
|
||||
description: The commit unique id of the execution action version
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: dist/index.js
|
||||
|
||||
Vendored
-62
@@ -1,62 +0,0 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "elixir-mixCompileError",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\*\\* \\((\\w+)\\) (.*):(\\d+): (.*)$",
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"message": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "elixir-mixCompileWarning",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^warning: (.*)$",
|
||||
"message": 1
|
||||
},
|
||||
{
|
||||
"regexp": "^ (.*):(\\d+).*$",
|
||||
"file": 1,
|
||||
"line": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "elixir-mixTestFailure",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\s*\\d+\\) (.*)$",
|
||||
"message": 1
|
||||
},
|
||||
{
|
||||
"regexp": "^\\s*(.*):(\\d+)$",
|
||||
"file": 1,
|
||||
"line": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "elixir-credoOutputDefault",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\u2503\\s\\[\\w\\]\\s[\u2191|\u2197|\u2192|\u2198|\u2193]\\s(.*)$",
|
||||
"message": 1
|
||||
},
|
||||
{
|
||||
"regexp": "^\u2503\\s{7}(.*):(\\d+):(\\d+)\\s.*$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+491
-447
File diff suppressed because it is too large
Load Diff
Vendored
-37
@@ -1,37 +0,0 @@
|
||||
param([Parameter(Mandatory=$true)][string]${VSN})
|
||||
|
||||
$ErrorActionPreference="Stop"
|
||||
|
||||
Set-Location ${Env:RUNNER_TEMP}
|
||||
|
||||
$FILE_OUTPUT="gleam.zip"
|
||||
$DIR_FOR_BIN=".setup-beam/gleam"
|
||||
|
||||
function Version-Greater-Than([string]${THIS_ONE}, [string]${REFERENCE}) {
|
||||
$THIS_ONE=$THIS_ONE.replace('v', '')
|
||||
$THIS_ONE=$THIS_ONE.replace('rc', '')
|
||||
$THIS_ONE=$THIS_ONE.replace('-', '')
|
||||
return [version]${THIS_ONE} -gt [version]${REFERENCE}
|
||||
}
|
||||
|
||||
function Uses-LLVM-Triplets([string]${THIS_VSN}) {
|
||||
return "${THIS_VSN}" -eq "nightly" -or (Version-Greater-Than "${THIS_VSN}" "0.22.1")
|
||||
}
|
||||
|
||||
if (Uses-LLVM-Triplets "$VSN") {
|
||||
$FILE_INPUT="gleam-${VSN}-x86_64-pc-windows-msvc.zip"
|
||||
} else {
|
||||
$FILE_INPUT="gleam-${VSN}-windows-64bit.zip"
|
||||
}
|
||||
|
||||
$ProgressPreference="SilentlyContinue"
|
||||
Invoke-WebRequest "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
|
||||
$ProgressPreference="Continue"
|
||||
New-Item "${DIR_FOR_BIN}/bin" -ItemType Directory | Out-Null
|
||||
$ProgressPreference="SilentlyContinue"
|
||||
Expand-Archive -DestinationPath "${DIR_FOR_BIN}/bin" -Path "${FILE_OUTPUT}"
|
||||
$ProgressPreference="Continue"
|
||||
Write-Output "Installed Gleam version follows"
|
||||
& "${DIR_FOR_BIN}/bin/gleam" "--version" | Write-Output
|
||||
|
||||
"INSTALL_DIR_FOR_GLEAM=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
||||
Vendored
-35
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
cd "${RUNNER_TEMP}"
|
||||
|
||||
VSN="$1"
|
||||
FILE_OUTPUT=gleam.tar.gz
|
||||
DIR_FOR_BIN=.setup-beam/gleam
|
||||
|
||||
version_gt() {
|
||||
REFERENCE=$1
|
||||
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$REFERENCE"
|
||||
}
|
||||
|
||||
uses_llvm_triplets() {
|
||||
local VERSION="$1"
|
||||
test "${VERSION}" = "nightly" || version_gt "${VERSION}" "v0.22.1"
|
||||
}
|
||||
|
||||
if uses_llvm_triplets "$VSN"
|
||||
then
|
||||
FILE_INPUT="gleam-${VSN}-x86_64-unknown-linux-musl.tar.gz"
|
||||
else
|
||||
FILE_INPUT="gleam-${VSN}-linux-amd64.tar.gz"
|
||||
fi
|
||||
|
||||
wget -q -O "${FILE_OUTPUT}" "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}"
|
||||
mkdir -p "${DIR_FOR_BIN}/bin"
|
||||
tar zxf "${FILE_OUTPUT}" -C "${DIR_FOR_BIN}/bin"
|
||||
|
||||
echo "Installed Gleam version follows"
|
||||
${DIR_FOR_BIN}/bin/gleam --version
|
||||
|
||||
echo "INSTALL_DIR_FOR_GLEAM=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}"
|
||||
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
param([Parameter(Mandatory=$true)][string]${VSN})
|
||||
|
||||
$ErrorActionPreference="Stop"
|
||||
|
||||
Set-Location ${Env:RUNNER_TEMP}
|
||||
|
||||
$FILE_INPUT="rebar3"
|
||||
$FILE_OUTPUT="rebar3"
|
||||
$FILE_OUTPUT_PS1="rebar3.ps1"
|
||||
$FILE_OUTPUT_CMD="rebar3.cmd"
|
||||
$DIR_FOR_BIN=".setup-beam/rebar3"
|
||||
|
||||
$ProgressPreference="SilentlyContinue"
|
||||
$REBAR3_TARGET="https://github.com/erlang/rebar3/releases/download/${VSN}/${FILE_INPUT}"
|
||||
$REBAR3_NIGHTLY=""
|
||||
If ( ${VSN} -eq "nightly" )
|
||||
{
|
||||
$REBAR3_TARGET="https://s3.amazonaws.com/rebar3-nightly/rebar3"
|
||||
$REBAR3_NIGHTLY=" (from nightly build)"
|
||||
}
|
||||
Invoke-WebRequest "${REBAR3_TARGET}" -OutFile "${FILE_OUTPUT}"
|
||||
$ProgressPreference="Continue"
|
||||
New-Item "${DIR_FOR_BIN}/bin" -ItemType Directory | Out-Null
|
||||
Move-Item "${FILE_OUTPUT}" "${DIR_FOR_BIN}/bin"
|
||||
Write-Output "& escript.exe ${PWD}/${DIR_FOR_BIN}/bin/${FILE_OUTPUT} `${args}" | Out-File -FilePath "${FILE_OUTPUT_PS1}" -Encoding utf8 -Append
|
||||
Write-Output "@echo off`r`nescript.exe ${PWD}/${DIR_FOR_BIN}/bin/${FILE_OUTPUT} %*" | Out-File -FilePath "${FILE_OUTPUT_CMD}" -Encoding utf8 -Append
|
||||
Move-Item "${FILE_OUTPUT_PS1}" "${DIR_FOR_BIN}/bin"
|
||||
Move-Item "${FILE_OUTPUT_CMD}" "${DIR_FOR_BIN}/bin"
|
||||
Write-Output "Installed rebar3 version${REBAR3_NIGHTLY} follows"
|
||||
& "${DIR_FOR_BIN}/bin/rebar3.cmd" "version" | Write-Output
|
||||
|
||||
"INSTALL_DIR_FOR_REBAR3=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
||||
Vendored
-25
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
cd "${RUNNER_TEMP}"
|
||||
|
||||
VSN=${1}
|
||||
FILE_INPUT=rebar3
|
||||
FILE_OUTPUT=rebar3
|
||||
DIR_FOR_BIN=.setup-beam/rebar3
|
||||
|
||||
REBAR3_TARGET="https://github.com/erlang/rebar3/releases/download/${VSN}/${FILE_INPUT}"
|
||||
REBAR3_NIGHTLY=""
|
||||
if [ "${VSN}" == "nightly" ]; then
|
||||
REBAR3_TARGET="https://s3.amazonaws.com/rebar3-nightly/rebar3"
|
||||
REBAR3_NIGHTLY=" (from nightly build)"
|
||||
fi
|
||||
wget -q -O "${FILE_OUTPUT}" "${REBAR3_TARGET}"
|
||||
mkdir -p "${DIR_FOR_BIN}/bin"
|
||||
chmod +x "${FILE_OUTPUT}"
|
||||
mv "${FILE_OUTPUT}" "${DIR_FOR_BIN}/bin"
|
||||
echo "Installed rebar3 version${REBAR3_NIGHTLY} follows"
|
||||
${DIR_FOR_BIN}/bin/rebar3 version
|
||||
|
||||
echo "INSTALL_DIR_FOR_REBAR3=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}"
|
||||
Generated
+520
-347
File diff suppressed because it is too large
Load Diff
+5
-3
@@ -11,14 +11,16 @@
|
||||
"shellcheck": "shellcheck .github/workflows/*.sh",
|
||||
"test": "node test/setup-beam.test.js",
|
||||
"yamllint": "yamllint .github/workflows/**.yml && yamllint .*.yml && yamllint *.yml",
|
||||
"build-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",
|
||||
"@actions/exec": "1.1.1",
|
||||
"@actions/http-client": "2.1.0",
|
||||
"@actions/tool-cache": "2.0.1",
|
||||
"semver": "7.5.3"
|
||||
"semver": "7.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "0.36.1",
|
||||
@@ -30,6 +32,6 @@
|
||||
"yarn": "1.22.19"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=20"
|
||||
}
|
||||
}
|
||||
|
||||
+51
-22
@@ -47,6 +47,10 @@ async function main() {
|
||||
|
||||
await maybeInstallGleam(gleamSpec)
|
||||
await maybeInstallRebar3(rebar3Spec)
|
||||
|
||||
// undefined is replaced by a function, post- main branch merge
|
||||
const setupBeamVersion = 'b8e9da7'
|
||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||
}
|
||||
|
||||
async function installOTP(otpSpec, osVersion) {
|
||||
@@ -131,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
|
||||
@@ -152,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
|
||||
@@ -400,7 +402,7 @@ function getVersionFromSpec(spec0, versions0) {
|
||||
const rangeMax = semver.maxSatisfying(versions, rangeForMax)
|
||||
let version = null
|
||||
|
||||
if (isStrictVersion() || isRC(spec0)) {
|
||||
if (isStrictVersion() || isRC(spec0) || isKnownBranch(spec0)) {
|
||||
if (versions0[spec]) {
|
||||
// If `version-type: strict` or version is RC, we obtain it directly
|
||||
version = versions0[spec]
|
||||
@@ -472,11 +474,16 @@ function isRC(ver) {
|
||||
return ver.match(xyzAbcVersion('^', '(?:-rc\\.?\\d+)'))
|
||||
}
|
||||
|
||||
function isKnownBranch(ver) {
|
||||
return ['main', 'master', 'maint'].includes(ver)
|
||||
}
|
||||
|
||||
function getRunnerOSVersion() {
|
||||
const ImageOSToContainer = {
|
||||
ubuntu18: 'ubuntu-18.04',
|
||||
ubuntu20: 'ubuntu-20.04',
|
||||
ubuntu22: 'ubuntu-22.04',
|
||||
ubuntu24: 'ubuntu-24.04',
|
||||
win19: 'windows-2019',
|
||||
win22: 'windows-2022',
|
||||
}
|
||||
@@ -585,7 +592,7 @@ alongside ${alternativeName}=${alternativeValue} \
|
||||
}
|
||||
|
||||
function parseVersionFile(versionFilePath0) {
|
||||
const versionFilePath = path.join(
|
||||
const versionFilePath = path.resolve(
|
||||
process.env.GITHUB_WORKSPACE,
|
||||
versionFilePath0,
|
||||
)
|
||||
@@ -725,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: {
|
||||
@@ -742,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]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -771,8 +780,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'elixir'
|
||||
const args = ['-v']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -811,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: {
|
||||
@@ -844,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]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -876,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: {
|
||||
@@ -895,23 +911,26 @@ async function install(toolName, opts) {
|
||||
postExtract: async (cachePath) => {
|
||||
const bindir = path.join(cachePath, 'bin')
|
||||
const oldPath = path.join(cachePath, 'rebar3')
|
||||
const newPath = path.join(bindir, 'rebar3')
|
||||
fs.mkdirSync(bindir)
|
||||
fs.chmodSync(oldPath, 0o755)
|
||||
fs.renameSync(oldPath, newPath)
|
||||
fs.chmodSync(newPath, 0o755)
|
||||
|
||||
const ps1Filename = path.join(bindir, 'rebar3.ps1')
|
||||
fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`)
|
||||
fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`)
|
||||
|
||||
const cmdFilename = path.join(bindir, 'rebar3.cmd')
|
||||
fs.writeFileSync(
|
||||
cmdFilename,
|
||||
`@echo off\r\nescript.exe ${oldPath} %*`,
|
||||
`@echo off\r\nescript.exe ${newPath} %*`,
|
||||
)
|
||||
},
|
||||
reportVersion: () => {
|
||||
const cmd = 'rebar3.cmd'
|
||||
const args = ['version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -944,19 +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`)
|
||||
core.addPath(path.join(cachePath, 'bin'))
|
||||
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 ${cachePath}`)
|
||||
core.exportVariable(installDirForVarName, cachePath)
|
||||
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() {
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.0.0
|
||||
- uses: erlef/setup-beam@v1.9.0
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: "23.2"
|
||||
gleam-version: "0.23.0-rc1"
|
||||
|
||||
@@ -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'
|
||||
@@ -182,6 +198,18 @@ async function testOTPVersions() {
|
||||
expected = 'OTP-20.0.5'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = 'maint'
|
||||
osVersion = 'ubuntu-22.04'
|
||||
expected = 'maint'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion, hexMirrors)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
|
||||
spec = 'master'
|
||||
osVersion = 'ubuntu-22.04'
|
||||
expected = 'master'
|
||||
got = await setupBeam.getOTPVersion(spec, osVersion, hexMirrors)
|
||||
assert.deepStrictEqual(got, expected)
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
@@ -523,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