forked from diffpy/diffpy.pdfgui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
110 lines (93 loc) · 3.14 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
dist: xenial
language: generic
os:
- linux
- osx
env:
- MYUSEMC=true MYPYTHON_VERSION=2.7
- MYUSEMC=false
matrix:
exclude:
- os: osx
env: MYUSEMC=false
git:
depth: 999999
branches:
except:
- /^v[0-9]/
before_install:
- MYNAME=diffpy.pdfgui
- MYCOMMIT="$(git rev-parse HEAD)"
- umask 022
- git fetch origin --tags
- if ${MYUSEMC}; then
NOAPT=true; NOMC=false;
else
NOAPT=false; NOMC=true;
MYPIPFLAGS="--user";
fi
- MYMCREPO=https://repo.anaconda.com/miniconda
- case ${TRAVIS_OS_NAME} in
linux)
MYMCBUNDLE=Miniconda3-latest-Linux-x86_64.sh ;;
osx)
MYMCBUNDLE=Miniconda3-latest-MacOSX-x86_64.sh ;;
*)
echo "Unsupported operating system." >&2;
exit 2 ;;
esac
- MYRUNDIR=${PWD}/build/rundir
- mkdir -p ~/pkgs
- mkdir -p ${MYRUNDIR}
- cp .coveragerc ${MYRUNDIR}/
- $NOMC || pushd ~/pkgs
- $NOMC || wget --timestamping ${MYMCREPO}/${MYMCBUNDLE}
- $NOMC || test -x ~/mc/bin/conda || bash ${MYMCBUNDLE} -b -f -p ~/mc
- $NOMC || popd
- $NOMC || source ~/mc/bin/activate base
- $NOMC || conda update --yes conda
- $NOMC || conda install --yes conda-build conda-verify jinja2
- $NOMC || conda create --name=testenv --yes python=${MYPYTHON_VERSION} coverage
- $NOMC || conda config --add channels diffpy
# TODO - remove after update to wxpython 4
- $NOMC || conda config --set restore_free_channel true
- $NOAPT || test "${TRAVIS_OS_NAME}" = "linux" || exit $?
- $NOAPT || PATH="$(echo "$PATH" | sed 's,:/opt/pyenv/[^:]*,,g')"
- $NOAPT || test "$(which python)" = "/usr/bin/python" || (
which python; exit 1)
- $NOAPT || sudo apt-get update -qq
- $NOAPT || sudo apt-get install -y
build-essential libgsl0-dev python-dev
python-numpy python-setuptools python-pip python-wxtools
python-matplotlib
- $NOAPT || devutils/makesdist
- $NOAPT || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
install:
- $NOMC || conda build --python=${MYPYTHON_VERSION} --no-test conda-recipe
- $NOMC || conda render --python=${MYPYTHON_VERSION} --output conda-recipe |
sed 's,.*/,,; s/[.]tar[.]bz2$//; s/-/=/g' > /tmp/mypackage.txt
- $NOMC || source activate testenv
- $NOMC || conda install --yes --use-local --file=/tmp/mypackage.txt
- $NOAPT || pip install $MYPIPFLAGS coverage
# TODO - restore pip install once it works.
# - $NOAPT || pip install $MYPIPFLAGS "${MYTARBUNDLE}"
- $NOAPT || easy_install --user "${MYTARBUNDLE}"
- cd ${MYRUNDIR}
- MYGIT_REV=$(python -c "import ${MYNAME}.version as v; print(v.__git_commit__)")
- if [[ "${MYCOMMIT}" != "${MYGIT_REV}" ]]; then
echo "Version mismatch ${MYCOMMIT} vs ${MYGIT_REV}.";
exit 1;
fi
before_script:
# provide shell functions to execute coverage with GUI support
- case ${TRAVIS_OS_NAME} in
linux)
guicoverage() { xvfb-run coverage "$@"; } ;;
osx)
guicoverage() { pythonw -m coverage "$@"; } ;;
esac
script:
- guicoverage run --source ${MYNAME} -m ${MYNAME}.tests.rundeps
after_success:
- pip install $MYPIPFLAGS codecov
- codecov