forked from brainets/frites
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
99 lines (99 loc) · 3.49 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
version: 2
jobs:
build:
branches:
ignore:
- gh-pages
docker:
- image: circleci/python:3.6-jessie
steps:
- checkout
- run:
name: Clean CircleCI
command: |
rm -rf ~/.pyenv;
rm -rf ~/virtualenvs;
- restore_cache:
keys:
- pip-cache
- miniconda-cache
- run:
name: Install miniconda
command: |
if [ ! -d "~/miniconda3" ]; then
wget -q http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh;
chmod +x ~/miniconda.sh;
~/miniconda.sh -b -p ~/miniconda3;
echo "export PATH=~/miniconda3/bin:$PATH" >> $BASH_ENV;
else
echo "Miniconda3 already set up.";
fi
- save_cache:
key: miniconda-cache
paths:
- ~/.cache/miniconda
- run:
name: Setup Python environment
command: |
conda update --yes --quiet conda;
conda create -n testenv --yes python=3.6 numpy scipy pip joblib matplotlib pandas xarray;
source activate testenv;
pip install -U pip;
pip install numba networkx seaborn;
pip install -U codecov pytest pytest-cov pytest-travis-fold pytest-faulthandler;
pip install -U sphinx==2.2.0 sphinx-gallery==0.4.0 sphinx_bootstrap_theme sphinxcontrib-bibtex==1.0.0 numpydoc xlrd openpyxl;
echo $PATH;
echo $CIRCLE_BRANCH;
which python;
which pip;
- save_cache:
key: pip-cache
paths:
- ~/.cache/pip
- run:
name: Install frites
command: |
source activate testenv;
python setup.py develop;
- run:
name: Run tests
command: |
source activate testenv;
pytest --verbose;
- run:
name: Build the documentation
command: |
source activate testenv;
cd docs
make html
no_output_timeout: 15m
- store_artifacts:
path: docs/build/html/
destination: html
- add_ssh_keys:
fingerprints:
- "f9:fd:f8:ec:31:16:43:c0:1a:f7:61:53:63:49:50:ac"
- deploy:
name: github pages deployment
command: |
source activate testenv;
if [ "${CIRCLE_BRANCH}" == "master" ]; then
echo "Deploying dev docs.";
git config --global user.email "[email protected]";
git config --global user.name "EtienneCmb";
cd docs;
rm -rf build/doctrees build/frites.github.io
make clean;
git clone -b gh-pages --single-branch --no-checkout --depth 1 https://github.com/brainets/frites.git build/frites.github.io
touch build/frites.github.io/.nojekyll;
make html
cd build/ && \
cp -r html/* frites.github.io && \
cd frites.github.io && \
git add * && \
git add .nojekyll && \
git commit -a -m 'Make install' && \
git push
else
echo "No deployment (build: ${CIRCLE_BRANCH}).";
fi