|
| 1 | +# This is necessary because matplotlib is involved. |
| 2 | +before_script: |
| 3 | + - "export DISPLAY=:99.0" |
| 4 | + - "sh -e /etc/init.d/xvfb start" |
| 5 | +- sleep 5 # give xvfb some time to start |
| 6 | + |
| 7 | +language: python |
| 8 | +matrix: |
| 9 | + include: |
| 10 | + - python: 3.5 # we don't actually use this |
| 11 | + env: PYTHON_VERSION=3.6 |
| 12 | + - python: 3.5 # we don't actually use this |
| 13 | + env: PYTHON_VERSION=3.7 |
| 14 | +# command to install dependencies |
| 15 | +install: |
| 16 | + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh |
| 17 | + - bash miniconda.sh -b -p $HOME/anaconda |
| 18 | + - export PATH="$HOME/anaconda/bin:$PATH" |
| 19 | + - hash -r |
| 20 | + - conda config --set always_yes yes --set changeps1 no |
| 21 | + - conda update -q conda |
| 22 | + - conda config --add channels conda-forge |
| 23 | + |
| 24 | + # Useful for debugging any issues with conda |
| 25 | + - conda info -a |
| 26 | + |
| 27 | + # Install Python, py.test, and required packages. |
| 28 | + - conda env create -f environment.yml |
| 29 | + - source activate bayesian-modelling-tutorial |
| 30 | + # This guarantees that the Python version is matrixed. |
| 31 | + - conda install python=$PYTHON_VERSION |
| 32 | + - python -m ipykernel install --user --name bayesian-modelling-tutorial |
| 33 | +# command to run tests |
| 34 | +script: |
| 35 | + - mkdir -p docs/notebooks |
| 36 | + # All notebooks that need to be converted are inside nbconvert_config.py |
| 37 | + # We have to call on --execute - without doing so, the execution config |
| 38 | + # inside nbconvert_config.py won't run. |
| 39 | + - jupyter nbconvert --config nbconvert_config.py --execute --template full |
| 40 | + # Build the index page. |
| 41 | + - pandoc README.md -o docs/index.html -c static/pandoc.css -s |
| 42 | + |
| 43 | + |
| 44 | +deploy: |
| 45 | + provider: pages |
| 46 | + skip-cleanup: true |
| 47 | + github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable |
| 48 | + keep-history: true |
| 49 | + # We read the master branch |
| 50 | + on: |
| 51 | + branch: master |
| 52 | + # Take the docs/ directory |
| 53 | + local-dir: docs |
| 54 | + # Publish to the gh-pages branch |
| 55 | + target-branch: gh-pages |
| 56 | +verbose: true |
0 commit comments