forked from gem/oq-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
75 lines (67 loc) · 3.11 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
sudo: false
language: python
python:
- "3.5"
# FIXME temporarily disable cache
# cache:
# pip: true
# directories:
# - wheels
jobs:
include:
- stage: tests
env: HAZARDLIB
script:
- if echo "$TRAVIS_COMMIT_MESSAGE" | grep -vq '\[skip hazardlib\]' || test "$BRANCH" == "master"; then
nosetests --with-doctest -xvs -a'!slow' openquake.baselib openquake.hazardlib openquake.hmtk;
fi
- stage: tests
env: ENGINE
before_script:
- oq dbserver start &
script:
- nosetests --with-doctest -xvs -a'!slow' openquake.engine
- nosetests --with-doctest -xvs -a'!slow' openquake.server
- nosetests --with-doctest -xvs -a'!slow' openquake.calculators
- nosetests --with-doctest -xvs -a'!slow' openquake.risklib
- nosetests --with-doctest -xvs -a'!slow' openquake.commonlib
- nosetests --with-doctest -xvs -a'!slow' openquake.commands
- oq webui migrate
after_success: # old sphinx does not work well with Python 3.5.4
- pip install sphinx==1.6.5 && cd doc/sphinx && make html
after_script:
- oq dbserver stop
- stage: tests
env: DEMOS
script:
# Upload oqdata.zip to http://artifacts.openquake.org/travis/ only if
# the commit message includes a [demos] tag at the end or branch is master
- if echo "$TRAVIS_COMMIT_MESSAGE" | grep -q '\[demos\]' || test "$BRANCH" == "master"; then
OQ_DISTRIBUTE=zmq time bin/run-demos.sh $TRAVIS_BUILD_DIR/demos &&
oq dbserver stop &&
oq dump /tmp/oqdata.zip &&
oq restore /tmp/oqdata.zip /tmp/oqdata &&
helpers/zipdemos.sh $(pwd)/demos &&
openssl aes-256-cbc -K $encrypted_806ab0daf95c_key -iv $encrypted_806ab0daf95c_iv -in .deploy_rsa.enc -out .deploy_rsa -d &&
chmod 600 .deploy_rsa &&
eval $(ssh-agent -s) && ssh-add .deploy_rsa &&
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /tmp/oqdata.zip [email protected]:/var/www/artifacts.openquake.org/travis/oqdata-${BRANCH}.zip &&
oq workers stop &&
oq reset --yes &&
oq dbserver status | grep -q 'dbserver not-running';
fi
before_install:
- if [ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ]; then BRANCH=$TRAVIS_PULL_REQUEST_BRANCH; else BRANCH=$TRAVIS_BRANCH; fi
install:
# Use '[skip wheels]' to get dependencies from upstream pypi without using cached wheels;
# this is needed to test that (max) requirements in setup.py are still valid.
# Also pip does not cache data when requirements includes full http URLs, so we need
# to download the wheels first, put the folder in cache and then install the wheels from there.
# A second run of 'pip download' will download only the missing wheels.
- if echo "$TRAVIS_COMMIT_MESSAGE" | grep -vq '\[skip wheels\]'; then
pip -q download -r requirements-py35-linux64.txt -d wheels &&
pip -q install wheels/* ;
fi
- pip -q install -e .
before_script:
- python -c'import platform; print(platform.platform()); import multiprocessing; print("#CPUs=%d" % multiprocessing.cpu_count())'