Test Elixir programs in CircleCI

CircleCI is a serious competitor to Travis CI with its free plan for private projects and lower cost paid plans. Unfortunately, CircleCI v1 does not support testing Elixir programs out of the box. Their version 2 addresses this issue, adding support for Elixir, but at the time this article is written, it is still being beta-tested.

So here’s a bare-minimal template of circle.yml for CircleCI v1 that can test Elixir programs:

circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
machine:
environment:
MIX_ENV: test # use test environment
pre:
# install erlang and elixir
- wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
- sudo dpkg -i erlang-solutions_1.0_all.deb
- sudo apt-get -qq update
- sudo apt-get -qqy install esl-erlang
- sudo apt-get -qqy install elixir

dependencies:
override:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get

compile:
override:
- mix compile

test:
override:
- mix test