forked from gem/oq-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
90 lines (83 loc) · 3.88 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
language: python
dist: xenial
python:
- "3.6"
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
pytest -n auto --doctest-module -xv openquake/baselib openquake/hazardlib openquake/hmtk;
fi
- stage: tests
env: ENGINE
before_script:
- oq dbserver start
script:
- pytest --doctest-module -xv openquake/engine
- pytest --doctest-module -xv openquake/server
- pytest --doctest-module -xv openquake/calculators
- pytest --doctest-module -xv openquake/risklib
- pytest --doctest-module -xv openquake/commonlib
- pytest --doctest-module -xv 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 && cd ../adv-manual && make html
- if [[ "$BRANCH" == "master" ]]; then
openssl aes-256-cbc -K $encrypted_806ab0daf95c_key -iv $encrypted_806ab0daf95c_iv -in $TRAVIS_BUILD_DIR/.deploy_rsa.enc -out $TRAVIS_BUILD_DIR/.deploy_rsa -d &&
chmod 600 $TRAVIS_BUILD_DIR/.deploy_rsa &&
eval $(ssh-agent -s) && ssh-add $TRAVIS_BUILD_DIR/.deploy_rsa &&
rsync -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' -ax --delete build/html/ docs@ci.openquake.org:/var/www/docs.openquake.org/oq-engine/advanced/;
fi
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
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 $TRAVIS_BUILD_DIR/.deploy_rsa.enc -out $TRAVIS_BUILD_DIR/.deploy_rsa -d &&
chmod 600 $TRAVIS_BUILD_DIR/.deploy_rsa &&
eval $(ssh-agent -s) && ssh-add $TRAVIS_BUILD_DIR/.deploy_rsa &&
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /tmp/oqdata.zip travis@ci.openquake.org:/var/www/artifacts.openquake.org/travis/oqdata-${BRANCH}.zip &&
oq workers stop &&
oq reset --yes &&
oq dbserver status | grep -q 'dbserver not-running';
fi
- stage: packaging
env: EXEC
script:
- ./.travis/py_shebangs.sh
- ./.travis/py_executables.sh
- stage: packaging
env: WHL
script:
- ./.travis/packaging.sh
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 download -r requirements-py36-linux64.txt -r requirements-extra-py36-linux64.txt -d wheels &&
pip -q install wheels/* ;
fi
- pip install pytest-xdist
- pip -q install -e .
before_script:
- python -c'import platform; print(platform.platform()); import multiprocessing; print("#CPUs=%d" % multiprocessing.cpu_count())'