forked from diffpy/pyobjcryst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
95 lines (80 loc) · 2.48 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
sudo: required
language: generic
os:
- linux
- osx
env:
global:
- MYPYTHON_VERSION=2.7
matrix:
- MYUSEMC=true
- MYUSEMC=false
matrix:
exclude:
- os: osx
env: MYUSEMC=false
git:
depth: 999999
branches:
except:
- /^v[0-9]/
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 || sudo apt-get update -qq
- $NOAPT || sudo apt-get install -y
python-setuptools python-numpy scons
build-essential python-dev libboost-all-dev
python-pip
- $NOAPT || devutils/makesdist
- $NOAPT || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
- $NOAPT || pushd ~/pkgs
- $NOAPT || git clone https://github.com/diffpy/libObjCryst.git
- $NOAPT || popd
install:
- $NOMC || CONDA_PY=${MYPYTHON_VERSION} conda build conda-recipe
- $NOMC || conda list --name=_test --export pyobjcryst > /tmp/mypackage.txt
- $NOMC || source activate testenv
- $NOMC || conda install --yes --use-local --file=/tmp/mypackage.txt
- $NOAPT || pip install $MYPIPFLAGS coverage
- $NOAPT || sudo scons -C ~/pkgs/libObjCryst install
- $NOAPT || easy_install --user "${MYTARBUNDLE}"
- cd ~/rundir
- MYGIT_REV=$(python -c "import pyobjcryst.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 pyobjcryst -m pyobjcryst.tests.run
after_success:
- pip install $MYPIPFLAGS codecov
- codecov