I have an open source software project called Imbo that I have hooked up to Travis-CI for testing of pull requests and pushes on GitHub. I recently came across an issue that made some tests fail on Travis-CI that passed on all other machines I run tests on. The issue seemed to be because of an old version of ImageMagick (6.6.9-7). Travis-CI use this version since they base their VM’s on Ubuntu-12.04-LTS, and that version of ImageMagick is the one currently available on 12.04.
I solved it by compiling my own version of ImageMagick via the
before_install: - wget http://www.imagemagick.org/download/ImageMagick.tar.gz - tar xf ImageMagick.tar.gz - cd ImageMagick* - ./configure --prefix=/usr - make - sudo make install - cd .. - printf "\n" | pecl install imagick-beta
This made the tests pass, but the build went from taking about 2 minutes to 10, so it was not really a good fix. After asking around on the
#travis-ci channel on IRC (freenode) @henrikhodne said that they might upgrade the package if they found a decent PPA. I looked around myself and found a PPA for Ubuntu-12.04 that had a newer version of ImageMagick available, so I decided to try and use that instead of compiling my own to see if that might speed up the build. I replaced the above snippet with the following in the
before_install: - sudo add-apt-repository -y ppa:moti-p/cc - sudo apt-get update - sudo apt-get -y --reinstall install imagemagick - printf "\n" | pecl install imagick-beta
This reduced the build time to around 3 minutes, and all tests are passing! Travis-CI, I LOVE YOU!