GitHub Actions
The erlef/setup-elp action installs ELP
in a GitHub Actions workflow, so you can run ELP CLI commands such as
elp lint and elp eqwalize-all on every push and pull request.
Usage
setup-elp downloads the ELP build that matches the Erlang/OTP version
installed on the runner, so set up Erlang/OTP first, for example with
erlef/setup-beam:
name: ELP
on:
- push
- pull_request
jobs:
elp:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: "28.5"
rebar3-version: "3"
- uses: erlef/setup-elp@v1
with:
elp-version: "2026-10-14"
- name: Compile
run: rebar3 as test compile
- name: ELP lint
run: elp lint --no-connect
- name: eqWAlizer
run: elp eqwalize-all --no-connect --bail-on-error
--no-connect runs each command standalone instead of through the ELP daemon,
which brings no benefit to a one-off run on a fresh runner.
Inputs
| Input | Description | Default |
|---|---|---|
elp-version | The ELP version to install: a tag from the releases page (e.g. 2026-10-14) or latest. | latest |
The action supports Linux (ubuntu-*) and macOS (macos-*) runners, on both
x64 and arm64.
Choosing Versions
Each ELP release ships builds for a small set of Erlang/OTP versions, listed in
the Assets section of the release. For example, 2026-10-14 provides builds
for Erlang/OTP 27.3, 28.5 and 29.1. setup-elp picks the build for the exact
<major>.<minor> version of Erlang/OTP on the runner, and the step fails if the
release has no such build. For this reason:
- Pin
otp-versionto a<major>.<minor>version that the ELP release was built for ("28.5"resolves to the latest 28.5.x patch release). A major version alone ("28") resolves to the newest 28.x minor, which may not have an ELP build yet. - Prefer a release tag over
latestforelp-version.latestresolves at run time, so a new ELP release can introduce new diagnostics or change the set of Erlang/OTP builds without any change in your repository. Bump the tag deliberately instead. erlef/setup-elp@v1follows the latest1.xrelease of the action. To make the workflow fully reproducible, reference a release by commit SHA instead:erlef/setup-elp@<commit-sha> # v1.0.0.
Running ELP in a Matrix
If your CI already tests against several Erlang/OTP versions, add the ELP steps to the same job and use the versions the ELP release was built for in the matrix:
jobs:
ci:
runs-on: ubuntu-24.04
name: Erlang ${{matrix.otp}}
env:
ELP_VERSION: "2026-10-14"
strategy:
matrix:
otp: ["27.3", "28.5", "29.1"]
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: "3"
- name: Compile
run: rebar3 do clean, compile
- uses: erlef/setup-elp@v1
with:
elp-version: ${{env.ELP_VERSION}}
- name: ELP lint
run: elp lint --no-connect
- name: eqWAlizer
run: elp eqwalize-all --no-connect --bail-on-error
- name: Test
run: rebar3 do eunit, ct
Annotating Pull Requests
Pass --format github to elp lint or elp eqwalize-all to print each
diagnostic as a GitHub Actions
workflow command.
GitHub shows them as annotations in the workflow run summary and on the
affected lines of the pull request, titled with the diagnostic code (for
example W0016 (deprecated_function) or eqWAlizer: incompatible_types) and
carrying the full message:
- name: ELP lint
run: elp lint --no-connect --format github
- name: eqWAlizer
run: elp eqwalize-all --no-connect --format github --bail-on-error
ELP diagnostics with error severity become error annotations, warning
diagnostics become warning annotations, and weak_warning and information
diagnostics become notices. File paths are relative to the project root, so run
ELP from the root of the repository for the annotations to point at the right
files.
With --format github, elp lint exits with a non-zero status when it reports
any diagnostic, whatever its severity. Pass
--severity error to report, and fail on, errors only.
Failing the Build
elp lintexits with a non-zero status when it reports at least one diagnostic witherrorseverity. Diagnostics with a lower severity are reported but do not fail the step. Use the.elp_lint.tomlconfiguration file to enable or disable linters and to change their severity.elp lintexits with status 2 when it cannot read or parse the.elp_lint.tomlfile, for example when the file names a linter this version of ELP does not know.elp eqwalize-allexits with a zero status even when it reports type errors, unless you pass--bail-on-error.
When adopting ELP in a project with existing findings, you can make the ELP steps non-blocking until the findings are fixed:
- name: ELP lint
run: elp lint --no-connect
continue-on-error: true
To adopt eqWAlizer one module at a time instead, with a blocking check, see Adopting eqWAlizer Incrementally.