Skip to main content
Image for post: NG Cli Travis configuration

NG Cli Travis configuration

To find a working configuration for an Angular v2+ Ng Cli application was not easy. I have built my own solution at the end and the build with Travis finally pass the tests. Remember to sync your Travis account if you have created a new repository: once you have logged in the Travis website, go to your user icon, click on the accountss link and then on the "Sync accounts" button.
Here is my .travis.yml file that you must include in the root of your project. Feel free to update and customize the configuraiton for your own needs.


sudo: required
dist: trusty
addons:
 apt:
   sources:
     - google-chrome
   packages:
     - google-chrome-stable
language: node_js
node_js:
 - 6
 - 7
before_script:
 - export DISPLAY=:99.0
 - sh -e /etc/init.d/xvfb start
 - npm install -g angular-cli
 - npm install -g karma
 - npm install
 # - ng build
install:
 - npm install
script:
 - karma start karma.conf.js --single-run

 

 

Share this post

This website and/or any sub domains use cookies to understand how you to improve your experience.