forked from OpenMDAO/dymos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
140 lines (116 loc) · 3.63 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
branches:
only:
- master
- develop
sudo: false
os:
- linux
env:
- PY=2.7 PETSc=3.8.1
- PY=3.6 UPLOAD_DOCS=1 PETSc=3.9.1
language: generic
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gfortran
- libblas-dev
- liblapack-dev
- libopenmpi-dev
- openmpi-bin
ssh_known_hosts:
- web543.webfaction.com
cache:
apt: true
timeout: 300
directories:
- $HOME/.cache/pip
- $HOME/miniconda
before_install:
# Check for existence of files to determine if cache exists
# If the dir doesn't exist, but is slated to be cached later,
# Travis unhelpfully creates it, which then causes "dir already exists"
# errors when you go to actually install the thing, so we must non-intuitively
# delete the file before re-creating it later.
- if [ -f $HOME/miniconda/envs/PY$PY ]; then
echo "cached miniconda environment found";
CACHED_ENV=1;
else
echo "cached miniconda environment not found";
rm -rf $HOME/miniconda;
fi
- if [ "$TRAVIS_REPO_SLUG" = "OpenMDAO/dymos" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
MASTER_BUILD=1;
fi
install:
# get key decrypted, placed, chmodded, and added for passwordless access to WebFaction
- if [ "$encrypted_4548f0b84c7d_key" ]; then
openssl aes-256-cbc -K $encrypted_4548f0b84c7d_key -iv $encrypted_4548f0b84c7d_iv -in travis_deploy_rsa.enc -out /tmp/travis_deploy_rsa -d;
eval "$(ssh-agent -s)";
chmod 600 /tmp/travis_deploy_rsa;
ssh-add /tmp/travis_deploy_rsa;
echo -e "Host web543.webfaction.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config;
fi
# if we have a cached miniconda environment then just activate the cached one, otherwise, build one
- if [ "$CACHED_ENV" ]; then
echo "Using cached environment..."
export PATH=$HOME/miniconda/bin:$PATH;
source $HOME/miniconda/bin/activate PY$PY;
else
echo "Building python environment...";
wget "https://repo.continuum.io/miniconda/Miniconda${PY:0:1}-4.5.11-Linux-x86_64.sh" -O miniconda.sh;
chmod +x miniconda.sh;
./miniconda.sh -b -p $HOME/miniconda;
export PATH=$HOME/miniconda/bin:$PATH;
conda create --yes -n PY$PY python=$PY;
source $HOME/miniconda/bin/activate PY$PY;
conda install --yes cython sphinx mock swig pip;
sudo apt-get install gfortran;
pip install --upgrade pip;
pip install numpy==1.16.0;
pip install scipy==1.2.0;
pip install mpi4py;
pip install matplotlib;
pip install nose;
pip install networkx;
pip install testflo;
pip install pyyaml;
pip install coveralls;
pip install --user travis-sphinx;
git clone https://github.com/OpenMDAO/pyoptsparse.git;
cd pyoptsparse;
if [ "$SNOPT_LOCATION" ] && [ "${PY:0:1}" = "3" ]; then
cd pyoptsparse/pySNOPT;
scp -r "$SNOPT_LOCATION" .;
cd ../..;
fi
python setup.py install;
cd ..;
git clone https://github.com/OpenMDAO/MBI.git;
cd MBI;
python setup.py build install;
cd ..;
if [ "$PETSc" ]; then
echo " >> Installing parallel processing dependencies";
pip install mpi4py;
pip install petsc4py==$PETSc;
fi
fi
# install OpenMDAO in developer mode so we have access to its sphinx extensions
- git clone https://github.com/OpenMDAO/OpenMDAO.git;
- cd OpenMDAO;
- pip install -e .[all];
- cd ..;
# install dymos itself in developer mode.
- pip install -e .;
# display summary of installed packages and their versions
- conda list
script:
- testflo -n 1 dymos --pre_announce --coverage --coverpkg dymos;
- travis-sphinx build --source=dymos/docs;
after_success:
- if [ "$MASTER_BUILD" ] && [ "$UPLOAD_DOCS" ]; then
travis-sphinx deploy;
fi
- coveralls;