Compare commits

..

37 Commits

Author SHA1 Message Date
GitHub Actions 8aa8a857c6 Automation: update setup-beam version output to 3e793a7 2025-05-25 15:49:38 +00:00
Kevin Schweikert 3e793a73ab Override OTP version when specified in Elixir spec (#330) 2025-05-25 10:49:21 -05:00
GitHub Actions 98ad08a06d Automation: update setup-beam version output to f28fd8e 2025-05-25 15:42:38 +00:00
Paulo F. Oliveira f28fd8ebb9 Fix for rebar3 nightly/latest (#331) 2025-05-25 10:42:17 -05:00
GitHub Actions cc72a5b176 Automation: update setup-beam version output to 8e3c26c 2025-04-26 22:55:10 +00:00
Paulo F. Oliveira 8e3c26cc73 chore: approach Node.js' "suites and tests" way of testing (#328) 2025-04-26 17:54:49 -05:00
GitHub Actions 4b97eeaf23 Automation: update setup-beam version output to 3eb03c8 2025-03-24 13:55:49 +00:00
Kian-Meng Ang 3eb03c83a9 Fix invalid Markdown in Compatibility section (#319) 2025-03-24 08:55:30 -05:00
GitHub Actions 0006652c69 Automation: update setup-beam version output to fb48206 2025-03-24 13:50:38 +00:00
github-actions[bot] fb48206988 Update 3rd party licenses (automation) (#320)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2025-03-24 08:50:16 -05:00
GitHub Actions adebba768f Automation: update setup-beam version output to 3360bff 2025-01-31 18:29:43 +00:00
Gilbert Bishop-White 3360bfffe1 Add ability to specify OTP architecture (#316) 2025-01-31 12:29:21 -06:00
GitHub Actions e5b66193a0 Automation: update setup-beam version output to ff934e2 2024-12-08 16:24:11 +00:00
github-actions[bot] ff934e2456 Update 3rd party licenses (automation) (#312)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-12-08 16:23:50 +00:00
GitHub Actions 2ad1b45db1 Automation: update setup-beam version output to 45dc207 2024-12-07 09:59:12 +00:00
github-actions[bot] 45dc207efd Update 3rd party licenses (automation) (#311)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-12-07 09:58:51 +00:00
GitHub Actions 81b8173cf0 Automation: update setup-beam version output to b27f958 2024-12-05 21:20:50 +00:00
github-actions[bot] b27f958e47 Update 3rd party licenses (automation) (#310)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-12-05 21:20:28 +00:00
GitHub Actions ff4f054c91 Automation: update setup-beam version output to 5fa4c5f 2024-11-13 00:54:01 +00:00
Richard Viney 5fa4c5f4ff Update Gleam versions in README.md (#308) 2024-11-12 18:53:41 -06:00
GitHub Actions 58e153bc87 Automation: update setup-beam version output to e511d62 2024-11-11 00:59:47 +00:00
Jonatan Männchen e511d62e46 Remove project specific community health files (#309) 2024-11-11 00:59:17 +00:00
GitHub Actions 5304e04ea2 Automation: update setup-beam version output to 1f578f0 2024-09-25 20:15:02 +00:00
Paulo F. Oliveira 1f578f0ad6 Remove "I have performed a self-review of my changes" from the pull request template (#303) 2024-09-25 21:14:39 +01:00
GitHub Actions d1cc10de68 Automation: update setup-beam version output to d73068e 2024-09-25 11:26:26 +00:00
Wojtek Mach d73068ed6a Fix unit tests
Ref: https://github.com/erlef/setup-beam/pull/304#issuecomment-2373807154
2024-09-25 13:25:31 +02:00
GitHub Actions 074443e9dc Automation: update setup-beam version output to 2fdf20c 2024-09-25 11:21:08 +00:00
Blake Kostner 2fdf20c985 feat: setup custom retry with builtin node fetch (#304) 2024-09-25 13:20:41 +02:00
GitHub Actions d1c02572fa Automation: update setup-beam version output to 9db386c 2024-09-06 13:16:46 +00:00
github-actions[bot] 9db386cf4d Update 3rd party licenses (automation) (#302)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-09-06 14:16:04 +01:00
GitHub Actions b9c58b0450 Automation: update setup-beam version output to a54aa91 2024-07-17 20:57:47 +00:00
Benjamin Schultzer a54aa91870 Fix usage of version latest not matching internal elements (#298) 2024-07-17 21:57:23 +01:00
GitHub Actions 168876b81a Automation: update setup-beam version output to ee8d6d1 2024-07-17 00:53:20 +00:00
Paulo F. Oliveira ee8d6d1ec3 Fix CI (don't use 26.2.5 on Windows; be strict when comparing versions) (#299) 2024-07-16 19:52:57 -05:00
GitHub Actions d2ccea2f14 Automation: update setup-beam version output to e7c76e5 2024-06-28 20:42:40 +00:00
GitHub Actions e7c76e536e Automation: update setup-beam version output to 7f9edf8 2024-06-28 11:48:56 +00:00
Paulo F. Oliveira 7f9edf8627 Tweak/readme (#295) 2024-06-28 06:48:33 -05:00
24 changed files with 1205 additions and 1359 deletions
-1
View File
@@ -4,5 +4,4 @@ A brief description of your changes.
Closes #&lt;issue&gt;.
- [ ] I have performed a self-review of my changes
- [ ] I have read and understood the [contributing guidelines](/erlef/setup-beam/blob/main/CONTRIBUTING.md)
+2 -1
View File
@@ -7,7 +7,7 @@ on:
- main
pull_request:
branches:
- "*"
- '*'
workflow_dispatch: {}
env:
@@ -62,6 +62,7 @@ jobs:
id: setup-beam
uses: ./
with:
install-rebar: false
version-file: test/.tool-versions
version-type: strict
+15 -66
View File
@@ -7,7 +7,7 @@ on:
- main
pull_request:
branches:
- "*"
- '*'
workflow_dispatch: {}
jobs:
@@ -49,13 +49,9 @@ jobs:
version-type: 'strict'
- otp-version: '25'
os: 'ubuntu-24.04'
- otp-version: '25'
- otp-version: '26'
elixir-version: '1.16'
rebar3-version: '3'
os: 'ubuntu-22.04'
- otp-version: '24'
elixir-version: '1.16'
rebar3-version: '3'
rebar3-version: '3.25'
os: 'ubuntu-22.04'
- otp-version: '25.0'
elixir-version: 'v1.13.4-otp-25'
@@ -67,64 +63,17 @@ jobs:
rebar3-version: '3.18.0'
os: 'ubuntu-latest'
version-type: 'strict'
- otp-version: '25'
rebar3-version: 'nightly'
- otp-version: 'latest'
rebar3-version: 'latest'
os: 'ubuntu-latest'
- otp-version: '26'
rebar3-version: 'nightly'
os: 'ubuntu-latest'
- 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.10'
otp-version: '23'
rebar3-version: '3.14'
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.12'
otp-version: '24'
rebar3-version: '3.15'
os: 'ubuntu-20.04'
- elixir-version: 'v1.11.0'
otp-version: '22.3.4.2'
os: 'ubuntu-20.04'
version-type: 'strict'
- elixir-version: '1.10.3'
otp-version: '22.3.4.1'
os: 'ubuntu-20.04'
version-type: 'strict'
- elixir-version: 'main'
otp-version: '23.1'
os: 'ubuntu-20.04'
version-type: 'strict'
- elixir-version: 'main'
otp-version: '25'
os: 'ubuntu-20.04'
version-type: 'strict'
- gleam-version: '0.23'
otp-version: '24'
- gleam-version: '1.9.0'
otp-version: '27'
os: 'ubuntu-latest'
disable_problem_matchers: true
- gleam-version: '0.23.0-rc1'
otp-version: '24'
os: 'ubuntu-latest'
disable_problem_matchers: true
- gleam-version: '0.23.0-rc1'
- gleam-version: '1.9.0'
otp-version: false
os: 'ubuntu-latest'
disable_problem_matchers: true
- gleam-version: '0.22.0' # Version with Gleam's old archive naming convention
otp-version: '24'
os: 'ubuntu-latest'
disable_problem_matchers: true
- elixir-version: 'v1.13'
otp-version: '24'
escript_packages: 'hex protobuf'
@@ -172,12 +121,12 @@ jobs:
if: ${{matrix.combo.rebar3-version}}
- name: Format Gleam project (without installing Erlang/OTP)
run: |
cd test/projects/gleam_gleam
cd test/projects/gleamgleam
gleam format
if: ${{ matrix.combo.gleam-version && !matrix.combo.otp-version }}
- name: Run Gleam project tests (without `rebar3`)
run: |
cd test/projects/gleam_gleam
cd test/projects/gleamgleam
gleam test
if: ${{ matrix.combo.gleam-version && matrix.combo.otp-version && !matrix.combo.rebar3-version }}
- name: Run escript
@@ -193,11 +142,11 @@ jobs:
fail-fast: false
matrix:
combo:
- otp-version: '25'
elixir-version: 'v1.14'
gleam-version: '1.0.0'
rebar3-version: 'nightly'
os: 'ubuntu-latest'
- otp-version: latest
elixir-version: latest
gleam-version: latest
rebar3-version: nightly
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
+7 -16
View File
@@ -38,15 +38,9 @@ jobs:
elixir-version: '1.14.5'
os: 'windows-latest'
version-type: 'strict'
- otp-version: '25'
rebar3-version: 'nightly'
os: 'windows-latest'
- otp-version: '24.0.2'
rebar3-version: '3.16'
os: 'windows-2019'
- otp-version: '26.2.5'
rebar3-version: 'nightly'
os: 'windows-2019'
- otp-version: '23.0'
rebar3-version: '3.15'
os: 'windows-2019'
@@ -58,11 +52,8 @@ jobs:
otp-version: '24'
rebar3-version: '3.15'
os: 'windows-latest'
- gleam-version: '0.19.0-rc3'
otp-version: '24'
os: 'windows-latest'
- gleam-version: '0.23.0-rc1'
otp-version: '24'
- gleam-version: '1.9.0'
otp-version: '27'
os: 'windows-latest'
- elixir-version: 'v1.13'
otp-version: '24'
@@ -131,11 +122,11 @@ jobs:
fail-fast: false
matrix:
combo:
- otp-version: '25'
elixir-version: 'v1.14'
gleam-version: '1.0.0'
rebar3-version: 'nightly'
os: 'windows-latest'
- otp-version: latest
elixir-version: latest
gleam-version: latest
rebar3-version: nightly
os: windows-latest
steps:
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
+4 -106
View File
@@ -2239,30 +2239,6 @@ the licensed code:
-----
The following software may be included in this product: function-bind. A copy of the source code may be downloaded from https://github.com/Raynos/function-bind.git. This software contains the following license and notice below:
Copyright (c) 2013 Raynos.
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: get-caller-file. A copy of the source code may be downloaded from git+https://github.com/stefanpenner/get-caller-file.git. This software contains the following license and notice below:
ISC License (ISC)
@@ -2274,32 +2250,6 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE
-----
The following software may be included in this product: get-intrinsic. A copy of the source code may be downloaded from git+https://github.com/ljharb/get-intrinsic.git. This software contains the following license and notice below:
MIT License
Copyright (c) 2020 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: glob. A copy of the source code may be downloaded from git://github.com/isaacs/node-glob.git. This software contains the following license and notice below:
The ISC License
@@ -2510,7 +2460,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-----
The following software may be included in this product: has-property-descriptors, has-proto. A copy of the source code may be downloaded from git+https://github.com/inspect-js/has-property-descriptors.git (has-property-descriptors), git+https://github.com/inspect-js/has-proto.git (has-proto). This software contains the following license and notice below:
The following software may be included in this product: has-property-descriptors. A copy of the source code may be downloaded from git+https://github.com/inspect-js/has-property-descriptors.git. This software contains the following license and notice below:
MIT License
@@ -2536,58 +2486,6 @@ SOFTWARE.
-----
The following software may be included in this product: has-symbols. A copy of the source code may be downloaded from git://github.com/inspect-js/has-symbols.git. This software contains the following license and notice below:
MIT License
Copyright (c) 2016 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: hasown. A copy of the source code may be downloaded from git+https://github.com/inspect-js/hasOwn.git. This software contains the following license and notice below:
MIT License
Copyright (c) Jordan Harband and contributors
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: ieee754. A copy of the source code may be downloaded from git://github.com/feross/ieee754.git. This software contains the following license and notice below:
Copyright 2008 Fair Oaks Labs, Inc.
@@ -3201,11 +3099,11 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-----
The following software may be included in this product: ms. A copy of the source code may be downloaded from https://github.com/zeit/ms.git. This software contains the following license and notice below:
The following software may be included in this product: ms. A copy of the source code may be downloaded from https://github.com/vercel/ms.git. This software contains the following license and notice below:
The MIT License (MIT)
Copyright (c) 2016 Zeit, Inc.
Copyright (c) 2020 Vercel, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -9464,7 +9362,7 @@ The following software may be included in this product: reusify. A copy of the s
The MIT License (MIT)
Copyright (c) 2015 Matteo Collina
Copyright (c) 2015-2024 Matteo Collina
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
-77
View File
@@ -1,77 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at
[support@github.com](mailto:support@github.com). All complaints will be
reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated
to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
<https://www.contributor-covenant.org/faq>
+147 -121
View File
@@ -71,14 +71,14 @@ be the latest.
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.0 - 25.3 | ✅
| `ubuntu-20.04` | 21.0 - 27 | ✅
| `ubuntu-22.04` | 24.2 - 27 | ✅
| `ubuntu-24.04` | 24.3 - 27 | ✅
| `windows-2019` | 21* - 25 | ✅
| `windows-2022` | 21* - 27 | ✅
| Operating system | Erlang/OTP | OTP Architecture | Status
|- |- | - |-
| `ubuntu-18.04` | 17.0 - 25.3 | x86_64, arm64 | ✅
| `ubuntu-20.04` | 21.0 - 27 | x86_64, arm64 | ✅
| `ubuntu-22.04` | 24.2 - 27 | x86_64, arm64 | ✅
| `ubuntu-24.04` | 24.3 - 27 | x86_64, arm64 | ✅
| `windows-2019` | 21\* - 25 | x86_64, x86 |
| `windows-2022` | 21\* - 27 | x86_64, x86 |
**Note** \*: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3,
22.0, etc.
@@ -106,7 +106,7 @@ jobs:
test:
runs-on: self-hosted
env:
ImageOS: ubuntu20 # equivalent to runs-on ubuntu-20.04
ImageOS: ubuntu24 # equivalent to runs-on ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
@@ -121,7 +121,7 @@ The action provides the following outputs:
|- |-
| `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`
| `gleam-version` | The Gleam version, e.g. `v1.5.1`
| `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`
@@ -153,110 +153,7 @@ with the following correspondence.
| `gleam-version` | `gleam`
| `rebar3-version` | `rebar`
### Example (Erlang/OTP + Elixir, on Ubuntu)
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: ubuntu-20.04
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
matrix:
otp: ['21.1', '22.2', '23.3']
elixir: ['1.8.2', '1.9.4']
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- run: mix deps.get
- run: mix test
```
### Example (Erlang/OTP + `rebar3`, on Ubuntu)
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: ubuntu-20.04
name: Erlang/OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}}
strategy:
matrix:
otp: ['21.1', '22.2', '23.3']
rebar3: ['3.14.1', '3.14.3']
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
- run: rebar3 ct
```
### Example (Erlang/OTP + `rebar3`, on Windows)
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '24'
rebar3-version: '3.16.1'
- run: rebar3 ct
```
### Example (Gleam on Ubuntu)
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '24'
gleam-version: '0.23.0-rc1'
- run: gleam test
```
### Example (Gleam on Ubuntu without OTP)
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: false
gleam-version: '0.23.0-rc1'
- run: gleam check
```
**Note**: the `otp-version: false` input is only applicable when installing Gleam.
## Alternative hex.pm mirrors
### Alternative hex.pm mirrors
It is possible to use alternative hex.pm mirror(s), in their declared order, with
option `hexpm-mirrors`. By default, the action will use `builds.hex.pm`.
@@ -297,7 +194,25 @@ jobs:
https://cdn.jsdelivr.net/hex
```
## Environment variables
### OTP Architecture
On Windows you can specify the OTP architecture to install.
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: windows-latest
steps:
- uses: erlef/setup-beam@v1
with:
otp-version: '26'
otp-architecture: '32'
```
### Environment variables
Base installation folders (useful for e.g. fetching headers for NIFs) are available in the following
environment variables:
@@ -310,13 +225,120 @@ environment variables:
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
### Elixir Problem Matchers
The Elixir Problem Matchers in this repository are adapted from
[here](https://github.com/fr1zle/vscode-elixir/blob/45eddb589acd7ac98e0c7305d1c2b24668ca709a/package.json#L70-L118).
See [MATCHER_NOTICE](MATCHER_NOTICE.md) for license details.
## Action versioning
## Examples
### Erlang/OTP + Elixir, on Ubuntu
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: ubuntu-24.04
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
matrix:
otp: ['25.3.2', '26.2.5', '27.3.3']
elixir: ['1.17.3', '1.18.3']
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- run: mix deps.get
- run: mix test
```
### Erlang/OTP + `rebar3`, on Ubuntu
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: ubuntu-24.04
name: Erlang/OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}}
strategy:
matrix:
otp: ['25.3.2', '26.2.5', '27.3.3']
rebar3: ['3.23.0', '3.24.0']
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
- run: rebar3 ct
```
### Erlang/OTP + `rebar3`, on Windows
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '24'
rebar3-version: '3.16.1'
- run: rebar3 ct
```
### Gleam on Ubuntu
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '27'
gleam-version: '1.9.0'
- run: gleam test
```
### Gleam on Ubuntu without OTP
```yaml
# create this in .github/workflows/ci.yml
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: false
gleam-version: '1.9.0'
- run: gleam check
```
**Note**: the `otp-version: false` input is only applicable when installing Gleam.
## The project
### Versioning
`setup-beam` has three version paths, described below, for example version `1.8.0`:
@@ -328,14 +350,18 @@ We make a real effort to not introduce incompatibilities without changing the ma
version number. To be extra safe against changes causing issues in your CI you should specify
an exact version with `@vx.y.z`.
## License
### License
The scripts and documentation in this project are released under the [MIT license](LICENSE.md).
## Contributing
### Contributing
Check out [this doc](CONTRIBUTING.md).
## Current Status
### Code of Conduct
This action is in active development.
This project's code of conduct is made explicit in [CODE_OF_CONDUCT.md](https://github.com/erlef/setup-beam/blob/main/CODE_OF_CONDUCT.md).
### Security
This project's security policy is made explicit in [SECURITY.md](https://github.com/erlef/setup-beam/blob/main/SECURITY.md).
-34
View File
@@ -1,34 +0,0 @@
# Security policy
Thanks for helping make `setup-beam` safer for everyone.
Find below updated information on our security policy.
## Security
We take the security of this software seriously.
We don't implement a bug bounty program or bounty rewards, but will work with
you to ensure that your findings get the appropriate handling.
## Reporting Security Issues
If you believe you have found a security vulnerability in this repository,
please report it to <bryan.paxton@erlef.org>.
Please do not report security vulnerabilities through public channels, like
GitHub issues, discussions, or pull requests.
Please include as much of the information listed below as you can to help us
better understand and resolve the issue:
- the type of issue (e.g., buffer overflow, SQL injection, or cross-site
scripting)
- full paths of source file(s) related to the manifestation of the issue
- the location of the affected source code (tag/branch/commit or direct URL)
- any special configuration required to reproduce the issue
- step-by-step instructions to reproduce the issue
- proof-of-concept or exploit code (if possible)
- impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
+3
View File
@@ -19,6 +19,9 @@ inputs:
otp-version:
description: Version range or exact version of Erlang/OTP to use,
or false when installing only Gleam without OTP
otp-architecture:
description: 32 or 64, to specify the architecture of the OTP to install. Only applies to Windows.
default: 64
elixir-version:
description: Version range or exact version of Elixir to use
gleam-version:
+88 -56
View File
@@ -9106,18 +9106,20 @@ exports["default"] = _default;
const core = __nccwpck_require__(2186)
const { exec } = __nccwpck_require__(1514)
const tc = __nccwpck_require__(7784)
const http = __nccwpck_require__(6255)
const path = __nccwpck_require__(1017)
const semver = __nccwpck_require__(1383)
const fs = __nccwpck_require__(7147)
const os = __nccwpck_require__(2037)
const MAX_HTTP_RETRIES = 3
main().catch((err) => {
core.setFailed(err.message)
})
async function main() {
checkPlatform()
checkOtpArchitecture()
const versionFilePath = getInput('version-file', false)
let versions
@@ -9154,7 +9156,7 @@ async function main() {
await maybeInstallRebar3(rebar3Spec)
// undefined is replaced by a function, post- main branch merge
const setupBeamVersion = '21a744d'
const setupBeamVersion = '3e793a7'
core.setOutput('setup-beam-version', setupBeamVersion)
}
@@ -9282,7 +9284,13 @@ async function getOTPVersion(otpSpec0, osVersion) {
async function getElixirVersion(exSpec0, otpVersion0) {
const otpVersion = otpVersion0.match(/^([^-]+-)?(.+)$/)[2]
const otpVersionMajor = otpVersion.match(/^([^.]+).*$/)[1]
let otpVersionMajor = otpVersion.match(/^([^.]+).*$/)[1]
const userSuppliedOtp = exSpec0.match(/-otp-(\d+)/)?.[1] ?? null
if (userSuppliedOtp && isVersion(userSuppliedOtp)) {
otpVersionMajor = userSuppliedOtp
}
const [otpVersionsForElixirMap, elixirVersions] = await getElixirVersions()
const spec = exSpec0.replace(/-otp-.*$/, '')
@@ -9361,8 +9369,7 @@ async function getOTPVersions(osVersion) {
hexMirrors: hexMirrorsInput(),
actionTitle: `fetch ${originListing}`,
action: async (hexMirror) => {
const l = await get(`${hexMirror}${originListing}`, [null])
return l
return get(`${hexMirror}${originListing}`, [])
},
})
} else if (process.platform === 'win32') {
@@ -9388,13 +9395,16 @@ async function getOTPVersions(osVersion) {
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
})
} else if (process.platform === 'win32') {
const file_regex = new RegExp(
`^otp_win${getInput('otp-architecture')}_(.*).exe$`,
)
otpVersionsListings.forEach((otpVersionsListing) => {
jsonParseAsList(otpVersionsListing)
otpVersionsListing
.map((x) => x.assets)
.flat()
.filter((x) => x.name.match(/^otp_win64_.*.exe$/))
.filter((x) => x.name.match(file_regex))
.forEach((x) => {
const otpMatch = x.name.match(/^otp_win64_(.*).exe$/)
const otpMatch = x.name.match(file_regex)
const otpVersion = otpMatch[1]
debugLog('OTP line and parsing', [otpMatch, otpVersion])
otpVersions[otpVersion] = otpVersion
@@ -9413,8 +9423,7 @@ async function getElixirVersions() {
hexMirrors: hexMirrorsInput(),
actionTitle: `fetch ${originListing}`,
action: async (hexMirror) => {
const l = await get(`${hexMirror}${originListing}`, [null])
return l
return get(`${hexMirror}${originListing}`, [])
},
})
const otpVersionsForElixirMap = {}
@@ -9447,7 +9456,7 @@ async function getGleamVersions() {
)
const gleamVersionsListing = {}
resultJSONs.forEach((resultJSON) => {
jsonParseAsList(resultJSON)
resultJSON
.map((x) => x.tag_name)
.forEach((ver) => {
const gleamMatch = ver.match(/^v?([^ ]+)/)
@@ -9466,7 +9475,7 @@ async function getRebar3Versions() {
)
const rebar3VersionsListing = {}
resultJSONs.forEach((resultJSON) => {
jsonParseAsList(resultJSON)
resultJSON
.map((x) => x.tag_name)
.forEach((ver) => {
rebar3VersionsListing[ver] = ver
@@ -9536,6 +9545,8 @@ function getVersionFromSpec(spec0, versions0) {
// If `version-type: strict` or version is RC, we obtain it directly
version = versions0[spec]
}
} else if (spec0 === 'latest') {
version = versions0[versions0.latest]
} else if (rangeMax !== null) {
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
const thatVersion = spec
@@ -9604,7 +9615,7 @@ function isRC(ver) {
}
function isKnownBranch(ver) {
return ['main', 'master', 'maint', 'latest'].includes(ver)
return ['main', 'master', 'maint'].includes(ver)
}
function githubARMRunnerArchs() {
@@ -9658,38 +9669,56 @@ function getRunnerOSVersion() {
return containerFromEnvImageOS
}
async function get(url0, pageIdxs) {
async function getPage(pageIdx) {
const url = new URL(url0)
const headers = {}
const GithubToken = getInput('github-token', false)
if (GithubToken && url.host === 'api.github.com') {
headers.authorization = `Bearer ${GithubToken}`
}
if (pageIdx !== null) {
url.searchParams.append('page', pageIdx)
}
const httpClient = new http.HttpClient('setup-beam', [], {
allowRetries: true,
maxRetries: 3,
async function getUrlResponse(url, headers, attempt = 1) {
try {
const response = await fetch(url, {
headers,
signal: AbortSignal.timeout(10000),
})
const response = await httpClient.get(url, headers)
if (response.statusCode >= 400 && response.statusCode <= 599) {
throw new Error(
`Got ${response.statusCode} from ${url}. Exiting with error`,
)
const contentType = response.headers.get('content-type') || ''
if (!response.ok) {
throw new Error(response.statusText)
}
return response.readBody()
if (contentType.indexOf('application/json') !== -1) {
return response.json()
} else {
return response.text()
}
} catch (err) {
core.debug(`Error fetching from ${url}: ${err}`)
if (attempt <= MAX_HTTP_RETRIES) {
const delay = attempt * 2 * 1000
core.debug(`Error during fetch. Retrying in ${delay}ms`)
await new Promise((resolve) => setTimeout(resolve, delay))
return getUrlResponse(url, headers, attempt + 1)
} else {
throw err
}
}
}
async function get(url0, pageIdxs) {
const url = new URL(url0)
const headers = {}
const GithubToken = getInput('github-token', false)
if (GithubToken && url.host === 'api.github.com') {
headers.authorization = `Bearer ${GithubToken}`
}
if (pageIdxs[0] === null) {
return getPage(null)
if (pageIdxs.length === 0) {
return getUrlResponse(url, headers)
} else {
return Promise.all(
pageIdxs.map((page) => {
const urlWithPage = new URL(url)
urlWithPage.searchParams.append('page', page)
return getUrlResponse(urlWithPage, headers)
}),
)
}
return Promise.all(pageIdxs.map(getPage))
}
function maybePrependWithV(v) {
@@ -9784,21 +9813,6 @@ function parseVersionFile(versionFilePath0) {
return appVersions
}
function jsonParseAsList(maybeJson) {
try {
const obj = JSON.parse(maybeJson)
if (!Array.isArray(obj)) {
throw new Error('expected a list!')
}
return obj
} catch (exc) {
throw new Error(
`Got an exception when trying to parse non-JSON list ${maybeJson}: ${exc}`,
)
}
}
function debugLog(groupName, message) {
const group = `Debugging for ${groupName}`
core.debug(
@@ -9895,7 +9909,9 @@ async function install(toolName, opts) {
win32: {
downloadToolURL: () =>
'https://github.com/erlang/otp/releases/download/' +
`OTP-${toolVersion}/otp_win64_${toolVersion}.exe`,
`OTP-${toolVersion}/otp_win${getInput(
'otp-architecture',
)}_${toolVersion}.exe`,
extract: async () => ['file', 'otp.exe'],
postExtract: async (cachePath) => {
const cmd = path.join(cachePath, 'otp.exe')
@@ -10036,7 +10052,7 @@ async function install(toolName, opts) {
const bindir = path.join(cachePath, 'bin')
const oldPath = path.join(cachePath, 'rebar3')
const newPath = path.join(bindir, 'rebar3')
fs.mkdirSync(bindir)
fs.mkdirSync(bindir, { recursive: true })
fs.renameSync(oldPath, newPath)
fs.chmodSync(newPath, 0o755)
},
@@ -10151,11 +10167,27 @@ function checkPlatform() {
}
}
function checkOtpArchitecture() {
if (process.platform !== 'win32' && getInput('otp-architecture') == '32') {
throw new Error(
'@erlef/setup-beam only supports otp-architecture=32 on Windows',
)
}
if (
getInput('otp-architecture') !== '32' &&
getInput('otp-architecture') !== '64'
) {
throw new Error('otp-architecture must be 32 or 64')
}
}
function debugLoggingEnabled() {
return !!process.env.RUNNER_DEBUG
}
module.exports = {
get,
getOTPVersion,
getElixirVersion,
getGleamVersion,
-1
View File
@@ -9,7 +9,6 @@
"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.6.2"
},
+1 -2
View File
@@ -9,7 +9,7 @@
"licenses": "yarn licenses generate-disclaimer > 3RD_PARTY_LICENSES",
"markdownlint": "markdownlint *.md ./github/**/*.md",
"shellcheck": "shellcheck .github/workflows/*.sh",
"test": "node test/setup-beam.test.js",
"test": "node --test --test-reporter=spec",
"yamllint": "yamllint .github/workflows/**.yml && yamllint .*.yml && yamllint *.yml",
"clean-dist": "rm -rf ./dist",
"lint": "npm run markdownlint && npm run shellcheck && npm run yamllint && npm run jslint",
@@ -18,7 +18,6 @@
"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.6.2"
},
+88 -56
View File
@@ -1,18 +1,20 @@
const core = require('@actions/core')
const { exec } = require('@actions/exec')
const tc = require('@actions/tool-cache')
const http = require('@actions/http-client')
const path = require('path')
const semver = require('semver')
const fs = require('fs')
const os = require('os')
const MAX_HTTP_RETRIES = 3
main().catch((err) => {
core.setFailed(err.message)
})
async function main() {
checkPlatform()
checkOtpArchitecture()
const versionFilePath = getInput('version-file', false)
let versions
@@ -49,7 +51,7 @@ async function main() {
await maybeInstallRebar3(rebar3Spec)
// undefined is replaced by a function, post- main branch merge
const setupBeamVersion = '21a744d'
const setupBeamVersion = '3e793a7'
core.setOutput('setup-beam-version', setupBeamVersion)
}
@@ -182,7 +184,13 @@ async function getOTPVersion(otpSpec0, osVersion) {
async function getElixirVersion(exSpec0, otpVersion0) {
const otpVersion = otpVersion0.match(/^([^-]+-)?(.+)$/)[2]
const otpVersionMajor = otpVersion.match(/^([^.]+).*$/)[1]
let otpVersionMajor = otpVersion.match(/^([^.]+).*$/)[1]
const userSuppliedOtp = exSpec0.match(/-otp-(\d+)/)?.[1] ?? null
if (userSuppliedOtp && isVersion(userSuppliedOtp)) {
otpVersionMajor = userSuppliedOtp
}
const [otpVersionsForElixirMap, elixirVersions] = await getElixirVersions()
const spec = exSpec0.replace(/-otp-.*$/, '')
@@ -261,8 +269,7 @@ async function getOTPVersions(osVersion) {
hexMirrors: hexMirrorsInput(),
actionTitle: `fetch ${originListing}`,
action: async (hexMirror) => {
const l = await get(`${hexMirror}${originListing}`, [null])
return l
return get(`${hexMirror}${originListing}`, [])
},
})
} else if (process.platform === 'win32') {
@@ -288,13 +295,16 @@ async function getOTPVersions(osVersion) {
otpVersions[otpVersion] = otpVersionOrig // we keep the original for later reference
})
} else if (process.platform === 'win32') {
const file_regex = new RegExp(
`^otp_win${getInput('otp-architecture')}_(.*).exe$`,
)
otpVersionsListings.forEach((otpVersionsListing) => {
jsonParseAsList(otpVersionsListing)
otpVersionsListing
.map((x) => x.assets)
.flat()
.filter((x) => x.name.match(/^otp_win64_.*.exe$/))
.filter((x) => x.name.match(file_regex))
.forEach((x) => {
const otpMatch = x.name.match(/^otp_win64_(.*).exe$/)
const otpMatch = x.name.match(file_regex)
const otpVersion = otpMatch[1]
debugLog('OTP line and parsing', [otpMatch, otpVersion])
otpVersions[otpVersion] = otpVersion
@@ -313,8 +323,7 @@ async function getElixirVersions() {
hexMirrors: hexMirrorsInput(),
actionTitle: `fetch ${originListing}`,
action: async (hexMirror) => {
const l = await get(`${hexMirror}${originListing}`, [null])
return l
return get(`${hexMirror}${originListing}`, [])
},
})
const otpVersionsForElixirMap = {}
@@ -347,7 +356,7 @@ async function getGleamVersions() {
)
const gleamVersionsListing = {}
resultJSONs.forEach((resultJSON) => {
jsonParseAsList(resultJSON)
resultJSON
.map((x) => x.tag_name)
.forEach((ver) => {
const gleamMatch = ver.match(/^v?([^ ]+)/)
@@ -366,7 +375,7 @@ async function getRebar3Versions() {
)
const rebar3VersionsListing = {}
resultJSONs.forEach((resultJSON) => {
jsonParseAsList(resultJSON)
resultJSON
.map((x) => x.tag_name)
.forEach((ver) => {
rebar3VersionsListing[ver] = ver
@@ -436,6 +445,8 @@ function getVersionFromSpec(spec0, versions0) {
// If `version-type: strict` or version is RC, we obtain it directly
version = versions0[spec]
}
} else if (spec0 === 'latest') {
version = versions0[versions0.latest]
} else if (rangeMax !== null) {
// Otherwise, we compare alt. versions' semver ranges to this version, from highest to lowest
const thatVersion = spec
@@ -504,7 +515,7 @@ function isRC(ver) {
}
function isKnownBranch(ver) {
return ['main', 'master', 'maint', 'latest'].includes(ver)
return ['main', 'master', 'maint'].includes(ver)
}
function githubARMRunnerArchs() {
@@ -558,38 +569,56 @@ function getRunnerOSVersion() {
return containerFromEnvImageOS
}
async function get(url0, pageIdxs) {
async function getPage(pageIdx) {
const url = new URL(url0)
const headers = {}
const GithubToken = getInput('github-token', false)
if (GithubToken && url.host === 'api.github.com') {
headers.authorization = `Bearer ${GithubToken}`
}
if (pageIdx !== null) {
url.searchParams.append('page', pageIdx)
}
const httpClient = new http.HttpClient('setup-beam', [], {
allowRetries: true,
maxRetries: 3,
async function getUrlResponse(url, headers, attempt = 1) {
try {
const response = await fetch(url, {
headers,
signal: AbortSignal.timeout(10000),
})
const response = await httpClient.get(url, headers)
if (response.statusCode >= 400 && response.statusCode <= 599) {
throw new Error(
`Got ${response.statusCode} from ${url}. Exiting with error`,
)
const contentType = response.headers.get('content-type') || ''
if (!response.ok) {
throw new Error(response.statusText)
}
return response.readBody()
if (contentType.indexOf('application/json') !== -1) {
return response.json()
} else {
return response.text()
}
} catch (err) {
core.debug(`Error fetching from ${url}: ${err}`)
if (attempt <= MAX_HTTP_RETRIES) {
const delay = attempt * 2 * 1000
core.debug(`Error during fetch. Retrying in ${delay}ms`)
await new Promise((resolve) => setTimeout(resolve, delay))
return getUrlResponse(url, headers, attempt + 1)
} else {
throw err
}
}
}
async function get(url0, pageIdxs) {
const url = new URL(url0)
const headers = {}
const GithubToken = getInput('github-token', false)
if (GithubToken && url.host === 'api.github.com') {
headers.authorization = `Bearer ${GithubToken}`
}
if (pageIdxs[0] === null) {
return getPage(null)
if (pageIdxs.length === 0) {
return getUrlResponse(url, headers)
} else {
return Promise.all(
pageIdxs.map((page) => {
const urlWithPage = new URL(url)
urlWithPage.searchParams.append('page', page)
return getUrlResponse(urlWithPage, headers)
}),
)
}
return Promise.all(pageIdxs.map(getPage))
}
function maybePrependWithV(v) {
@@ -684,21 +713,6 @@ function parseVersionFile(versionFilePath0) {
return appVersions
}
function jsonParseAsList(maybeJson) {
try {
const obj = JSON.parse(maybeJson)
if (!Array.isArray(obj)) {
throw new Error('expected a list!')
}
return obj
} catch (exc) {
throw new Error(
`Got an exception when trying to parse non-JSON list ${maybeJson}: ${exc}`,
)
}
}
function debugLog(groupName, message) {
const group = `Debugging for ${groupName}`
core.debug(
@@ -795,7 +809,9 @@ async function install(toolName, opts) {
win32: {
downloadToolURL: () =>
'https://github.com/erlang/otp/releases/download/' +
`OTP-${toolVersion}/otp_win64_${toolVersion}.exe`,
`OTP-${toolVersion}/otp_win${getInput(
'otp-architecture',
)}_${toolVersion}.exe`,
extract: async () => ['file', 'otp.exe'],
postExtract: async (cachePath) => {
const cmd = path.join(cachePath, 'otp.exe')
@@ -936,7 +952,7 @@ async function install(toolName, opts) {
const bindir = path.join(cachePath, 'bin')
const oldPath = path.join(cachePath, 'rebar3')
const newPath = path.join(bindir, 'rebar3')
fs.mkdirSync(bindir)
fs.mkdirSync(bindir, { recursive: true })
fs.renameSync(oldPath, newPath)
fs.chmodSync(newPath, 0o755)
},
@@ -1051,11 +1067,27 @@ function checkPlatform() {
}
}
function checkOtpArchitecture() {
if (process.platform !== 'win32' && getInput('otp-architecture') == '32') {
throw new Error(
'@erlef/setup-beam only supports otp-architecture=32 on Windows',
)
}
if (
getInput('otp-architecture') !== '32' &&
getInput('otp-architecture') !== '64'
) {
throw new Error('otp-architecture must be 32 or 64')
}
}
function debugLoggingEnabled() {
return !!process.env.RUNNER_DEBUG
}
module.exports = {
get,
getOTPVersion,
getElixirVersion,
getGleamVersion,
-19
View File
@@ -1,19 +0,0 @@
# gleam_gleam
A Gleam project
## Quick start
```sh
gleam run # Run the project
gleam test # Run the tests
gleam shell # Run an Erlang shell
```
## Installation
If available on Hex this package can be added to your Gleam project.
```sh
gleam add gleam_gleam
```
-16
View File
@@ -1,16 +0,0 @@
name = "gleam_gleam"
version = "0.1.0"
# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# licences = ["Apache-2.0"]
# description = "A Gleam library..."
# repository = { type = "github", user = "username", repo = "project" }
# links = [{ title = "Website", href = "https://gleam.run" }]
[dependencies]
gleam_stdlib = "~> 0.18"
[dev-dependencies]
gleeunit = "~> 0.5"
-11
View File
@@ -1,11 +0,0 @@
# This file was generated by Gleam
# You typically do not need to edit this file
packages = [
{ name = "gleam_stdlib", version = "0.22.3", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "F2C2D389B06426E1289D5419F89BDE8E0F7F35A40B2BBB3C88188481F0D44A9F" },
{ name = "gleeunit", version = "0.6.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "A006864621DB80C4FBB0746580703502FD81A4D38D23FCB20A8120984D353DF0" },
]
[requirements]
gleam_stdlib = "~> 0.18"
gleeunit = "~> 0.5"
@@ -1,5 +0,0 @@
import gleam/io
pub fn main() {
io.println("Hello from gleam_gleam!")
}
@@ -14,8 +14,10 @@ jobs:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: "23.2"
gleam-version: "0.23.0-rc1"
- run: gleam format --check src test
otp-version: "26.0.2"
gleam-version: "1.5.0"
rebar3-version: "3"
# elixir-version: "1.15.4"
- run: gleam deps download
- run: gleam test
- run: gleam format --check src test
@@ -1,4 +1,4 @@
*.beam
*.ez
build
/build
erl_crash.dump
+24
View File
@@ -0,0 +1,24 @@
# gleamgleam
[![Package Version](https://img.shields.io/hexpm/v/gleamgleam)](https://hex.pm/packages/gleamgleam)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/gleamgleam/)
```sh
gleam add gleamgleam@1
```
```gleam
import gleamgleam
pub fn main() {
// TODO: An example of the project in use
}
```
Further documentation can be found at <https://hexdocs.pm/gleamgleam>.
## Development
```sh
gleam run # Run the project
gleam test # Run the tests
```
+19
View File
@@ -0,0 +1,19 @@
name = "gleamgleam"
version = "1.0.0"
# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "", repo = "" }
# links = [{ title = "Website", href = "" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.
[dependencies]
gleam_stdlib = ">= 0.34.0 and < 2.0.0"
[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
@@ -0,0 +1,5 @@
import gleam/io
pub fn main() {
io.println("Hello from gleamgleam!")
}
+796 -767
View File
File diff suppressed because it is too large Load Diff