Skip to content
box

GitHub Action

Setup Erlang

v1.1.3 Latest version

Setup Erlang

box

Setup Erlang

Install Erlang/OTP

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Erlang

uses: gleam-lang/setup-erlang@v1.1.3

Learn more about this action in gleam-lang/setup-erlang

Choose a version

setup-erlang

This project is deprecated

Check out this excellent replacement: https://github.com/erlef/setup-beam/

Description

A GitHub action that installs Erlang/OTP for use in your CI workflow.

At present it supports Ubuntu Linux and Windows.

Usage

Basic example

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.0.0
      - uses: gleam-lang/setup-erlang@v1.1.3
        with:
          otp-version: "23.2"
      - run: rebar3 eunit

Matrix example

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    name: OTP ${{matrix.otp}}
    strategy:
      matrix:
        otp: ["23.1", "23.2"]
    steps:
      - uses: actions/checkout@v2.0.0
      - uses: gleam-lang/setup-erlang@v1.1.3
        with:
          otp-version: ${{matrix.otp}}
      - run: rebar3 eunit

Postgresql example

on: push

jobs:
  test:
    runs-on: ubuntu-latest

    services:
      db:
        image: postgres:11
        ports: ['5432:5432']
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@v2.0.0
      - uses: gleam-lang/setup-erlang@v1.1.3
        with:
          otp-version: "23.2"
      - run: rebar3 eunit

Windows example

on: push

jobs:
  test:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2.0.0
      - name: Install Erlang/OTP
        uses: gleam-lang/setup-erlang@v1.1.3
        with:
          otp-version: "23.2"
        id: install_erlang
      - name: Run erl
        # Print the Erlang version
        run: |
          $env:PATH = "${{ steps.install_erlang.outputs.erlpath }}\bin;$env:PATH"
          & erl.exe -eval 'erlang:display({otp_release, erlang:system_info(otp_release)}), halt().' -noshell