forked from santoshphilip/eppy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
131 lines (123 loc) · 4.13 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
language: generic
dist: trusty
sudo: required
env:
global:
- EPPY_INTEGRATION=True ENERGYPLUS_VERSION=9.0.1 ENERGYPLUS_SHA=bb7ca4f0da ENERGYPLUS_INSTALL_VERSION=9-0-1
matrix:
include:
# Linux, not on master
- if: branch != master
os: linux
env: TRAVIS_PYTHON_VERSION=2.7 NUMPY=True
- if: branch != master
os: linux
env: TRAVIS_PYTHON_VERSION=3.7 NUMPY=True
dist: xenial
language: python
python: 3.7
install:
- pip install --upgrade setuptools
- pip install --upgrade pip
- python setup.py install
- pip install numpy
- pip uninstall tinynumpy -y
# we wait to install test dependencies after installing eppy, so as to catch any missing dependencies during setup.py
- pip install pytest-cov codecov black
script:
- black --check --exclude venv .
- py.test ./eppy/tests --cov=./ -v
after_success:
# coverage reporting on CodeCov
- codecov
# Linux, on master
- if: branch = master
os: linux
env: TRAVIS_PYTHON_VERSION=2.7
- if: branch = master
os: linux
env: TRAVIS_PYTHON_VERSION=3.7
- if: branch = master
os: linux
env: TRAVIS_PYTHON_VERSION=2.7 NUMPY=True
- if: branch = master
os: linux
env: TRAVIS_PYTHON_VERSION=3.7 NUMPY=True
dist: xenial
language: python
python: 3.7
install:
- pip install --upgrade setuptools
- pip install --upgrade pip
- python setup.py install
- pip install numpy
- pip uninstall tinynumpy -y
# we wait to install test dependencies after installing eppy, so as to catch any missing dependencies during setup.py
- pip install pytest-cov codecov black
script:
- black --check --exclude venv .
- py.test ./eppy/tests --cov=./ -v
after_success:
# coverage reporting on CodeCov
- codecov
# OSX, not on master
- if: branch != master
os: osx
env: TRAVIS_PYTHON_VERSION=2.7 NUMPY=True
- if: branch != master
os: osx
env: TRAVIS_PYTHON_VERSION=3.7 NUMPY=True
# OSX, on master
- if: branch = master
os: osx
env: TRAVIS_PYTHON_VERSION=2.7
- if: branch = master
os: osx
env: TRAVIS_PYTHON_VERSION=3.7
- if: branch = master
os: osx
env: TRAVIS_PYTHON_VERSION=2.7 NUMPY=True
- if: branch = master
os: osx
env: TRAVIS_PYTHON_VERSION=3.7 NUMPY=True
before_install:
# install EnergyPlus
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then EXT=dmg; PLATFORM=Darwin; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then EXT=sh; PLATFORM=Linux; fi
- ENERGYPLUS_DOWNLOAD_BASE_URL=https://github.com/NREL/EnergyPlus/releases/download/v$ENERGYPLUS_VERSION
- ENERGYPLUS_DOWNLOAD_FILENAME=EnergyPlus-$ENERGYPLUS_VERSION-$ENERGYPLUS_SHA-$PLATFORM-x86_64
- ENERGYPLUS_DOWNLOAD_URL=$ENERGYPLUS_DOWNLOAD_BASE_URL/$ENERGYPLUS_DOWNLOAD_FILENAME.$EXT
- curl -SLO $ENERGYPLUS_DOWNLOAD_URL
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
sudo hdiutil attach $ENERGYPLUS_DOWNLOAD_FILENAME.$EXT;
sudo installer -pkg /Volumes/$ENERGYPLUS_DOWNLOAD_FILENAME/$ENERGYPLUS_DOWNLOAD_FILENAME.pkg -target /;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo chmod +x $ENERGYPLUS_DOWNLOAD_FILENAME.$EXT;
echo "y\r" | sudo ./$ENERGYPLUS_DOWNLOAD_FILENAME.$EXT;
fi
- sudo rm $ENERGYPLUS_DOWNLOAD_FILENAME.$EXT
# install python for OSX
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh;
bash ~/miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
conda update --yes conda;
conda create --yes -n venv python=$TRAVIS_PYTHON_VERSION;
fi
# activate environment
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then source activate venv; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
virtualenv venv;
source venv/bin/activate;
fi
- python --version;
install:
- pip install --upgrade setuptools
- pip install --upgrade pip
- python setup.py install
# install numpy and remove tinynumpy if testing with numpy
- if [[ $NUMPY == numpy ]]; then pip install numpy; pip uninstall tinynumpy -y; fi
- pip install pytest
script:
- py.test ./eppy/tests