forked from LCA-ActivityBrowser/activity-browser
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
97 lines (85 loc) · 3.09 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
language: python
matrix:
include:
- python: "3.6"
os: linux
- python: "3.6"
language: generic-covered
os: osx
env: pyver=3.6 pydist=macpython
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get update;
fi
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then echo "Running on OS X"; else echo "Running on Linux"; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda install -q conda-build
# Useful for debugging any issues with conda
- conda info -a
# conda channels
- conda config --append channels conda-forge
- conda config --append channels cmutel
- conda config --append channels haasad
# conda build
# use sed to dynamically change the build number for the upload to conda
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
echo $(date '+%Y%m%d%H%M');
sed "s/ number:\ 1/ number:\ $(date '+%Y%m%d%H%M')/g" ./ci/travis/recipe/meta.yaml > /tmp/meta.yaml;
mv /tmp/meta.yaml ./ci/travis/recipe/meta.yaml;
fi
- conda build ./ci/travis/recipe
# Create environment
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
conda create -q -n test-environment python=$pyver pytest;
else
conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION;
fi
- source activate test-environment
- conda install -q --use-local activity-browser-dev
- conda install -q 'pytest<3.5' pytest-qt pytest-mock
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
conda install -q pytest-cov python-coveralls;
fi
before_script:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export DISPLAY=:99.0;
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset;
sleep 2;
fi
script:
# run tests twice on linux, first for the installed package (this makes sure that the conda package is valid),
# then for the source code to measure the code coverage of the tests
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
py.test;
python -m pytest --cov=activity_browser;
else
py.test;
fi
after_success:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
coveralls;
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
conda install anaconda-client;
cp /home/travis/miniconda/conda-bld/noarch/*.tar.bz2 .;
anaconda -t $CONDA_TOKEN upload --force *.tar.bz2;
echo "uploaded to conda channel";
else
echo "no upload because not master branch";
fi
else
echo "no upload from osx";
fi
notifications:
email:
on_success: always # default: change
on_failure: always # default: always