Setting up CircleCI for an Elixir/Phoenix Project
This gives you continuous integration with proper parsing of test results.
Step 1: Phoenix Default Git Ignores
.gitignore to have this for the App artifacts section:
Then add a
.gitkeep file into the following directories:
Step 2: Parseable Test Output
Since Elixir isn’t properly supported, we have to generate XML into a standardized format so CircleCI can parse it and give us our red/green.
Add the following dependency to
Since I still like the default formatter, we tell it to use both in
And specify some config options in
Step 3: Circle.yml
Copy all of this into your
Note: you have to change
APPNAME above to match your actual app’s name.
This works for now (takes almost four minutes to run on Circle, takes a couple seconds locally), but I’m going to guess that it’ll break before long. The first time you run this, it will take fifteen minutes or more to build Erlang and all the rest.
If you want to update this for a newer Elixir/Erlang, make sure you check what the Erlang version is actually called in asdf-erlang as non-released but tagged versions have a particular naming scheme.
I’m indebted to the folks on this thread who had earlier versions of Elixir/Erlang working.