forked from diffpy/diffpy.structure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
96 lines (80 loc) · 2.37 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
96
# Use container-based travis workers
sudo: false
language: generic
os:
- linux
- osx
env:
- MYUSEMC=true MYPYTHON_VERSION=2.6
- MYUSEMC=true MYPYTHON_VERSION=2.7
- MYUSEMC=false
matrix:
exclude:
- os: osx
env: MYUSEMC=false
git:
depth: 999999
branches:
except:
- /^v[0-9]/
addons:
apt:
packages:
- python-dev
- python-numpy
- python-setuptools
- build-essential
before_install:
- umask 022
- git fetch origin --tags
- if ${MYUSEMC}; then
NOAPT=true; NOMC=false;
else
NOAPT=false; NOMC=true;
MYPIPFLAGS="--user";
fi
- MYMCREPO=https://repo.continuum.io/miniconda
- case ${TRAVIS_OS_NAME} in
linux)
MYMCBUNDLE=Miniconda-latest-Linux-x86_64.sh ;;
osx)
MYMCBUNDLE=Miniconda-latest-MacOSX-x86_64.sh ;;
*)
echo "Unsupported operating system." >&2;
exit 2 ;;
esac
- mkdir -p ~/pkgs/
- mkdir -p ~/rundir/
- $NOMC || pushd ~/pkgs/
- $NOMC || wget --timestamping ${MYMCREPO}/${MYMCBUNDLE}
- $NOMC || test -x ~/mc/bin/conda || bash ${MYMCBUNDLE} -b -f -p ~/mc
- $NOMC || popd
- $NOMC || export PATH="${HOME}/mc/bin:${PATH}"
- $NOMC || conda update --yes conda
- $NOMC || conda install --yes conda-build jinja2
- $NOMC || conda create --name=testenv --yes python=${MYPYTHON_VERSION} coverage
- $NOMC || conda config --add channels diffpy
- $NOAPT || test "${TRAVIS_OS_NAME}" = "linux" || exit $?
- $NOAPT || devutils/makesdist
- $NOAPT || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
install:
- $NOMC || CONDA_PY=${MYPYTHON_VERSION} conda build conda-recipe
- $NOMC || conda list --name=_test --export diffpy.structure > /tmp/mypackage.txt
- $NOMC || source activate testenv
- $NOMC || conda install --yes --use-local --file=/tmp/mypackage.txt
- $NOAPT || pip install $MYPIPFLAGS coverage
- $NOAPT || easy_install --user "${MYTARBUNDLE}"
- cd ~/rundir
- MYGIT_REV=$(python -c "import diffpy.Structure.version as v; print(v.__gitsha__)")
- if [[ "${TRAVIS_COMMIT}" != "${MYGIT_REV}" ]]; then
echo "Version mismatch ${TRAVIS_COMMIT} vs ${MYGIT_REV}.";
exit 1;
fi
script:
- coverage run --source diffpy.Structure -m diffpy.Structure.tests.run
after_success:
- pip install $MYPIPFLAGS codecov
- $NOMC || if [[ "${MYPYTHON_VERSION}" == 2.6 ]]; then
conda install --yes argparse;
fi
- codecov