forked from mozilla/addons-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
36 lines (36 loc) · 1.27 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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:
directories:
- node_modules
before_install:
- npm install -g npm@3
- npm --version
- 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
install:
- npm install
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 -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; 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