-
Notifications
You must be signed in to change notification settings - Fork 300
update travis #3350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
update travis #3350
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,22 +5,27 @@ | |
| # we will use conda to give us a much faster setup time. | ||
|
|
||
|
|
||
| language: python | ||
| python: | ||
| - 2.7 | ||
| - 3.6 | ||
| sudo: false | ||
| language: minimal | ||
| dist: xenial | ||
|
|
||
| env: | ||
| matrix: | ||
| - TEST_TARGET=default TEST_MINIMAL=true | ||
| - TEST_TARGET=default | ||
| - TEST_TARGET=example | ||
| - TEST_TARGET=doctest | ||
|
|
||
| global: | ||
| # The decryption key for the encrypted .github/deploy_key.scitools-docs.enc. | ||
| - secure: "N9/qBUT5CqfC7KQBDy5mIWZcGNuUJk3e/qmKJpotWYV+zwOI4GghJsRce6nFnlRiwl65l5oBEcvf3+sBvUfbZqh7U0MdHpw2tHhr2FSCmMB3bkvARZblh9M37f4da9G9VmRkqnyBM5G5TImXtoq4dusvNWKvLW0qETciaipq7ws=" | ||
| matrix: | ||
| - PYTHON_VERSION=2.7 TEST_TARGET=default TEST_MINIMAL=true | ||
| - PYTHON_VERSION=2.7 TEST_TARGET=default | ||
| - PYTHON_VERSION=2.7 TEST_TARGET=example | ||
|
|
||
| - PYTHON_VERSION=3.6 TEST_TARGET=default TEST_MINIMAL=true | ||
| - PYTHON_VERSION=3.6 TEST_TARGET=default | ||
| - PYTHON_VERSION=3.6 TEST_TARGET=example | ||
| - PYTHON_VERSION=3.6 TEST_TARGET=doctest | ||
|
|
||
| - PYTHON_VERSION=3.7 TEST_TARGET=default TEST_MINIMAL=true | ||
| - PYTHON_VERSION=3.7 TEST_TARGET=default | ||
| - PYTHON_VERSION=3.7 TEST_TARGET=example | ||
| - PYTHON_VERSION=3.7 TEST_TARGET=doctest | ||
|
|
||
| git: | ||
| # We need a deep clone so that we can compute the age of the files using their git history. | ||
|
|
@@ -31,27 +36,18 @@ install: | |
| export IRIS_TEST_DATA_REF="dba47566a9147645fea586f94a138e0a8d45a48e"; | ||
| export IRIS_TEST_DATA_SUFFIX=$(echo "${IRIS_TEST_DATA_REF}" | sed "s/^v//"); | ||
|
|
||
| # Cut short doctest phase under Python 2 : now only supports Python 3 | ||
| # SEE : https://github.com/SciTools/iris/pull/3134 | ||
| # ------------ | ||
| - > | ||
| if [[ $TEST_TARGET == 'doctest' && ${TRAVIS_PYTHON_VERSION} != 3* ]]; then | ||
| echo "DOCTEST phase only valid in Python 3 : ABORTING during 'install'." | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Install miniconda | ||
| # ----------------- | ||
| - > | ||
| echo 'Installing miniconda'; | ||
| export CONDA_BASE=https://repo.continuum.io/miniconda/Miniconda; | ||
| if [[ "$TRAVIS_PYTHON_VERSION" == 2* ]]; then | ||
| export CONDA_BASE="https://repo.continuum.io/miniconda/Miniconda"; | ||
| if [[ "${PYTHON_VERSION}" == 2* ]]; then | ||
| wget --quiet ${CONDA_BASE}2-latest-Linux-x86_64.sh -O miniconda.sh; | ||
| else | ||
| wget --quiet ${CONDA_BASE}3-latest-Linux-x86_64.sh -O miniconda.sh; | ||
| fi; | ||
| bash miniconda.sh -b -p $HOME/miniconda; | ||
| export PATH="$HOME/miniconda/bin:$PATH"; | ||
| bash miniconda.sh -b -p ${HOME}/miniconda; | ||
| export PATH="${HOME}/miniconda/bin:${PATH}"; | ||
|
|
||
| # Create the basic testing environment | ||
| # ------------------------------------ | ||
|
|
@@ -63,35 +59,35 @@ install: | |
| conda config --add channels conda-forge; | ||
| conda update --quiet conda; | ||
| ENV_NAME='test-environment'; | ||
| conda create --quiet -n $ENV_NAME python=$TRAVIS_PYTHON_VERSION pip; | ||
| source activate $ENV_NAME; | ||
| conda create --quiet -n ${ENV_NAME} python=${PYTHON_VERSION} pip; | ||
| source activate ${ENV_NAME}; | ||
|
|
||
| # Customise the testing environment | ||
| # --------------------------------- | ||
| - > | ||
| echo 'Install Iris dependencies'; | ||
| CONDA_REQS_FLAGS=""; | ||
| CONDA_REQS_GROUPS="test"; | ||
| if [[ "$TRAVIS_PYTHON_VERSION" == 2* ]]; then | ||
| if [[ "${PYTHON_VERSION}" == 2* ]]; then | ||
| CONDA_REQS_FLAGS="${CONDA_REQS_FLAGS} --py2"; | ||
| fi; | ||
| if [[ "$TEST_MINIMAL" != true ]]; then | ||
| if [[ "${TEST_MINIMAL}" != true ]]; then | ||
| CONDA_REQS_GROUPS="${CONDA_REQS_GROUPS} all"; | ||
| fi; | ||
| if [[ "${TEST_TARGET}" == 'doctest' ]]; then | ||
| CONDA_REQS_GROUPS="${CONDA_REQS_GROUPS} docs"; | ||
| fi; | ||
| CONDA_REQS_FILE=conda-requirements.txt; | ||
| CONDA_REQS_FILE="conda-requirements.txt"; | ||
| python requirements/gen_conda_requirements.py ${CONDA_REQS_FLAGS} --groups ${CONDA_REQS_GROUPS} > ${CONDA_REQS_FILE}; | ||
| cat ${CONDA_REQS_FILE}; | ||
| conda install --quiet -n $ENV_NAME --file ${CONDA_REQS_FILE}; | ||
| conda install --quiet -n ${ENV_NAME} --file ${CONDA_REQS_FILE}; | ||
|
|
||
| - PREFIX=$HOME/miniconda/envs/$ENV_NAME | ||
| - PREFIX="${HOME}/miniconda/envs/${ENV_NAME}" | ||
|
|
||
| # Output debug info | ||
| - > | ||
| conda list -n $ENV_NAME; | ||
| conda list -n $ENV_NAME --explicit; | ||
| conda list -n ${ENV_NAME}; | ||
| conda list -n ${ENV_NAME} --explicit; | ||
| conda info -a; | ||
|
|
||
| # Pre-load Natural Earth data to avoid multiple, overlapping downloads. | ||
|
|
@@ -100,27 +96,27 @@ install: | |
|
|
||
| # iris test data | ||
| - > | ||
| if [[ "$TEST_MINIMAL" != true ]]; then | ||
| if [[ "${TEST_MINIMAL}" != true ]]; then | ||
| wget --quiet -O iris-test-data.zip https://github.com/SciTools/iris-test-data/archive/${IRIS_TEST_DATA_REF}.zip; | ||
| unzip -q iris-test-data.zip; | ||
| mv "iris-test-data-${IRIS_TEST_DATA_SUFFIX}" iris-test-data; | ||
| fi | ||
|
|
||
| # set config paths | ||
| - > | ||
| SITE_CFG=lib/iris/etc/site.cfg; | ||
| echo "[Resources]" > $SITE_CFG; | ||
| echo "test_data_dir = $(pwd)/iris-test-data/test_data" >> $SITE_CFG; | ||
| echo "doc_dir = $(pwd)/docs/iris" >> $SITE_CFG; | ||
| echo "[System]" >> $SITE_CFG; | ||
| echo "udunits2_path = $PREFIX/lib/libudunits2.so" >> $SITE_CFG; | ||
| SITE_CFG="lib/iris/etc/site.cfg"; | ||
| echo "[Resources]" > ${SITE_CFG}; | ||
| echo "test_data_dir = $(pwd)/iris-test-data/test_data" >> ${SITE_CFG}; | ||
| echo "doc_dir = $(pwd)/docs/iris" >> ${SITE_CFG}; | ||
| echo "[System]" >> ${SITE_CFG}; | ||
| echo "udunits2_path = ${PREFIX}/lib/libudunits2.so" >> ${SITE_CFG}; | ||
|
|
||
| - python setup.py --quiet install | ||
|
|
||
| # JUST FOR NOW : Install latest version of iris-grib. | ||
| # TODO : remove when iris doesn't do an integration test requiring iris-grib. | ||
| - if [[ "$TEST_MINIMAL" != true && ${TRAVIS_PYTHON_VERSION} == 2* ]]; then | ||
| conda install --quiet -n $ENV_NAME python-ecmwf_grib; | ||
| - if [[ "${TEST_MINIMAL}" != true && ${PYTHON_VERSION} == 2* ]]; then | ||
| conda install --quiet -n ${ENV_NAME} python-ecmwf_grib; | ||
| pip install git+https://github.com/SciTools/[email protected]; | ||
| fi | ||
|
|
||
|
|
@@ -130,31 +126,31 @@ script: | |
| - INSTALL_DIR=$(pwd) | ||
|
|
||
| - > | ||
| if [[ $TEST_TARGET == 'default' ]]; then | ||
| export IRIS_REPO_DIR=$INSTALL_DIR; | ||
| python -m iris.tests.runner --default-tests --system-tests --print-failed-images --num-processors=3; | ||
| if [[ ${TEST_TARGET} == 'default' ]]; then | ||
| export IRIS_REPO_DIR=${INSTALL_DIR}; | ||
| python -m iris.tests.runner --default-tests --system-tests --print-failed-images; | ||
| fi | ||
|
|
||
| - if [[ $TEST_TARGET == 'example' ]]; then | ||
| python -m iris.tests.runner --example-tests --print-failed-images --num-processors=3; | ||
| - if [[ ${TEST_TARGET} == 'example' ]]; then | ||
| python -m iris.tests.runner --example-tests --print-failed-images; | ||
| fi | ||
|
|
||
| - > | ||
| if [[ $TEST_TARGET == 'doctest' ]]; then | ||
| MPL_RC_DIR=$HOME/.config/matplotlib; | ||
| mkdir -p $MPL_RC_DIR; | ||
| echo 'backend : agg' > $MPL_RC_DIR/matplotlibrc; | ||
| echo 'image.cmap : viridis' >> $MPL_RC_DIR/matplotlibrc; | ||
| cd $INSTALL_DIR/docs/iris; | ||
| if [[ ${TEST_TARGET} == 'doctest' ]]; then | ||
| MPL_RC_DIR="${HOME}/.config/matplotlib"; | ||
| mkdir -p ${MPL_RC_DIR}; | ||
| echo 'backend : agg' > ${MPL_RC_DIR}/matplotlibrc; | ||
| echo 'image.cmap : viridis' >> ${MPL_RC_DIR}/matplotlibrc; | ||
| cd ${INSTALL_DIR}/docs/iris; | ||
| make clean html && make doctest; | ||
| fi | ||
|
|
||
| # Split the organisation out of the slug. See https://stackoverflow.com/a/5257398/741316 for description. | ||
| - ORG=(${TRAVIS_REPO_SLUG//\// }) | ||
|
|
||
| # When we merge a change, and we are running in python 3, push some docs. | ||
| - if [[ $TEST_TARGET == 'doctest' && ${TRAVIS_EVENT_TYPE} == 'push' && ${TRAVIS_PYTHON_VERSION} == 3* && ${ORG} == "SciTools" ]]; then | ||
| cd $INSTALL_DIR; | ||
| - if [[ ${TEST_TARGET} == 'doctest' && ${TRAVIS_EVENT_TYPE} == 'push' && ${TRAVIS_PYTHON_VERSION} == 3* && ${ORG} == "SciTools" ]]; then | ||
| cd ${INSTALL_DIR}; | ||
| pip install doctr; | ||
| doctr deploy --deploy-repo SciTools-docs/iris --built-docs docs/iris/build/html | ||
| --key-path .github/deploy_key.scitools-docs.enc | ||
|
|
@@ -164,7 +160,7 @@ script: | |
|
|
||
| # An extra call to check "whatsnew" contributions are valid, because the | ||
| # Iris test for it needs a *developer* install to be able to find the docs. | ||
| - if [[ $TEST_TARGET == 'doctest' ]]; then | ||
| cd $INSTALL_DIR/docs/iris/src/whatsnew; | ||
| - if [[ ${TEST_TARGET} == 'doctest' ]]; then | ||
| cd ${INSTALL_DIR}/docs/iris/src/whatsnew; | ||
| python aggregate_directory.py --checkonly; | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.