Building a Erlang project

What This Guide Covers #

For Language versions and other build-environment specific information visit our reference pages:

The rest of this guide covers build environment and configuration topics specific to Erlang projects. Please make sure to read our Tutorial and general build configuration guides first.

Erlang builds are not available on the macOS environment.

Choosing OTP releases to test against #

Travis CI VMs provide 64-bit Erlang OTP releases built using kerl. To specify OTP releases you want your project to be tested against, use the otp_release key:

language: erlang
  - "23.0.2"
  - "22.3.4"

Get a complete list of the pre-compiled versions available on the VM by adding kerl list installations to the before_script: section of your .travis.yml. Note that this list does not include releases which are downloaded on demand, such as 18.1.

Default Test Script #

Travis CI by default assumes your project is built using Rebar3 and uses EUnit. The exact command Erlang builder will use by default is

rebar3 eunit

if your project has rebar.config or Rebar.config files in the repository root.

On older images where rebar3 is not available, we fall back to rebar, and call

rebar compile && rebar skip_deps=true eunit

If neither rebar.config nor Rebar.config is found in the repository root, Erlang builder will fall back to

make test

Dependency Management #

The Erlang builder on Travis CI assumes Rebar3 is used for dependency management. See Rebar3 documentation for further details.

On older images where rebar3 is not available, we fall back to rebar, and run

rebar3 get-deps

to install project dependencies as listed in the rebar.config file.

Environment Variable #

The version of OTP release a job is using is available as:


Build Config Reference #

You can find more information on the build config format for Erlang in our Travis CI Build Config Reference.

OTP/Release versions #

These archives are available for on-demand installation.

Release Arch Name

Examples #

Tutorial(s) #