|
| 1 | +version: 2 |
| 2 | +jobs: |
| 3 | + build: |
| 4 | + docker: |
| 5 | + - image: circleci/python:3.6-stretch |
| 6 | + steps: |
| 7 | + # Get our data and merge with upstream |
| 8 | + - checkout |
| 9 | + - run: echo $(git log -1 --pretty=%B) | tee gitlog.txt |
| 10 | + - run: echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt |
| 11 | + - run: |
| 12 | + command: | |
| 13 | + if [[ $(cat merge.txt) != "" ]]; then |
| 14 | + echo "Merging $(cat merge.txt)"; |
| 15 | + git pull --ff-only origin "refs/pull/$(cat merge.txt)/merge"; |
| 16 | + fi |
| 17 | +
|
| 18 | + # Load our data |
| 19 | + - restore_cache: |
| 20 | + keys: |
| 21 | + - data-cache |
| 22 | + |
| 23 | + - run: echo "export SUBJECTS_DIR=$HOME/subjects" >> $BASH_ENV |
| 24 | + - run: echo "export DISPLAY=:99" >> $BASH_ENV |
| 25 | + - run: /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; |
| 26 | + # Get latest Anaconda running |
| 27 | + - run: echo "export PATH=~/miniconda/envs/mne/bin:~/miniconda/bin:$PATH" >> $BASH_ENV |
| 28 | + - run: |
| 29 | + command: | |
| 30 | + wget -q http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O ~/miniconda.sh; |
| 31 | + chmod +x ~/miniconda.sh; |
| 32 | + ~/miniconda.sh -b -p ~/miniconda; |
| 33 | + - run: |
| 34 | + command: | |
| 35 | + conda update --yes --quiet conda; |
| 36 | + conda env create --quiet -f environment.yml; |
| 37 | +
|
| 38 | + - run: pip install sphinx numpydoc https://api.github.com/repos/sphinx-gallery/sphinx-gallery/zipball/master |
| 39 | + # This is a CircleCI-specific fix -- for some reason 5.9.2 is problematic |
| 40 | + # here but not on Travis, we get: |
| 41 | + # |
| 42 | + # libgcc_s.so.1 must be installed for pthread_cancel to work |
| 43 | + # Aborted |
| 44 | + # |
| 45 | + - run: pip install --upgrade --no-deps pyqt5>=5.10 |
| 46 | + - run: python -c "from mayavi import mlab; import matplotlib.pyplot as plt; mlab.figure(); plt.figure()" |
| 47 | + - run: python setup.py develop |
| 48 | + - run: echo $SUBJECTS_DIR |
| 49 | + - run: |
| 50 | + command: | |
| 51 | + if [ ! -d $SUBJECTS_DIR ]; then |
| 52 | + mkdir $SUBJECTS_DIR; |
| 53 | + cd $SUBJECTS_DIR; |
| 54 | + wget http://faculty.washington.edu/larsoner/fsaverage_min.zip; |
| 55 | + unzip fsaverage_min.zip; |
| 56 | + rm fsaverage_min.zip; |
| 57 | + fi; |
| 58 | + - run: ls $SUBJECTS_DIR |
| 59 | + - run: |
| 60 | + command: | |
| 61 | + if [[ $(cat build.txt) == "html_dev" ]] || [[ $(cat build.txt) == "html_stable" ]]; then |
| 62 | + SUBJECTS_DIR=~/mne_data/MNE-sample-data/subjects python -c "import mne; mne.datasets._download_all_example_data()"; |
| 63 | + fi; |
| 64 | + - run: cd doc && sphinx-build -D plot_gallery=1 -D sphinx_gallery_conf.filename_pattern=^\(\(?\!plot_fmri_activation_volume\|plot_morphometry\|plot_label\|plot_probabilistic_label\|plot_resting_correlations\|plot_transparent_brain\|rotate_animation\|save_movie\|save_views\).\)*\$ -b html -d _build/doctrees . _build/html |
| 65 | + |
| 66 | + - store_artifacts: |
| 67 | + path: doc/_build/html/ |
| 68 | + destination: html |
| 69 | + |
| 70 | + - save_cache: |
| 71 | + key: data-cache |
| 72 | + paths: |
| 73 | + - "~/subjects" |
0 commit comments