This repository has been archived by the owner on Apr 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathconfig.yml
171 lines (158 loc) · 6.09 KB
/
config.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
# quick-build rebuilds changes using the cached documentation.
# The cache is emptied everyday, forcing a full build on the day's first push.
# It doesn't operate on master branch. New branches are always built from scratch.
# full-build always rebuilds from scratch, without any cache. Only for changes in master branch.
version: 2
jobs:
quick-build:
docker:
- image: circleci/python:3.6
environment:
DISTRIB: "conda"
PYTHON_VERSION: "3.6"
NUMPY_VERSION: "*"
SCIPY_VERSION: "*"
SCIKIT_LEARN_VERSION: "*"
MATPLOTLIB_VERSION: "3.0.3"
steps:
- checkout
# Get rid of existing virtualenvs on circle ci as they conflict with conda.
# Trick found here:
# https://discuss.circleci.com/t/disable-autodetection-of-project-or-application-of-python-venv/235/10
- run: cd && rm -rf ~/.pyenv && rm -rf ~/virtualenvs
# We need to remove conflicting texlive packages.
- run: sudo -E apt-get -yq remove texlive-binaries --purge
# Installing required packages for `make -C doc check command` to work.
- run: sudo -E apt-get -yq update
- run: sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install dvipng texlive-latex-base texlive-latex-extra
- run:
name: Today & Week # Saving today's date and current week of the year in files to generate daily & weekly new cache key respectively.
command: |
date +%F > today
date +%U > week_num
- restore_cache:
key: v1-packages+datasets-{{ checksum "week_num" }}-{{ checksum ".circleci/package-cache-timestamp" }}
- restore_cache:
key: v1-docs-{{ .Branch }}-{{ checksum "today" }}-{{ checksum ".circleci/manual-cache-timestamp" }}
- run:
name: Download & install conda if absent
command: |
if
ls $HOME/miniconda3/bin | grep conda -q
then
echo "(Mini)Conda already present from the cache."
else
wget https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh -O ~/miniconda.sh
chmod +x ~/miniconda.sh && ~/miniconda.sh -b
fi
- run:
name: Setup conda path in env variables
command: |
echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> $BASH_ENV
- run:
name: Create new conda env
command: |
if
conda env list | grep testenv
then
echo "Conda env testenv already exists courtesy of the cache."
else
conda create -n testenv -yq
fi
- run:
name: Install packages in conda env
command: |
conda install -n testenv python=3.6 numpy scipy scikit-learn matplotlib==3.0.3 pandas \
flake8 lxml nose cython mkl sphinx coverage numpydoc pillow pandas -yq
- run:
name: Running CircleCI test (make html)
command: |
source activate testenv
pip install nibabel sphinx-gallery nilearn nose-timer
pip install -e .
set -o pipefail && cd doc && make html-strict 2>&1 | tee log.txt
no_output_timeout: 5h
- save_cache:
key: v1-packages+datasets-{{ checksum "week_num" }}
paths:
- ../nilearn_data
- ../miniconda3
- save_cache:
key: v1-docs-{{ .Branch }}-{{ checksum "today" }}-{{ checksum ".circleci/manual-cache-timestamp" }}
paths:
- doc
- store_artifacts:
path: doc/_build/html
- store_artifacts:
path: coverage
- store_artifacts:
path: doc/log.txt
full-build:
docker:
- image: circleci/python:3.6
environment:
DISTRIB: "conda"
PYTHON_VERSION: "3.6"
NUMPY_VERSION: "*"
SCIPY_VERSION: "*"
SCIKIT_LEARN_VERSION: "*"
MATPLOTLIB_VERSION: "*"
steps:
- checkout
# Get rid of existing virtualenvs on circle ci as they conflict with conda.
# Trick found here:
# https://discuss.circleci.com/t/disable-autodetection-of-project-or-application-of-python-venv/235/10
- run: cd && rm -rf ~/.pyenv && rm -rf ~/virtualenvs
# We need to remove conflicting texlive packages.
- run: sudo -E apt-get -yq remove texlive-binaries --purge
# Installing required packages for `make -C doc check command` to work.
- run: sudo -E apt-get -yq update
- run: sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install dvipng texlive-latex-base texlive-latex-extra
- run: wget https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh -O ~/miniconda.sh
- run: chmod +x ~/miniconda.sh && ~/miniconda.sh -b
- run: echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> $BASH_ENV
- run:
name: Create conda env
command: |
conda create -n testenv python=3.6 numpy scipy scikit-learn matplotlib==3.0.3 pandas \
flake8 lxml nose cython mkl sphinx numpydoc coverage pillow pandas -yq
- run:
name: Running CircleCI test (make html)
command: |
source activate testenv
pip install nibabel sphinx-gallery nilearn nose-timer
pip install -e .
set -o pipefail && cd doc && make html 2>&1 | tee log.txt
no_output_timeout: 5h
- store_artifacts:
path: doc/_build/html
- store_artifacts:
path: coverage
- store_artifacts:
path: doc/log.txt
workflows:
version: 2
push:
jobs:
- quick-build:
filters:
branches:
ignore:
- master
- test-circleci # test branch to check if merges occur on master as expected.
- full-build:
filters:
branches:
only:
- master
- test-circleci
nightly:
triggers:
- schedule:
cron: "0 6 * * *"
filters:
branches:
only:
- master
jobs:
- full-build