forked from erdc/RAPIDpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
137 lines (123 loc) · 5.38 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
#*******************************************************************************
#.travis.yml
#*******************************************************************************
#Purpose:
#Travis CI is a hosted continuous integration service, that is, it allows
#running code directly from a repository and checking that the code acts as
#expected. The purpose of the .travis.yml file is to give instructions to Travis
#CI on how to do the work.
#Authors:
#Alan D. Snow, 2016, based on initial .yml file by Cedric H. David
#*******************************************************************************
#System specifications for Travis CI
#*******************************************************************************
language: python
python:
- "2.7"
- "3.5"
#CURRENTLY PYTHON NOT SUPPORTED ON OSX
#COMMENTED PORTION FOR WHEN THAT HAPPENS
#os:
# - linux
# - osx
#matrix:
# fast_finish: true
# allow_failures:
# - os: osx
notifications:
email: false
#*******************************************************************************
#Before installing RAPIDpy
#*******************************************************************************
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update -qq;
sudo apt-get install -y g++ gfortran libgdal-dev;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update;
brew install gcc gfortran;
fi
#-------------------------------------------------------------------------------
#Add miniconda - from https://gist.github.com/dan-blanchard/7045057
#-----------------------------------------------------------------------------
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget http://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh;
fi
- chmod +x miniconda.sh
- ./miniconda.sh -b -p $HOME/miniconda
- export PATH=$HOME/miniconda/bin:$PATH
- conda update --yes conda python
#create environment in conda
- conda create --yes --name rapid python=$TRAVIS_PYTHON_VERSION
- source activate rapid
#-----------------------------------------------------------------------------
# Install required python packages
#-----------------------------------------------------------------------------
- conda install --yes nose numpy scipy netCDF4 gdal shapely pyproj
- conda install --yes -c conda-forge rtree
- pip install coveralls nose-cov
#restart environment to get variables set
#- export GDAL_DATA=$HOME/miniconda/share/gdal
- source deactivate rapid
#-------------------------------------------------------------------------------
#Creating directory for installation of libraries used by RAPID
#-------------------------------------------------------------------------------
- cd $TRAVIS_BUILD_DIR
- mkdir ../installz
- cd ../installz
- export INSTALLZ_DIR=$PWD
#-------------------------------------------------------------------------------
#Installing RAPID Prereqs
#-------------------------------------------------------------------------------
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://raw.githubusercontent.com/snowman2/rapid/master/rapid_install_prereqs.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -o rapid_install_prereqs.sh https://raw.githubusercontent.com/snowman2/rapid/master/rapid_install_prereqs.sh ; fi
- chmod +x rapid_install_prereqs.sh
- ./rapid_install_prereqs.sh -i=$INSTALLZ_DIR
#-------------------------------------------------------------------------------
#Exporting environment variables
#-------------------------------------------------------------------------------
- export TACC_NETCDF_LIB=$INSTALLZ_DIR/netcdf-3.6.3-install/lib
- export TACC_NETCDF_INC=$INSTALLZ_DIR/netcdf-3.6.3-install/include
- export PETSC_DIR=$INSTALLZ_DIR/petsc-3.6.2
- export PETSC_ARCH='linux-gcc-c'
#-------------------------------------------------------------------------------
#Exporting directories with library-related executables to $PATH
#-------------------------------------------------------------------------------
- export PATH=$PATH:/$PETSC_DIR/$PETSC_ARCH/bin
- export PATH=$PATH:$INSTALLZ_DIR/netcdf-3.6.3-install/bin
#-------------------------------------------------------------------------------
#Installing RAPID
#-------------------------------------------------------------------------------
- cd $TRAVIS_BUILD_DIR
- cd ..
- git clone https://github.com/c-h-david/rapid.git
- cd rapid/src
- make rapid
#-------------------------------------------------------------------------------
#Installing TauDEM
#-------------------------------------------------------------------------------
- cd $TRAVIS_BUILD_DIR
- cd ..
- git clone https://github.com/dtarb/TauDEM.git
- cd TauDEM/src
- make
#*******************************************************************************
#Installing RAPIDpy
#*******************************************************************************
install:
- source activate rapid
- cd $TRAVIS_BUILD_DIR
- python setup.py install
#*******************************************************************************
#Testing RAPIDpy
#*******************************************************************************
- cd $TRAVIS_BUILD_DIR/tests
script:
- nosetests --with-cov --cov-report term-missing --cov RAPIDpy
##ADD Coveralls stats for code coverage
after_success:
- coveralls