Skip to content
Snippets Groups Projects
.travis.yml 3.35 KiB
language: node_js
services:
- docker
- mongodb
branches:
  only:
  - develop
  - experimental
  - "/^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$/"
git:
  depth: 1
node_js:
- '4'
addons:
  apt:
    sources:
    - google-chrome
    - ubuntu-toolchain-r-test
    packages:
    - google-chrome-stable
    - g++-4.8
  firefox: "latest"
before_cache:
- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/log
- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/run
- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/db
cache:
  directories:
  - "$HOME/node_modules"
  - "$HOME/.meteor"
  - "$HOME/.npm"
  - "$HOME/.node-gyp"
  - "$HOME/build/RocketChat/Rocket.Chat/node_modules"
  - "$HOME/build/RocketChat/Rocket.Chat/.meteor/local"
  - "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/.npm"
  - "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/app/node_modules"
  - "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/app/.meteor/local"
before_install:
- if [ ! -e "$HOME/.meteor/meteor" ]; then curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh; fi
# Start X Virtual Frame Buffer for headless testing with real browsers
- .scripts/start-xvfb.sh
install:
- export PATH="$HOME/.meteor:$PATH"
before_script:
- echo "replication:" | sudo tee -a /etc/mongod.conf
- |-
  echo "  replSetName: \"rs0\"" | sudo tee -a /etc/mongod.conf
- sudo service mongod restart
- mkdir /tmp/build
- travis_retry npm install
- |-
  mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})'
- npm run lint
- npm run stylelint
- travis_retry meteor build --headless /tmp/build
- mkdir /tmp/build-test
- tar -xf /tmp/build/Rocket.Chat.tar.gz -C /tmp/build-test/
- cd /tmp/build-test/bundle/programs/server
- npm install -g node-gyp node-pre-gyp
- npm install
- cd -
- mongo --eval 'rs.status()'
- mongo meteor --eval 'db.getCollectionNames()'
script:
- travis_retry npm test
- mongo meteor --eval 'db.dropDatabase()'
- unset MONGO_OPLOG_URL
- travis_retry npm test
before_deploy:
- source ".travis/setartname.sh"