I have been assigned the
Ouch perl module for the month of January. While the module seems pretty stable I decided to try and integrate it with
travis-ci. I have never used Travis or created a
Build.PL file. So I set out to find out how to do it. I discovered that its pretty easy.
Create a travis account
Before you create any files, it is easy to create an account. The purpose of a travis account is so that it can access your github account and run the test cases as needed when the repository receives commits. The signup process will ask you to link your github account. After doing so, you can select which repositories that you want travis to watch for.
First you need to create a
.travis.yml file in your repository. The format is pretty simple. Here is an example of mine for perl:
language: perl perl: - "5.18" - "5.16" - "5.14" - "5.12" - "5.10" - "5.8"
You can be as specific as you want to for the language versions. As of today, according to the travis documentation, if you leave out the
perl key with the versions, it will default to
Travis looks for a
Build.PL file at the root level of the repository. I found that using
Module::Build makes it really easy to create a build system for your module.
My build script was this:
That is all you need for travis but if you wanted to make a build file for your own use directly then all you need to do is
perl Build.PL and it outputs a
Build file. There are numerous commands to pass into
Build but I think these are the most common:
./Build installwill install the perl modules into your perl library.
./Build testwill run the test cases for the module.
./Build buildwill compile the libraries.