Continuous Improvement on Continuous Integration for Haxe Projects

Things have been moving fast! Since I have written about Travis CI the first time around 2 years ago, there are many news and improvements regarding to using CI services for Haxe projects.

WWX 2015 presentation

The video of my WWX 2015 talk, “Continuous Integration for Haxe Projects”, was released a few days ago. The key idea of my talk is that, CI is surprisingly easy to set up. We don’t even have to write tests - we can simply let the build service compile our code, and the mighty Haxe compiler is already able to catch all kinds of errors for us. I’ve also demonstrated how to set up Travis CI and AppVeyor for a hello world project. Additional links and details can be found in the slides.

Built-in Haxe support in Travis CI

As mentioned in my talk, earlier this year we’ve contributed Haxe support in Travis CI as one of its “community-supported languages”. Since then using Haxe in Travis CI is easier than ever. No need to figure out how to use a PPA or to use a install script. Just specify in .travis.yml that we want to use Haxe and optionally what version(s) we what to use as follows:

language: haxe
  - "3.2.0"
  - development

Multi-OS testing

Previously Travis CI’s multi-OS feature is limited to selected repositories. One has to ask their staff to manually turn it on for specific Github repositories. Earlier this week, Travis CI made their multi-OS feature publicly available. It means that we can now test on both Linux (Ubuntu) and Mac OSX by adding an os section in .travis.yml as follows:

  - linux
  - osx

Windows testing can be done on AppVeyor. Although Haxe is not pre-installed in AppVeyor’s environment, and there is no such concept of “supported languages”, we can still install Haxe easily using Chocolatey in the install section of appveyor.yml:

  - cinst haxe -version 3.2.0 -y
  - RefreshEnv
  - mkdir C:\projects\haxelib
  - haxelib setup C:\projects\haxelib

By the way, AppVeyor has also rolled out a faster build environment, which is used by default for new free OSS accounts. The old environment was super slow that it was a pain to build hxcpp projects in it. With the new environment, building on AppVeyor is now as fast as using local machine or using Travis CI.

More docs and samples

I’ve created a Github repository, HaxeCI, as an example of using CI for a Haxe project. As of writing, it contains configurations for Travis CI and AppVeyor. It also demonstrates how to build and run for each of the Haxe targets in the CI environments. (Thank Andreas for the contributions regarding to the PhantomJS and Flash testing!)

If you haven’t started using CI, NOW is the best time to check it out!

comments powered by Disqus