Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
name: Version with commit unique id
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
permissions:
contents: write
Comment on lines +21 to +22
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was GitHub. If you prefer I can push in a separate pull request to separate concerns.

steps:
- uses: actions/checkout@v4
- name: Version it!
Expand All @@ -39,6 +41,8 @@ jobs:
name: Expected local npm actions
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
permissions:
contents: read
Comment on lines +44 to +45
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was GitHub. If you prefer I can push in a separate pull request to separate concerns.

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -76,3 +80,16 @@ jobs:
node-version: '20'
- run: npm install --production
- run: npm test

unit_tests_macos:
name: Unit tests (macOS)
runs-on: macos-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm test
6 changes: 3 additions & 3 deletions .github/workflows/hexpm-mirrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04', 'windows-2022']
otp-version: ['24']
elixir-version: ['v1.14', '']
os: ['ubuntu-24.04', 'windows-2022', 'macos-15']
otp-version: ['27']
elixir-version: ['v1.18', '']
Comment on lines +21 to +22
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took this time to bump these to more recent versions.

install-rebar: [true, false]
install-hex: [true, false]
steps:
Expand Down
137 changes: 137 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
name: macos
permissions:
contents: read

on:
push:
branches:
- main
pull_request:
branches:
- '*'
workflow_dispatch: {}

jobs:
integration_test:
name: >
OTP ${{matrix.combo.otp-version}},
Elixir ${{matrix.combo.elixir-version}},
rebar3 ${{matrix.combo.rebar3-version}}
runs-on: ${{matrix.combo.os}}
strategy:
fail-fast: false
matrix:
combo:
- otp-version: '27'
elixir-version: 'v1.17.0'
rebar3-version: '3.23'
os: 'macos-latest'
- otp-version: '26.0'
elixir-version: 'v1.14-otp-25'
os: 'macos-latest'
version-type: 'strict'
- otp-version: '26.0'
elixir-version: '1.14.5'
os: 'macos-latest'
version-type: 'strict'
- otp-version: '25.2'
elixir-version: '1.14.2'
os: 'macos-latest'
- otp-version: '25.2'
elixir-version: '1.14.3'
os: 'macos-latest'
version-type: 'strict'
- otp-version: '27'
os: 'macos-15'
version-type: 'strict'
- otp-version: '26'
os: 'macos-15'
version-type: 'strict'
- otp-version: '25'
os: 'macos-15'
- otp-version: '26'
elixir-version: '1.16'
rebar3-version: '3.25'
os: 'macos-14'
- otp-version: '25.0'
elixir-version: 'v1.13.4-otp-25'
rebar3-version: '3.18.0'
os: 'macos-latest'
version-type: 'strict'
- otp-version: '25.0'
elixir-version: 'v1.13.4'
rebar3-version: '3.18.0'
os: 'macos-latest'
version-type: 'strict'
- otp-version: 'latest'
rebar3-version: 'latest'
os: 'macos-latest'
steps:
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
with:
otp-version: ${{matrix.combo.otp-version}}
elixir-version: ${{matrix.combo.elixir-version}}
rebar3-version: ${{matrix.combo.rebar3-version}}
version-type: ${{matrix.combo.version-type}}
- name: Erlang/OTP version (action)
run: echo "Erlang/OTP ${{steps.setup-beam.outputs.otp-version}}"
if: ${{matrix.combo.otp-version}}
- name: Elixir version (action)
run: echo "Elixir ${{steps.setup-beam.outputs.elixir-version}}"
if: ${{matrix.combo.elixir-version}}
- name: rebar3 version (action)
run: echo "rebar3 ${{steps.setup-beam.outputs.rebar3-version}}"
if: ${{matrix.combo.rebar3-version}}
- name: mix version and help (CLI)
run: |
mix -v
mix help local.rebar
mix help local.hex
if: ${{matrix.combo.elixir-version}}
- name: Run Elixir/Mix project tests
run: |
cd test/projects/elixir_mix
mix deps.get
mix test
if: ${{matrix.combo.elixir-version}}
- name: Run Erlang/rebar3 project tests
run: |
cd test/projects/erlang_rebar3
rebar3 ct
if: ${{matrix.combo.rebar3-version}}
- name: Run escript
run: |
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}}
strategy:
fail-fast: false
matrix:
combo:
- otp-version: latest
elixir-version: latest
rebar3-version: nightly
os: macos-latest
steps:
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
with:
otp-version: ${{matrix.combo.otp-version}}
elixir-version: ${{matrix.combo.elixir-version}}
rebar3-version: ${{matrix.combo.rebar3-version}}
- run: env
- name: Check environment variables
run: |
${INSTALL_DIR_FOR_ELIXIR}/bin/elixir -v
${INSTALL_DIR_FOR_OTP}/bin/erl -version
${INSTALL_DIR_FOR_REBAR3}/bin/rebar3 version
52 changes: 36 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# setup-beam [![Action][action-img]][action] [![Ubuntu][ubuntu-img]][ubuntu] [![Windows][windows-img]][windows]
# setup-beam [![Action][action-img]][action] [![Ubuntu][ubuntu-img]][ubuntu] [![Windows][windows-img]][windows] [![macOS][macos-img]][macos]

[action]: https://github.com/erlef/setup-beam/actions/workflows/action.yml
[action-img]: https://github.com/erlef/setup-beam/actions/workflows/action.yml/badge.svg
[ubuntu]: https://github.com/erlef/setup-beam/actions/workflows/ubuntu.yml
[ubuntu-img]: https://github.com/erlef/setup-beam/actions/workflows/ubuntu.yml/badge.svg
[windows]: https://github.com/erlef/setup-beam/actions/workflows/windows.yml
[windows-img]: https://github.com/erlef/setup-beam/actions/workflows/windows.yml/badge.svg
[macos]: https://github.com/erlef/setup-beam/actions/workflows/macos.yml
[macos-img]: https://github.com/erlef/setup-beam/actions/workflows/macos.yml/badge.svg

This action sets up an Erlang/OTP environment for use in a GitHub Actions
workflow by:
Expand All @@ -21,8 +23,6 @@ workflow by:
warnings and errors on pull requests
- optionally, using a version file (as explained in "Version file", below), to identify versions

**Note**: currently, this action only supports Actions' `ubuntu-` and `windows-` runtimes.

## Usage

See [action.yml](action.yml) for the action's specification.
Expand Down Expand Up @@ -73,12 +73,13 @@ and Erlang/OTP.

| 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 | ✅
| `ubuntu-22.04` | 24.2 - 28 | x86_64, arm64 | ✅
| `ubuntu-24.04` | 24.3 - 28 | x86_64, arm64 | ✅
| `windows-2019` | 21\* - 25 | x86_64, x86 | ✅
| `windows-2022` | 21\* - 27 | x86_64, x86 | ✅
| `windows-2022` | 21\* - 28 | x86_64, x86 | ✅
| `macOS-13` | 25.0 - 28 | x86_64, arm64 | ✅
| `macOS-14` | 25.0 - 28 | x86_64, arm64 | ✅
| `macOS-15` | 25.0 - 28 | x86_64, arm64 | ✅

**Note** \*: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3,
22.0, etc.
Expand All @@ -88,14 +89,15 @@ and Erlang/OTP.
Self-hosted runners need to set env. variable `ImageOS` to one of the following, since the action
uses that to download assets:

| ImageOS | Operating system
|- |-
| `ubuntu18` | `ubuntu-18.04`
| `ubuntu20` | `ubuntu-20.04`
| `ubuntu22` | `ubuntu-22.04`
| `ubuntu24` | `ubuntu-24.04`
| `win19` | `windows-2019`
| `win22` | `windows-2022`
| ImageOS | Operating system
|- |-
| `ubuntu22` | `ubuntu-22.04`
| `ubuntu24` | `ubuntu-24.04`
| `win19` | `windows-2019`
| `win22` | `windows-2022`
| `macos13` | `macOS-13`
| `macos14` | `macOS-14`
| `macos15` | `macOS-15`

as per the following example:

Expand Down Expand Up @@ -298,6 +300,24 @@ jobs:
- run: rebar3 ct
```

### Erlang/OTP + `rebar3`, on macOS

```yaml
# create this in .github/workflows/ci.yml
on: push

jobs:
test:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '28'
rebar3-version: '3.25'
- run: rebar3 ct
```

### Gleam on Ubuntu

```yaml
Expand Down
Loading