Recently, we recieved a lot of pull requests in out Artemis Entity System repo. Most of them solved lots of our bugs but some also introduced new ones … every merge (or the week after one) was a big pain !!!
To solve this problem we started to search for a CI (continuous integration) system that:
- Was Natively Integrated with GitHub (not only git)
- Worked with .Net C#
- FREE !!!
Travis was (almost) the perfect solution !
The problem was the fact that travis does not support C# .Net out of the box, so we had to make some “magics”.
The ste-by-step is:
- Go to https://travis-ci.org/, sign with your github account
- Link one of your repos with Travis (click in account and go to the repo config — it is very intuitive and well documented)
- Now the magic … go to your project in git hub and create a file called .travis.yml in the root of the repo (like this)
The .travis file contents should be: (adapt to your needs)
## Travis CI Integration language: c install: - sudo apt-get install mono-devel mono-gmcs nunit-console script: - xbuild Artemis_Mono/Artemis_Mono.sln - nunit-console Artemis_Mono/bin/Debug/ArtemisMonoUnitTests.dll
- First we tell we will use the C language (remember, C# is not supported)
- We use apt-get (debian based host =P) to download MONO and NUNIT (to run our unit tests)
- Then we compiler our project using xbuild (clone of msbuild for mono — just point to the .sln file of your project)
- Finaly we run NUNIT in one of the generated DLLs
Thats all !!!
- Every time someone send a pull or a commit to our repo, all the unit tests run (and a report is generated — you will recieve an email if something goes wrong … )
- The code in our repo is (almost never) broken
- We only accept pulls that dont break our code
- In few weeks we sow a HUGE difference !!!
The cool part is that you will be able to use the following image that shows if your build process ran without errors.
You can also access the travis website to see the build in process (like a real time remote ssh terminal =P).