1 rebar3-ci
dxtr edited this page 2026-10-11 16:41:50 +02:00

rebar3-ci

Runs a standard quality gate on an Erlang/rebar3 project.

- uses: fakehacker/actions/checkout@v1.0.0
- uses: fakehacker/actions/rebar3-ci@v1.0.0
  # with:
  #   rebar3-url: https://github.com/erlang/rebar3/releases/latest/download/rebar3

Inputs

Input Default Description
rebar3-url https://github.com/erlang/rebar3/releases/latest/download/rebar3 Where to download rebar3 from when it isn't already on PATH. Pin a release URL if you want a reproducible build.

Steps

  1. Ensure rebar3: if rebar3 is missing, it's downloaded to /usr/local/bin/rebar3. The step then prints the OTP release and the rebar3 version.
  2. Compile: rebar3 compile
  3. Xref: rebar3 xref
  4. EUnit: rebar3 eunit. PropEr properties run too if the project wraps them in EUnit tests.
  5. Dialyzer: rebar3 dialyzer

Each step fails the job on a non-zero exit, and the later steps are then skipped.

Requirements

  • bash: the steps use shell: bash. The official erlang:* images include it, but Alpine variants do not.
  • Erlang/OTP on PATH.
  • curl, but only if rebar3 has to be downloaded. The official erlang:* images already ship rebar3.
  • Write access to /usr/local/bin if rebar3 has to be downloaded (true when the container runs as root).

Treating warnings as errors

The action itself doesn't change compiler options. To make warnings fail the build, set warnings_as_errors in your rebar.config:

{erl_opts, [debug_info, warnings_as_errors]}.

Testing several OTP versions

Use a matrix over the image tag:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        otp: ['27', '28', '29']
    container:
      image: erlang:${{ matrix.otp }}
    steps:
      - uses: fakehacker/actions/checkout@v1.0.0
      - uses: fakehacker/actions/rebar3-ci@v1.0.0

Performance note

Dialyzer builds its PLT from scratch on every run because nothing is cached, which can take several minutes on a cold run.