I usually post new articles on Tuesday’s but today I’m just putting out a quick post about Travis CI. Since I am driving my Bmark tool to release I figured I should setup continuous integration. I’ve always liked Travis CI but when I checked their website it did not mention support for Elixir. I searched around a bit more and found this Github Issue which was actually closed 2 hours before I started writing this. Though, the actual implementation was done about a month ago.
I decided to document the process for anyone else that was interested.
Setting up Travis CI with Elixir
I follow the the instructions on travis-ci.com and enabled support for the joekain/bmark repo. I setup a .travis.yml file:
language: elixir elixir: - 1.0.0 - 1.0.1 - 1.0.2 otp_release: - 17.0 - 17.1 script: - test.sh
I noticed several core Elixir projects, like Ecto, already have support for Travis CI and I looked over their .travis.yml files for examples on what configuration options are enabled.
I submit the changes and Travis CI ran! But, failed? I need
./test.sh rather than
test.sh of course. Now, it’s running the script but has another error. I need to fix test.sh - it uses
#/bin/sh when it should have
After these minor fixes travis is running and passing! You can see the current status on the Travis CI page for bmark
Now I need badges
Adding a badge to the github README is very simple. I just click on the badge at the top of the Bmark status page and it gives me a bunch of ways to link to the badge. Since I’m using markdown, I pick the markdown code
and now I have my badge
Next week I’ll continue on with my series of posts on releasing Bmark. And I’ll know that I’m not breaking the build thanks to Travis CI.