-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
121 lines (113 loc) · 4.8 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
language: generic
sudo: false # use container based build
# set clone depth to false to make sure that conda build can write the
# correct GIT_BUILD_STR
git:
depth: false
env:
matrix:
- PYTHON_VERSION=3.7 USE_PIP=false DEPLOY_CONDA=true
- PYTHON_VERSION=3.7 USE_PIP=true DEPLOY_CONDA=false
- PYTHON_VERSION=3.6 USE_PIP=false DEPLOY_CONDA=true
global:
- secure: "YlB2al+7fppkHGVlEaRipwBoVodVzBR77KqBv3UrMmUQ8CRu6FwrMKX39EmbKq89K08q/wMfEtKfO15ICkffEVGlUKCE3VjFTf8tP55ccSgsIF9uXp21/iPJoPzVNhh4nvpp2tD5ObmCtBYVk1HV77ujah4WBTlAkaIIn6/vwvTh3eyFKqGqE4PLntTdQoBp68/5lVMDVCuAWzd1J8NUeWOlqZF4AVVNLGYgHDbeU3YZwpZ3ApRWUq8rjYWoYWO5630eXBcYaUJyhUxpXT1l5Am7j0WoaCAniKgqD8b74a8xY41A0lCDdIF1MtXNrNQ/UmsunP/uvDtVPjcRxiZA1WVhOFL+vpu+oju58IC8jTtfaKTkwUxwBGRn5E5EE5R08iltDOXxA1H+JYPzK6HKq3w2alwFA6/ctoWp5COxaPGL1L+vXsp+EqpcysN0wK94CJturiCYFCAbkN45jh4slywFfw8IzkqQq2yCN7cuPnURvk3MEH37Ss0NxD54hDUFHDOXNc7RY9KyE4vpufi0WPIlqFMxT4e5Zn0PkI1xChG5/XrLl6mCBytMhCXB+HcRMZq92AjO0vAeYRFCKgynMVgjIVCq1axEn/dolKvnjiv/riZzkJfdFggLUUy+VU4JS+kDAlTiZ0OEIfH6IgI5EHdFFRGgQ2MbJkX9wOxhVp4="
os:
- linux
- osx
services:
- xvfb
matrix:
allow_failures:
- env: PYTHON_VERSION=3.7 USE_PIP=true DEPLOY_CONDA=false
before_install:
- if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then export DEPLOY_CONDA=false; fi
# Remove homebrew.
- |
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
echo ""
echo "Removing homebrew from Travis CI to avoid conflicts."
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew
chmod +x ~/uninstall_homebrew
~/uninstall_homebrew -fq
rm ~/uninstall_homebrew
fi
# define functions to unset and reset encrypted variables
- function unset_secure {
CONDA_TOKEN_SAVE=$CONDA_REPO_TOKEN;
unset CONDA_REPO_TOKEN;
}
- function reset_secure {
export CONDA_REPO_TOKEN=$CONDA_TOKEN_SAVE;
}
- unset_secure
# increase open files limit
- ulimit -a
- ulimit -Sn 10000
- ulimit -a
# select the os name for the conda installer
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
OS_NAME=MacOSX;
else
OS_NAME=Linux;
fi
# Install Miniconda.
- |
echo ""
echo "Installing a fresh version of Miniconda."
MINICONDA_URL="https://repo.continuum.io/miniconda"
MINICONDA_FILE="Miniconda3-latest-${OS_NAME}-x86_64.sh"
curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}"
bash $MINICONDA_FILE -bp $HOME/miniconda3
- source $HOME/miniconda3/bin/activate root
- hash -r
- reset_secure
before_script:
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then
export "DISPLAY=:99.0";
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
install:
# unset the global CONDA_REPO_TOKEN variable because it is not needed
# during the tests. This decreases the vulnerability
- unset_secure
- |
echo ""
echo "Configuring conda."
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda config --add channels chilipp
conda config --add channels chilipp/label/master
conda config --add channels chilipp/label/dev
conda update -q conda
conda install conda-build anaconda-client
- 'echo "backend : module://psyplot_gui.backend" > matplotlibrc'
- 'export MATPLOTLIBRC=`pwd`/matplotlibrc'
- export PYTHONWARNINGS='ignore:mode:DeprecationWarning:docutils.io:245'
- if [[ $TRAVIS_TAG == "" ]]; then export GIT_BRANCH=$TRAVIS_BRANCH; fi
- if [[ $USE_PIP == true ]]; then pip install .; fi
- conda info -a
- conda list
- reset_secure
script:
- unset_secure
# install conda
- if [[ $USE_PIP == true ]]; then
python setup.py test -a '
--ignore=tests/widgets/test_selection_toolbar.py
--ignore=tests/widgets/test_samples_table.py
--ignore=tests/widgets/test_beginner.py
--ignore=tests/widgets/test_hoya_del_castillo.py' &&
python setup.py test -a 'tests/widgets/test_selection_toolbar.py
tests/widgets/test_samples_table.py' &&
python setup.py test -a 'tests/widgets/test_beginner.py' &&
python setup.py test -a 'tests/widgets/test_hoya_del_castillo.py';
else
conda build conda-recipe --python $PYTHON_VERSION --clobber-file ci/recipe_clobber_${TRAVIS_OS_NAME}.yaml;
fi
# export the pw to make it available for the deploy
- reset_secure
# deploy here (don't use travis deploy because it requires homebrew)
- if [[ $DEPLOY_CONDA == "true" && $USE_PIP == "false" && $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_REPO_SLUG == "Chilipp/straditize" ]]; then
ci/deploy_anaconda.py;
fi