forked from PCMDI/cmor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (50 loc) · 2.59 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
os:
- linux
python:
- 2.7
env:
- CMOR_PYTHON_VERSION='2.7'
- CMOR_PYTHON_VERSION='3.6'
- CMOR_PYTHON_VERSION='3.7'
services:
- docker
sudo: false
before_install:
- if [[ $CMOR_PYTHON_VERSION == '2.7' ]]; then export MINICONDA_VERSION=2; else export MINICONDA_VERSION=3; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export MINICONDA_OS="Linux"; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export MINICONDA_OS="MacOSX"; fi
- wget https://repo.continuum.io/miniconda/Miniconda${MINICONDA_VERSION}-latest-${MINICONDA_OS}-x86_64.sh -O miniconda.sh;
- export PATH="$HOME/miniconda/bin:$PATH"
- export UVCDAT_ANONYMOUS_LOG=no
- bash miniconda.sh -b -p $HOME/miniconda
- conda config --set always_yes yes --set changeps1 no
- conda update -y -q conda
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CONDA_COMPILERS="gcc_linux-64 gfortran_linux-64"; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export CONDA_COMPILERS="clang_osx-64 gfortran_osx-64"; fi
- conda create -q -n py${CMOR_PYTHON_VERSION} -c cdat/label/nightly -c conda-forge -c cdat six libuuid json-c udunits2 hdf5 libnetcdf netcdf4 numpy openssl lazy-object-proxy python=${CMOR_PYTHON_VERSION} $CONDA_COMPILERS testsrunner
- source activate py${CMOR_PYTHON_VERSION}
install:
- export PREFIX=$(python -c "import sys; print(sys.prefix)")
- git clone https://github.com/PCMDI/cmip6-cmor-tables
- ln -s cmip6-cmor-tables/Tables Tables
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export LDSHARED_FLAGS="-shared -pthread"; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then export LDSHARED_FLAGS="-bundle -undefined dynamic_lookup"; fi
- "./configure --prefix=$PREFIX --with-python --with-uuid=$PREFIX --with-json-c=$PREFIX --with-udunits2=$PREFIX
--with-netcdf=$PREFIX --enable-verbose-test"
- make install
script:
- make test
- conda install -q -n py${CMOR_PYTHON_VERSION} -c cdat/label/nightly -c conda-forge -c cdat cdms2
- make test
- export PYTHONPATH=Test/:$PYTHONPATH
- python run_tests.py -v2 -n1 -H Test/test_python_CMIP6_CV*.py
after_failure:
- ulimit -a
- free -m
- find CMIP6/
- df -kh ./
- ls -lR
- cat ~/build.sh
after_success:
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_OS_NAME == "osx" ]]; then CMOR_RECIPE_DIR=recipes bash scripts/conda_upload.sh ${TRAVIS_BRANCH} ; fi
- if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_OS_NAME == "linux" ]]; then docker run -v `pwd`:/travis_home -e CONDA_UPLOAD_TOKEN=${CONDA_UPLOAD_TOKEN} -e CMOR_RECIPE_DIR=/travis_home/recipes -e CMOR_PYTHON_VERSION=${CMOR_PYTHON_VERSION} -a STDOUT -a STDERR centos:6.8 /travis_home/scripts/conda_upload.sh ${TRAVIS_BRANCH} ; fi