-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
63 lines (51 loc) · 1.86 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
# This configuration file will make Travis CI compile our PDF and force-push it
# back to the repository.
# This *wonderful* hack is credited to Dan Foreman-Mackey (GitHub: @dfm / Twitter: @exoplaneteer)
# and David W. Hogg (GitHub/Twitter: @davidwhogg) on the repository:
# https://github.com/davidwhogg/mcmc/
# This hack has been modified slightly to push pdfs to <branch>-pdf
sudo: false
language: python
env:
matrix:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.5
addons:
apt:
packages:
- texlive-latex-recommended
- texlive-latex-extra
- texlive-fonts-recommended
- texlive-fonts-extra
- dvipng
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- 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 info -a
- conda create --yes -n test python=$PYTHON_VERSION numpy scipy matplotlib
- source activate test
before_script: # configure a headless display to test plot generation
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
script:
- cd article
- make
after_success: |
if [[ "$PYTHON_VERSION" == "2.7" ]] && [ -n "$GITHUB_API_KEY" ]; then
# make sure we are in the parent directory of the repository
cd $TRAVIS_BUILD_DIR
git checkout --orphan $TRAVIS_BRANCH-pdf
git rm -rf .
git add -f article/unrave.pdf
git -c user.name='travis' -c user.email='travis' commit -m init
git push -q -f https://andycasey:$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG $TRAVIS_BRANCH-pdf
fi
notifications:
email:
on_success: change
on_failure: always