forked from SciTools/iris-grib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
95 lines (79 loc) · 2.75 KB
/
.travis.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
language: minimal
dist: xenial
env:
matrix:
- PYTHON_VERSION=36
- PYTHON_VERSION=37
install:
# Download iris-test-data
# -----------------------------------
- >
export IRIS_TEST_DATA_REF="https://github.com/SciTools/iris-test-data/archive/master.zip";
export IRIS_TEST_DATA_DOWNLOAD="${HOME}/iris-test-data";
mkdir ${IRIS_TEST_DATA_DOWNLOAD};
wget -O ${IRIS_TEST_DATA_DOWNLOAD}/iris-test-data.zip ${IRIS_TEST_DATA_REF};
unzip -q ${IRIS_TEST_DATA_DOWNLOAD}/iris-test-data.zip -d ${IRIS_TEST_DATA_DOWNLOAD};
export IRIS_TEST_DATA_PATH=${IRIS_TEST_DATA_DOWNLOAD}/iris-test-data-master/test_data
# Install miniconda
# -----------------
- >
echo "Installing miniconda";
export CONDA_BASE="https://repo.continuum.io/miniconda/Miniconda";
wget --quiet ${CONDA_BASE}3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p ${HOME}/miniconda;
export PATH="${HOME}/miniconda/bin:${PATH}";
# Create the test environment
# ---------------------------
- >
echo "Creating testing environment";
conda config --set always_yes yes --set changeps1 no;
conda config --set show_channel_urls True;
conda config --add channels conda-forge;
conda update --quiet conda;
# Get environment spec.
- >
export ENV_NAME="iris-grib-dev";
export ENV_FILE="${TRAVIS_BUILD_DIR}/requirements/ci/py${PYTHON_VERSION}.yml";
# Create environment.
- >
conda env create --quiet --file=${ENV_FILE};
source activate ${ENV_NAME};
# Check installation of eccodes.
- python -m eccodes selfcheck;
# Install pip, then coveralls.
- conda install --quiet pip;
- pip install coveralls;
# Output environment debug info.
- >
conda list -n ${ENV_NAME};
conda info -a;
# Configure Iris
# --------------
- echo "Configuring Iris";
# Locate Iris installation.
- export IRIS_DIR=$(python -c "import iris; import os.path; print(os.path.dirname(iris.__file__))")
# Set iris config paths.
- >
export PREFIX="${HOME}/miniconda/envs/${ENV_NAME}";
SITE_CFG="${IRIS_DIR}/etc/site.cfg";
echo "[Resources]" > ${SITE_CFG};
echo "test_data_dir = ${IRIS_TEST_DATA_PATH}" >> ${SITE_CFG};
echo "[System]" >> ${SITE_CFG};
echo "udunits2_path = ${PREFIX}/lib/libudunits2.so" >> ${SITE_CFG};
# Install iris-grib itself
# ------------------------
- >
echo "Installing Iris-grib.";
cd ${TRAVIS_BUILD_DIR};
pip install . --no-deps;
# Summarise the environment
# -------------------------
- >
conda list -n ${ENV_NAME};
conda list -n ${ENV_NAME} --explicit;
conda info -a;
script:
# Ensure we can import iris_grib and that the tests pass
# ------------------------------------------------------
- coverage run setup.py test
after_success: coveralls