forked from pabloitu/oq-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
79 lines (72 loc) · 3.9 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
language: python
dist: bionic
python:
- "3.8"
cache:
pip: true
jobs:
include:
- stage: tests
env: HAZARDLIB
script:
- if echo "$TRAVIS_COMMIT_MESSAGE" | grep -vq '\[skip hazardlib\]' || test "$BRANCH" == "master"; then
pytest --doctest-modules -xv openquake/baselib &&
OQ_DISTRIBUTE=no pytest --doctest-modules -xv -nauto openquake/hazardlib openquake/hmtk openquake/sep && pytest -vsx doc/adv-manual/developing.rst;
fi
after_success:
- pip install sphinx==1.6.5
- sudo apt update; sudo apt-get install -y texlive-fonts-recommended texlive-latex-extra latexmk
- cd doc/sphinx && make html && cd ../adv-manual && make html && make latexpdf
- 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 ../sphinx/build/html/ [email protected]:/var/www/docs.openquake.org/oq-engine/master/ &&
rsync -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' -ax --delete build/html/ build/latex/OpenQuakeforAdvancedUsers.pdf [email protected]:/var/www/docs.openquake.org/oq-engine/advanced/;
fi
- stage: tests
env: ENGINE
before_script:
- oq dbserver start -l DEBUG
script:
- pytest --doctest-modules -xv openquake/engine
- pytest --doctest-modules -xv openquake/server
- pytest --doctest-modules -xv openquake/calculators
- pytest --doctest-modules -xv openquake/risklib
- pytest --doctest-modules -xv openquake/commonlib
- pytest --doctest-modules -xv openquake/commands
- oq webui migrate
after_script:
- oq reset -y
- 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
zip -q -r /tmp/demos.zip demos/ &&
OQ_DISTRIBUTE=zmq bin/run-demos.sh $TRAVIS_BUILD_DIR/demos &&
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/demos.zip [email protected]:/var/www/artifacts.openquake.org/travis/demos-${BRANCH}.zip &&
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /tmp/oqdata.zip [email protected]:/var/www/artifacts.openquake.org/travis/oqdata-${BRANCH}.zip;
fi
after_script:
- oq dbserver stop
before_install:
- if [ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ]; then BRANCH=$TRAVIS_PULL_REQUEST_BRANCH; else BRANCH=$TRAVIS_BRANCH; fi
- pip install -U pip
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.
- if echo "$TRAVIS_COMMIT_MESSAGE" | grep -vq '\[skip wheels\]'; then
pip install -r requirements-py38-linux64.txt;
fi
- pip install pytest-xdist fiona pillow
- pip -q install -e .
before_script:
- python -c'import platform; print(platform.platform()); import multiprocessing; print("#CPUs=%d" % multiprocessing.cpu_count())'