|
| 1 | +# http://travis-ci.org/#!/jupyter-contrib/jupyter_nbextensions_configurator |
| 2 | +language: python |
| 3 | +sudo: false |
| 4 | +addons: |
| 5 | + firefox: latest |
| 6 | +dist: trusty |
| 7 | +matrix: |
| 8 | + fast_finish: true |
| 9 | + # Use the built-in venv for linux builds |
| 10 | + # 3.5 as it isn't installed by default. Let tox handle other versions. |
| 11 | + include: |
| 12 | + # python linting |
| 13 | + - os: linux |
| 14 | + python: '3.6' |
| 15 | + env: TOXENV=lint |
| 16 | + # check that conda build/install works |
| 17 | + - os: linux |
| 18 | + python: '3.7' |
| 19 | + env: TOXENV=condarecipe |
| 20 | + # linux, various python and notebook versions |
| 21 | + - os: linux |
| 22 | + python: '3.6' |
| 23 | + env: TOXENV=py36-notebook |
| 24 | + - os: linux |
| 25 | + python: '3.7' |
| 26 | + env: TOXENV=py37-notebook |
| 27 | + - os: linux |
| 28 | + python: 'pypy' |
| 29 | + env: TOXENV=pypy-notebook |
| 30 | + allow_failures: |
| 31 | + - env: TOXENV=lint |
| 32 | + - env: TOXENV=pypy-notebook |
| 33 | + - env: TOXENV=py36-notebook |
| 34 | +env: |
| 35 | + global: |
| 36 | + - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so |
| 37 | + - SEGFAULT_SIGNALS=all |
| 38 | +before_install: |
| 39 | + - uname -a |
| 40 | + - id -un |
| 41 | + - id -Gn |
| 42 | + # stuff for conda recipe |
| 43 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then wget https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh -O miniconda.sh; fi' |
| 44 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then ( echo "bfe34e1fa28d6d75a7ad05fd02fa5472275673d5f5621b77380898dee1be15d2 miniconda.sh" | sha256sum -c - ); fi' |
| 45 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then bash miniconda.sh -b -p $HOME/miniconda; fi' |
| 46 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then export PATH="$HOME/miniconda/bin:$PATH"; fi' |
| 47 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then hash -r; fi' |
| 48 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --set always_yes yes --set changeps1 no; fi' |
| 49 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda info -a; fi # Useful for debugging any issues with conda' |
| 50 | + # update conda |
| 51 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda update --all; fi' |
| 52 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda install conda-build; fi' |
| 53 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda info -a; fi # Useful for debugging any issues with conda' |
| 54 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then git fetch --unshallow; fi' |
| 55 | + # also install npm configurable proxy for jupyterhub! |
| 56 | + - 'if [[ ${TOXENV} == "jupyterhub" ]]; then npm install -g configurable-http-proxy; fi;' |
| 57 | + # decide whether js tests will run |
| 58 | + - 'if [[ ${TRAVIS_OS_NAME} == "linux" ]] && [[ ${TOXENV} == py* || ${TOXENV} == jupyterhub ]]; then JS_TESTS="true"; else JS_TESTS="false"; fi;' |
| 59 | + - 'echo "\${JS_TESTS}=$JS_TESTS";' |
| 60 | + # for js tests (which we do on linux only), selenium 3 requires geckodriver |
| 61 | + - 'if [[ ${JS_TESTS} == "true" ]]; then GECKODRIVER_VERSION="0.16.1"; fi;' |
| 62 | + - 'if [[ ${JS_TESTS} == "true" ]]; then wget "https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz"; fi;' |
| 63 | + - 'if [[ ${JS_TESTS} == "true" ]]; then mkdir geckodriver; fi;' |
| 64 | + - 'if [[ ${JS_TESTS} == "true" ]]; then tar -xzf "geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz" -C geckodriver; fi;' |
| 65 | + - 'if [[ ${JS_TESTS} == "true" ]]; then export PATH="$PATH:$PWD/geckodriver"; fi;' |
| 66 | + # remove the downloaded archive, don't care if this fails |
| 67 | + - 'if [[ ${JS_TESTS} == "true" ]]; then rm "geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz" || true; fi;' |
| 68 | + # from https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI |
| 69 | + # we need to start xvfb for selenium to work correctly |
| 70 | + - 'if [[ ${JS_TESTS} == "true" ]]; then export DISPLAY=":99.0"; fi;' |
| 71 | + - 'if [[ ${JS_TESTS} == "true" ]]; then sh -e /etc/init.d/xvfb start && sleep 3; fi;' |
| 72 | +install: |
| 73 | + - python -m pip install tox |
| 74 | + - virtualenv --version |
| 75 | + - firefox --version |
| 76 | +script: |
| 77 | + - 'if [[ ${TOXENV} != "condarecipe" ]]; then tox -v -e ${TOXENV}; fi' |
| 78 | + # don't actually use tox for condarecipe :S |
| 79 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --append channels conda-forge; fi' |
| 80 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --get channels; fi' |
| 81 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda build conda.recipe/; fi' |
| 82 | + - 'if [[ ${TOXENV} == "condarecipe" ]]; then conda install --use-local jupyter_nbextensions_configurator; fi' |
| 83 | +after_script: |
| 84 | + # test if TOXENV not in set |
| 85 | + # see http://unix.stackexchange.com/a/111518 |
| 86 | + - 'if ! [[ ${TOXENV} =~ ^(appveyorartifacts|check|lint|condarecipe)$ ]]; then tox -e coveralls,codecov; fi' |
| 87 | +after_failure: |
| 88 | + - more .tox/log/* | cat |
| 89 | + - more .tox/*/log/* | cat |
| 90 | +after_success: |
| 91 | +before_cache: |
| 92 | + - rm -rf $HOME/.cache/pip/log |
| 93 | +cache: |
| 94 | + directories: |
| 95 | + - $HOME/.cache/pip |
| 96 | +notifications: |
| 97 | + email: false |
0 commit comments