-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
183 lines (179 loc) · 8.46 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
language: generic
env:
global:
- secure: "phWqxuGUbL1waOeDo/Tr7h5AHP4DS6Gr5rnBBXy9SD8+VVgXRUbJmY2VR03JQaiYkToArLDzZt3KujxLStbWmCOvtSmSpLeJCPkTruKuZgaCJyeuqk67GD9BXuMqdiOy5EeiHQGIj/zIjxVpkoL4HRH+7I+3FSb1HCLp5lLFZqYmp9Vy7xbiY2IrON8hOnnzlQPlwtTm5XM0/X2X3zavPSDugYu4LcZaj3U8EAkLAg6KJDKED51eXyPFG8Kj+Knf7DXpTWCoQBjvwp4djfP6Q36rZt3oj8TgqW/fGvixvfptP0MEjVRsYK187kJOCnMb4hwwuJUMDj2hTHrFeKODlP18dKvoPB+cgrKsSntelUXjqMZFCVM1t8YobUmc9S6vgUzoZcVAyGYawawVi0lzFjucUdqxPVn2pqAWCK0MHxcOWH9iLAvl5zg8VLNY7SaGxrycaL/2/qoM2F9KLc16tlCbLOPJUWana4oB3dGn3nc58X1GVhxsluPsdpVlp46AjWbsVwEYhThg36qNJjAU1YU/iZ2sCOsIJGmnKGf7rUmbeM37X1gijiROfYE1YAT8jzdX7OOIa/IpHqkeNoH5cdd/5HSGwlaxoZndgjJJnJliwOheO6BgArvL3AokjoqVlOI8CaUEd+hk9JRFqFa6pEKZpcMhWbbcn10ecNveG98="
- secure: "hMVMSbsLOZUEd4u6g6Z42eSfDKiA3adRlKUTWHe/POxYOt58Cx6ZwgqQMORVjcytExxkra00Bx/IsV1uBL1mynwFLDOtvQQXv295o7Si64PU+u8rcS+9CceUJKB54JXYa4qvRdWbaO4Iz3yHnMCXod0/qnysOclLr7Izs/KRter+f7TZwzI7OQAQoD5cq8308dNPgM0YOvQwuMJBb2JSo23kuy5yoY+yp3MtytgvWXUJwzY65+mN63Ar1Mfp9LhZuLD2JnVQap6x8BMsG14Nb6J6NqY+Ka7Z5u98eOET5DcRvegriEEcweUnxmHuiHSoc2ENUEBN4zbwI6Tltwe0GQG5SkS4YSrVJQuqLUgMYOY+dAT5kG0zb74snRz3+x3Z9lQDP0p9J6T8joMmtvLGRiIX4nV9D7oBb+0HhLXZHzgc86EhbklqQT9IxEKNjwTDuuExKbjfRNmMa6FSw+P3VtGTiF6L9wdofcmd8DcsstUdUFk5gJNhMkUex73AEGPNLe0wjRn+3mFwg9mTXz3RVtdxQqcqmHj4529RyCSzIamIv8mfsZk/1ZYSOvZg72Ca24ABPBD5fJxmL0ebxkrpktYrX+trCJnK2c2hamOpkpmuigV6oElpSRG8uuest7eQPMwqZoCO4jHpmZPfF/8NiZ8i6gYJix6zzqH3DnL+kC4="
matrix:
include:
- os: linux
- os: osx
git:
submodules: false
before_install:
# Remove homebrew geos
- "brew uninstall --ignore-dependencies geos || :"
install:
# unset the global SWITCH_DRIVE_PW variable because it is not needed during
# the installation process. This decreases the vulnerability
- SWITCH_DRIVE_PW_SAVE=$SWITCH_DRIVE_PW
- unset SWITCH_DRIVE_PW
- CONDA_TOKEN_SAVE=$CONDA_REPO_TOKEN
- unset CONDA_REPO_TOKEN
# checkout submodules (but not recursively)
- git submodule update --init
# select the os name for the conda installer
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export OS_NAME=MacOSX;
else
export OS_NAME=Linux;
fi
# checkout current submodules on nightly branch
- if [[ $TRAVIS_BRANCH == nightly ]]; then
git submodule foreach 'git checkout dev';
./update_submodules.sh;
fi
# We do this conditionally because it saves us some downloading if the
# version is the same.
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-"${OS_NAME}"-x86_64.sh -O miniconda.sh;
- 'echo "backend : module://psyplot_gui.backend" > matplotlibrc'
- bash miniconda.sh -b -p $HOME/miniconda
- . $HOME/miniconda/etc/profile.d/conda.sh && conda activate base
- hash -r
- conda config --set always_yes yes --set changeps1 no
# install pandoc for create_package.sh
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
conda install -c conda-forge pandoc;
fi
# update conda
- conda update -q conda
- conda config --set report_errors false
# Useful for debugging any issues with conda
- conda info -a
# install the build tools
- conda install constructor conda-build
# download the packages that will be used in the installer
- conda env create -f environment.yml
- conda activate psyplot_conda
# install the submodules
- cd psyplot && python setup.py install && cd ../ &&
cd psyplot-gui && python setup.py install && cd ../ &&
cd psy-simple && python setup.py install && cd ../ &&
cd psy-maps && python setup.py install && cd ../ &&
cd psy-reg && python setup.py install && cd ../
# prepare the conda recipes
- python recipe_from_setup.py psyplot recipes &&
python recipe_from_setup.py psyplot-gui recipes &&
python recipe_from_setup.py psy-simple recipes &&
python recipe_from_setup.py psy-maps recipes &&
python recipe_from_setup.py psy-reg recipes
# update psy-simple and psy-maps reference figures submodules
- cd psy-simple && git submodule update --init `python tests/get_ref_dir.py` && cd ..
- cd psy-maps && git submodule update --init `python tests/get_ref_dir.py` && cd ..
# print debugging informations
- conda env export -n psyplot_conda
# print versions of all the important requirements
- psyplot -aV
- conda config --add channels chilipp
- conda config --add channels conda-forge
- if [[ $TRAVIS_TAG == '' ]]; then
export PKG_VERSION=0.01;
else
export PKG_VERSION=${TRAVIS_TAG:1};
fi
- export ARGS="-v $PKG_VERSION"
# build the receipts and prepare the constructor files
- python prepare_constructor_files.py recipes/* $ARGS -n psyplot_conda
# deactivate conda environment and delete miniconda
- conda deactivate
- cat psyplot-conda/construct.yaml
# move already downloaded packages to the constructor directory
- CONSTRUCTOR_DIR=$HOME/.conda/constructor/$TRAVIS_OS_NAME-64
- "mkdir -p $CONSTRUCTOR_DIR || :"
- mv $HOME/miniconda/pkgs/*.tar.bz2 $CONSTRUCTOR_DIR
# export the pw to make it available for the deploy
- if [[ $TRAVIS_TAG == "" ]]; then
export SWITCH_DRIVE_PW=$SWITCH_DRIVE_PW_SAVE;
fi
- if [[ $TRAVIS_BRANCH == nightly ]]; then
export CONDA_REPO_TOKEN=$CONDA_TOKEN_SAVE;
fi
before_script:
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then
export "DISPLAY=:99.0";
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
script:
# unset the global SWITCH_DRIVE_PW variable because it is not needed during
# the tests. This decreases the vulnerability
- SWITCH_DRIVE_PW_SAVE=$SWITCH_DRIVE_PW
- unset SWITCH_DRIVE_PW
- CONDA_TOKEN_SAVE=$CONDA_REPO_TOKEN
- unset CONDA_REPO_TOKEN
# construct the executable
- constructor psyplot-conda
- conda deactivate
# install the new file
- DEBUG_PSYPLOT_INSTALLATION=1 NO_PSYPLOT_ALIAS=1 NO_PSYPLOT_APP=1 bash psyplot-conda-*-"${OS_NAME}"-*.sh -p $HOME/psyplot-conda -b
# create the app
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
conda activate base &&
bash create_package.sh &&
conda deactivate;
fi
# export the new path and remove current miniconda installation
- unset conda && . $HOME/psyplot-conda/etc/profile.d/conda.sh && conda activate base && hash -r
# install pytest
- pip install pytest
# try to import some libraries for test
- which psyplot
- psyplot -aV
# run tests for psyplot
- py.test -v psyplot
# run tests for psyplot-gui
- py.test -v psyplot-gui -k "UrlHelpTest or Console"
# run (some) tests for psy-simple
- py.test -v psy-simple psy-simple/tests/test_plotters.py
-k "LinePlotterTest2D or Simple2DPlotterTest2D"
--ignore=psy-simple/tests/widgets
# run (some) tests for psy-maps
- py.test -v psy-maps/tests/test_plotters.py::FieldPlotterTest2D
# run tests for psy-reg
- py.test -v psy-reg -k DensityRegPlotterTest
# export the pw to make it available for the deploy
- if [[ $TRAVIS_TAG == "" ]]; then
export SWITCH_DRIVE_PW=$SWITCH_DRIVE_PW_SAVE;
fi
- if [[ $TRAVIS_BRANCH == nightly ]]; then
export CONDA_REPO_TOKEN=$CONDA_TOKEN_SAVE;
fi
before_deploy:
- 'export FINAL_FILE="$(ls psyplot-conda-*-${OS_NAME}-*.sh) $(ls psyplot-conda-*-${OS_NAME}-*.pkg || :)"'
- if [[ $TRAVIS_BRANCH == nightly ]]; then
conda install conda-build anaconda-client;
export BUILDS="$(ls $HOME/miniconda/conda-bld/${TRAVIS_OS_NAME}-64/*.tar.bz2)";
fi
deploy:
- provider: script
script: ci/deploy_nightly.sh "philipp.sommer@unil.ch:$SWITCH_DRIVE_PW" $FINAL_FILE
skip_cleanup: true
on:
all_branches: true
repo: Chilipp/psyplot-conda
# do not deploy releases
condition: '$TRAVIS_TAG == ""'
- provider: releases
api_key:
secure: m/ttzXxgMNrjP+MkK+HeeCPdiAEfB+TJRvS5Sqxhpokxud4ji1cUUIB2bpWmD7ujju9w1blfxvqR1nt1CET79FKbDmb/He0JiXwKQyQ007Hzm9stpp1Kt+OXoSrfIzeAqmdhlqkrXdGw076FcVHGw7E5GAueAroGOkH0xw7/QJWGo7bOkzE6SoNTGZ1EV1zlsR3HnPP3679AEmIA6iz9aIsy8dGbq0Tb4TMFP+ddCGzMxhCCO1dcgf9+zBw6dl/sZ1NSkiT1OR428sqKVAG8CM7ulL5xcbqtVjVU2SGCQ5TP7V7bx40RSr+KgS/6L7qXgabWxY26q5LhKi4che5Evg+ki2FP28BzLwwRzdrMErwrd/LTwfoLPPFfJ90+YJ3+FOSDz+V6jweUkQUA7+QNYMUixuypPBiwQbW8XPHxk4Z7poTTUHiE4tqO/VpauAa8T3XGrap18cDrxw8bEqvYUjxUbojy92UyhXntm0iqWBfubLAgoWYZ0PikVxxW6E73wf9suEnQkIUMIDfRAdDYHhQDeWkANt7siZYGDx0zf8iBTkTGrdV6uTx+G9+LxzoSoO5oXyCQD30m9/a6dqftTdkCk5i7i2Xr+EpLHzKK/jG2rR+zmDT5dZKEAbVyK0FcxHHB4+r/8VKZP7C5MhqD11Irc2Xr+9iB/lQTwvmDicc=
file: "psyplot-conda-*-${OS_NAME}-*.*"
file_glob: true
overwrite: true
skip_cleanup: true
on:
repo: Chilipp/psyplot-conda
tags: true
- provider: script
script: ci/deploy_anaconda.sh
skip_cleanup: true
on:
branch: nightly