Setup-BEAM - GitHub Action

Hi folks! I want share with you with amazing tool for GitHub Actions for integration CI/CD into your Erlang Open Source project :metal:. In order to start using this tool in your Erlang project in GitHub you need to follow the next steps:

  • Create folder .github inside of your root project folder
  • Inside of .github you need create new folder workflows
  • Inside of workflows you need create ci.yaml or ci.yml or you can use any other name of YAML file :crazy_face:

Then you can add something like:

name: CI

on:
  push:
  pull_request:
    branches: [ $default-branch ]
  release:
    types:
      - created
  workflow_dispatch:

jobs:
  ubuntu:
    name: "Ubuntu"
    runs-on: ubuntu-latest
    strategy:
      matrix:
        otp: [23.3, 24.1]
        rebar: [3.17.0]
    steps:
    - uses: actions/checkout@v2
    - uses: erlef/setup-beam@v1
      with:
        otp-version: ${{matrix.otp}}
        rebar3-version: ${{matrix.rebar}}
    - name: Tests
      run: rebar3 ct

And this is it!(Don’t forgot push it into GitHub project :stuck_out_tongue_winking_eye:)

What test your project in Windows? Not a problem, try it:

  windows:
    name: "Windows"
    runs-on: windows-latest
    strategy:
      matrix:
        otp: [23.3, 24.1]
        rebar: [3.17.0]
    steps:
    - uses: actions/checkout@v2
    - uses: erlef/setup-beam@v1
      with:
        otp-version: ${{matrix.otp}}
        rebar3-version: ${{matrix.rebar}}
    - name: Tests
      run: rebar3 ct

If you have a mix project with Elixir or by some any other reason you use Elixir - the Setup-BEAM is also suite for you - just follow the steps in README#example-erlangotp–elixir-on-ubuntu!

7 Likes

The @paulo-f-oliveira was provide new release of setup-beam v1.10.0 few hours ago :partying_face:!

Highlights:

  • optional OTP installation
  • allow for rebar3 nightly builds

Enjoy :metal:

3 Likes

Adding a note for this, it’s in the README, but if anyone comes along this thread it should duly noted that optional otp installation is only currently applicable when using gleam.

5 Likes