forked from mne-tools/mne-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
126 lines (121 loc) · 5.3 KB
/
circle.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
machine:
environment:
# We need to set this variable to let Anaconda take precedence
PATH: "/home/ubuntu/miniconda/envs/circleenv/bin:/home/ubuntu/miniconda/bin:$PATH"
MNE_DATA: "/home/ubuntu/mne_data"
DISPLAY: ":99.0"
dependencies:
cache_directories:
- "~/miniconda"
- "~/.mne"
- "~/mne_data/MNE-sample-data"
- "~/mne_data/MNE-testing-data"
- "~/mne_data/MNE-misc-data"
- "~/mne_data/MNE-spm-face"
- "~/mne_data/MNE-somato-data"
- "~/mne_data/MNE-brainstorm-data"
- "~/mne_data/MEGSIM"
- "~/mne_data/MNE-eegbci-data"
- "~/mne-tools.github.io"
# Various dependencies
pre:
# Get a running Python
- cd ~;
# Disable pyenv (no cleaner way provided by CircleCI as it prepends pyenv version to PATH)
- rm -rf ~/.pyenv;
- rm -rf ~/virtualenvs;
# Get Anaconda and conda-based requirements
- >
if [ ! -d "/home/ubuntu/miniconda" ]; then
echo "Setting up conda";
wget -q http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O ~/miniconda.sh;
chmod +x ~/miniconda.sh;
~/miniconda.sh -b -p /home/ubuntu/miniconda;
conda update --yes --quiet conda;
conda create -n circleenv --yes pip python=2.7 pip numpy scipy scikit-learn mayavi matplotlib sphinx pillow six IPython pandas;
sed -i "s/ENABLE_USER_SITE = .*/ENABLE_USER_SITE = False/g" /home/ubuntu/miniconda/envs/circleenv/lib/python2.7/site.py;
else
echo "Conda already set up.";
fi
- ls -al /home/ubuntu/miniconda;
- ls -al /home/ubuntu/miniconda/bin;
- echo $PATH;
- echo $CIRCLE_BRANCH
- which python;
- which pip;
- git clone https://github.com/sphinx-gallery/sphinx-gallery.git;
- cd sphinx-gallery && pip install -r requirements.txt && python setup.py develop;
- cd /home/ubuntu && git clone https://github.com/enthought/pyface.git && cd pyface && python setup.py develop;
- pip install sphinx_bootstrap_theme PySurfer nilearn neo numpydoc;
override:
# Figure out if we should run a full, pattern, or noplot version
- cd /home/ubuntu/mne-python && python setup.py develop;
- python -c "import mne; print(mne.get_config('MNE_DATA'))"
- git branch -a
- PATTERN=""; NEED_SAMPLE=0;
if [ "$CIRCLE_BRANCH" == "master" ] || [[ `git log -1 --pretty=%B` == *"[circle full]"* ]]; then
echo html_dev > build.txt;
elif [ "$CIRCLE_BRANCH" == "maint/0.12" ]; then
echo html_stable > build.txt;
else
FNAMES=$(git diff --name-only $CIRCLE_BRANCH $(git merge-base $CIRCLE_BRANCH origin/master));
echo FNAMES="$FNAMES";
for FNAME in $FNAMES; do
if [[ `expr match $FNAME "\(tutorials\|examples\)/.*plot_.*\.py"` ]] ; then
PATTERN=`basename $FNAME`"\\|"$PATTERN;
NEED_SAMPLE=$(($NEED_SAMPLE + $(cat $FNAME | grep -x ".*datasets.*sample.*" | wc -l)));
fi;
done;
echo PATTERN="$PATTERN";
echo NEED_SAMPLE="$NEED_SAMPLE";
if [[ $PATTERN ]]; then
PATTERN="\(${PATTERN::-2}\)";
echo html_dev-pattern > build.txt;
else
echo html_dev-noplot > build.txt;
fi;
fi;
echo "$PATTERN" > pattern.txt;
echo "$NEED_SAMPLE" > need_sample.txt
- echo BUILD="$(cat build.txt)"
- mkdir -p ~/mne_data;
- ls -al ~/mne_data;
- if [[ $(cat build.txt) == "html_dev" ]] || [[ $(cat build.txt) == "html_stable" ]]; then
python -c "import mne; mne.datasets._download_all_example_data()";
elif [[ $(cat need_sample.txt) -gt 0 ]]; then
python -c "import mne; print(mne.datasets.sample.data_path())";
fi;
- python -c "import mne; mne.sys_info()";
- >
if [ ! -d "/home/ubuntu/mne-tools.github.io" ]; then
cd .. && git clone https://github.com/mne-tools/mne-tools.github.io.git && cd mne-tools.github.io;
fi;
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset;
test:
override:
- if [[ $(cat build.txt) == "html_dev-noplot" ]]; then cd doc && make html_dev-noplot; elif [[ $(cat build.txt) == "html_dev-pattern" ]]; then cd doc && PATTERN=$(cat ../pattern.txt) make html_dev-pattern; else make test-doc; cd doc; make $(cat ../build.txt); fi:
timeout: 1500
general:
# branches:
# only:
# - master
# Open the doc to the API
artifacts:
- "doc/_build/html"
deployment:
production:
branch: master
commands:
- git config --global user.email "[email protected]"
- git config --global user.name "Circle Ci"
- cd ../mne-tools.github.io && git checkout master && git pull origin master
- cd doc/_build/html && cp -rf * ~/mne-tools.github.io/dev
- cd ../mne-tools.github.io && git add -A && git commit -m 'Automated update of dev docs.' && git push origin master
stable:
branch: maint/0.12
commands:
- git config --global user.email "[email protected]"
- git config --global user.name "Circle Ci"
- cd ../mne-tools.github.io && git checkout master && git pull origin master
- cd doc/_build/html_stable && cp -rf * ~/mne-tools.github.io/stable
- cd ../mne-tools.github.io && git add -A && git commit -m 'Automated update of stable docs.' && git push origin master