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
- Ensure rebar3: if
rebar3is missing, it's downloaded to/usr/local/bin/rebar3. The step then prints the OTP release and therebar3 version. - Compile:
rebar3 compile - Xref:
rebar3 xref - EUnit:
rebar3 eunit. PropEr properties run too if the project wraps them in EUnit tests. - Dialyzer:
rebar3 dialyzer
Each step fails the job on a non-zero exit, and the later steps are then skipped.
Requirements
bash: the steps useshell: bash. The officialerlang:*images include it, but Alpine variants do not.- Erlang/OTP on
PATH. curl, but only ifrebar3has to be downloaded. The officialerlang:*images already shiprebar3.- Write access to
/usr/local/binifrebar3has 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.