Travis CI
It is a hosted continuous integration platform that is free for all open source projects hosted on Github, With just a file called containing .travis.yml
information about our project, we can trigger automated builds with every change to our code in any branches even in pull or merge request too . for more read here
You can build your Ember applications on Travis CI. The default test framework is Qunit. The following example shows how to build and test against different Ember versions.
The following example shows how to build and test against different Ember versions.
sudo: required
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
language: node_js
node_js:
- "0.12"
env:
- EMBER_VERSION=default
- EMBER_VERSION=release
- EMBER_VERSION=beta
- EMBER_VERSION=canary
matrix:
fast_finish: true
allow_failures:
- env: EMBER_VERSION=release
- env: EMBER_VERSION=beta
- env: EMBER_VERSION=canary
before_install:
# setting the path for phantom.js 2.0.0
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
# starting a GUI to run tests, per https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- "npm config set spin false"
- "npm install -g npm@^2"
install:
- mkdir travis-phantomjs
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs
- export PATH=$PWD/travis-phantomjs:$PATH
- npm install -g bower
- npm install
- bower install
script:
- ember test --server
We are using debain system and all trusty version requires
sudo
sudo: required
dist: trusty
We can provide addons plugins google-chrome for our test cases.
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
Since Ember Application runs on nodejs , we are setting the language as node_js with version of 0.12 which the app will run
language: node_js
node_js:
- "0.12"
Now we are setting the environment to different release of Ember in matrix way and allowing failures in release, beta , canary versions
env:
- EMBER_VERSION=default
- EMBER_VERSION=release
- EMBER_VERSION=beta
- EMBER_VERSION=canary
matrix:
fast_finish: true
allow_failures:
- env: EMBER_VERSION=release
- env: EMBER_VERSION=beta
- env: EMBER_VERSION=canary
In before run we are installing prerequisite packages and setting the environment needed for Ember
before_install:
# setting the path for phantom.js 2.0.0
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
# starting a GUI to run tests, per https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- "npm config set spin false"
In install section we are installing node , bower dependency and setting environment variable in in install section .
install:
- mkdir travis-phantomjs
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs
- export PATH=$PWD/travis-phantomjs:$PATH
- npm install -g bower
- npm install
- bower install
Thus our system is set and we have all dependency file now we can run our test script:
- ember test --server