forked from OpenDrift/opendrift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
45 lines (37 loc) · 1.57 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
language: python
python:
- 2.7
- 3.6
env:
- NUMPY=1.15.4 SCIPY=1.1 NETCDF=1.4.3 MATPLOTLIB=3.0.2 XARRAY=0.11.2
- NUMPY=1.16.4 SCIPY=1.2 NETCDF=1.5 MATPLOTLIB=3.1
- VANILLA=1
services:
- docker
matrix:
fast_finish: true
before_install:
- if [ $TRAVIS_PYTHON_VERSION == 2.7 ]; then
export DOCKERFILE="Dockerfile.oil.py2" CACHE_FROM="opendrift/opendrift-oil:latest";
else
export DOCKERFILE="Dockerfile" CACHE_FROM="opendrift/opendrift:latest";
fi
install:
- pip install pyyaml coveralls
- cd docker
- docker build --pull --cache-from ${CACHE_FROM} -t opendrift:${TRAVIS_COMMIT} --file ${DOCKERFILE} ..
- cd ..
script:
- docker run -itd --name="opendrift_${TRAVIS_COMMIT}" opendrift:${TRAVIS_COMMIT}
- if [ ! -z "$VANILLA" ]; then
docker exec "opendrift_${TRAVIS_COMMIT}" bash -c ". ~/.bashrc && conda install -q --yes -c conda-forge numpy=${NUMPY} scipy=${SCIPY} netcdf4=${NETCDF} matplotlib=${MATPLOTLIB}"; fi
- if [ ! -z "$VANILA" && "$XARRAY" ]; then
docker exec "opendrift_${TRAVIS_COMMIT}" bash -c ". ~/.bashrc && conda install -q --yes -c conda-forge xarray=$XARRAY dask";
fi
- docker exec "opendrift_${TRAVIS_COMMIT}" bash -c ". ~/.bashrc && conda list"
- docker exec "opendrift_${TRAVIS_COMMIT}" bash -c ". ~/.bashrc && pytest --cov=opendrift --ignore=tests/benchmarks --ignore=tests/wps --runslow --durations=10 --benchmark-disable"
after_success:
- docker cp "opendrift_${TRAVIS_COMMIT}":/code/.coverage .
- docker stop "opendrift_${TRAVIS_COMMIT}"
- sed -e "s|\/code\/|${PWD}\/|g" -i .coverage
- coveralls