addons-frontend/.travis.yml

37 строки
1.3 KiB
YAML

sudo: required
services:
- docker
addons:
firefox: "latest"
language: node_js
node_js:
- '4'
- '6'
env:
matrix:
- TASK=lint
- TASK=unittest GUI=1
- TASK=servertest
- TOXENV=discopane-ui-tests GUI=1 PYTEST_ADDOPTS=--base-url=http://localhost:4000
- TOXENV=flake8
cache:
yarn: true
directories:
- node_modules
before_install:
- npm install -g npm@3
- if [ $TOXENV ]; then sudo pip install tox; fi
- if [[ $TOXENV == 'discopane-ui-tests' ]]; then wget -O geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.10.0/geckodriver-v0.10.0-linux64.tar.gz; fi
- if [[ $TOXENV == 'discopane-ui-tests' ]]; then gunzip -c geckodriver.tar.gz | tar xopf -; fi
- if [[ $TOXENV == 'discopane-ui-tests' ]]; then chmod +x geckodriver && sudo mv geckodriver /usr/local/bin; fi
before_script:
- if [ $GUI ]; then export DISPLAY=:99.0 && sh -e /etc/init.d/xvfb start && sleep 3; fi
script:
- if [[ $TOXENV == 'discopane-ui-tests' ]]; then
docker run --cidfile=./docker-container.txt -d -p 4000:4000 -e NODE_APP_INSTANCE=disco -e NODE_ENV=uitests $(docker build -q .) /bin/sh -c "npm run build && npm run start" && sleep 60 && docker logs --tail=all $(cat ./docker-container.txt);
fi
- if [ $TOXENV ]; then export PYTEST_ADDOPTS=--base-url=http://localhost:4000 && tox; fi
- if [ -z $TOXENV ]; then npm run $TASK; fi
addons:
firefox: latest