Recently in an effort to separate the frontend test and backend test on travis, we came to know about the travis feature called matrix, Which helps us to define parallel jobs in the build.
Our initial idea was to define separate ENV
varaibles using matrix and conditionally run the scripts. Our .travis.yml
file looked like below one.
We were able to run jobs in parallel, but still they boot up same vm and configure everything in both VM.
Since for our frontend spec doesn’t need any ruby related stuff we started looking for more ways to override the vm’s used for the jobs. And suddenly this comment caught our eye.
As per the comment there are ways to override vm in matrix but seems like they experimental since there is no documentation was found on it. Also travis lint will throw linting error. But anyway thought of give a try and updated my travis config to the below one.
Now for frontend spec we dont need to setup anything related to ruby.
Now the frontend job uses node_js vm where as backend job uses ruby vm. Also our frontend job finished with in 3 minutes which is 5 minutes gain from previous version since we removed all the ruby and rails setup for this job.
Even though now we have multiple jobs, github integration will show only build status not per job status.
Disclaimer : The above feature is undocumented by travis and may change in future.