2016-06-07 18:31:52 -07:00
|
|
|
|
# Test against different stack LTS versions.
|
2015-03-04 16:45:22 -08:00
|
|
|
|
env:
|
2017-03-06 05:33:56 -05:00
|
|
|
|
- DISPLAY=true RESOLVER=lts-8.3 # GHC 8.0.2
|
2016-06-07 18:31:52 -07:00
|
|
|
|
|
2016-06-07 18:35:00 -07:00
|
|
|
|
# Choose a lightweight base image; we provide our own build tools.
|
2016-06-13 18:49:23 -07:00
|
|
|
|
language: python
|
2016-06-07 18:35:00 -07:00
|
|
|
|
|
2016-06-07 18:31:52 -07:00
|
|
|
|
# Enable caching.
|
|
|
|
|
sudo: false
|
|
|
|
|
|
|
|
|
|
# Caching so the next build will be fast too.
|
2016-06-07 19:20:42 -07:00
|
|
|
|
# These caches are the same between resolvers, but this is fine,
|
|
|
|
|
# as Stack differentiates between its resolvers.
|
2016-06-07 18:31:52 -07:00
|
|
|
|
cache:
|
|
|
|
|
directories:
|
|
|
|
|
- $HOME/.ghc
|
|
|
|
|
- $HOME/.cabal
|
|
|
|
|
- $HOME/.stack
|
2016-06-07 19:20:42 -07:00
|
|
|
|
- $HOME/zeromq
|
|
|
|
|
|
|
|
|
|
# Enable packages we need.
|
|
|
|
|
# Not all packages are available – see before_install for from-source builds.
|
|
|
|
|
addons:
|
|
|
|
|
apt:
|
|
|
|
|
packages:
|
2016-06-09 00:01:49 -07:00
|
|
|
|
- libmagic-dev # magic
|
|
|
|
|
- libgmp-dev # ghc
|
|
|
|
|
- libblas-dev # hmatrix
|
|
|
|
|
- liblapack-dev # hmatrix
|
2015-03-04 16:45:22 -08:00
|
|
|
|
|
|
|
|
|
before_install:
|
2016-06-07 18:31:52 -07:00
|
|
|
|
# Download and unpack the stack executable
|
|
|
|
|
- export PATH=$HOME/.local/bin:$PATH
|
|
|
|
|
- mkdir -p ~/.local/bin
|
|
|
|
|
- curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
2016-06-07 19:20:42 -07:00
|
|
|
|
|
2016-06-07 18:42:18 -07:00
|
|
|
|
# Install zeromq3 -- the package is not supported yet on Travis whitelist... (06/06/2016)
|
2016-06-07 18:53:52 -07:00
|
|
|
|
- |
|
2016-06-07 19:37:01 -07:00
|
|
|
|
if [ ! -d "$HOME/zeromq/lib" ]; then
|
2016-06-07 19:20:42 -07:00
|
|
|
|
export OLDPWD=$(pwd)
|
|
|
|
|
travis_retry git clone http://www.github.com/zeromq/zeromq4-x.git libzmq
|
|
|
|
|
mkdir $HOME/zeromq
|
|
|
|
|
cd libzmq
|
|
|
|
|
travis_retry ./autogen.sh
|
|
|
|
|
travis_retry ./configure --prefix=$HOME/zeromq
|
|
|
|
|
make
|
|
|
|
|
travis_retry make install
|
|
|
|
|
cd $OLDPWD
|
|
|
|
|
fi
|
2015-03-04 16:45:22 -08:00
|
|
|
|
|
2017-03-06 05:52:45 -05:00
|
|
|
|
# Upgrades to avoid later build problems
|
|
|
|
|
- pip install -U pip
|
|
|
|
|
- pip install -U setuptools
|
|
|
|
|
|
2016-06-13 18:49:23 -07:00
|
|
|
|
# Install nbconvert for testing the notebook
|
|
|
|
|
- pip install jupyter notebook nbconvert
|
|
|
|
|
|
2016-06-07 19:20:42 -07:00
|
|
|
|
# This step takes the longest, and is what generates the Stack cache.
|
2015-03-04 16:45:22 -08:00
|
|
|
|
install:
|
2016-06-07 20:13:29 -07:00
|
|
|
|
# Set path for pkg-config to find zeromq, otherwise install of zeromq4-haskell fails.
|
2016-06-07 20:00:05 -07:00
|
|
|
|
- export PKG_CONFIG_PATH=$HOME/zeromq/lib/pkgconfig/
|
2017-03-06 10:24:55 -05:00
|
|
|
|
- |
|
|
|
|
|
echo "apply-ghc-options: everything" >> stack.yaml
|
|
|
|
|
|
2016-06-07 19:20:42 -07:00
|
|
|
|
- stack setup --resolver=$RESOLVER
|
2017-03-06 09:36:20 -05:00
|
|
|
|
- stack install gtk2hs-buildtools --fast
|
2017-03-06 10:10:28 -05:00
|
|
|
|
- stack build hmatrix --resolver=$RESOLVER --fast
|
2017-03-06 09:36:20 -05:00
|
|
|
|
- stack build --dependencies-only --resolver=$RESOLVER --fast
|
2015-03-04 16:45:22 -08:00
|
|
|
|
|
|
|
|
|
script:
|
2016-06-07 20:38:42 -07:00
|
|
|
|
- export LD_LIBRARY_PATH=$HOME/zeromq/lib
|
2017-03-06 09:36:20 -05:00
|
|
|
|
- stack test --resolver=$RESOLVER --fast
|
2016-06-08 00:02:40 -07:00
|
|
|
|
- |
|
2016-06-09 00:01:49 -07:00
|
|
|
|
set -e
|
2016-06-08 00:02:40 -07:00
|
|
|
|
if $DISPLAY; then
|
|
|
|
|
TOP=$(pwd)
|
2017-03-06 09:36:20 -05:00
|
|
|
|
stack build --resolver=$RESOLVER --fast
|
2016-06-13 18:49:23 -07:00
|
|
|
|
|
2016-06-16 06:12:07 +05:30
|
|
|
|
# Ensure that ipython-kernel examples build successfully.
|
2017-03-06 09:36:20 -05:00
|
|
|
|
stack build ipython-kernel --flag ipython-kernel:examples --fast
|
2016-06-16 06:12:07 +05:30
|
|
|
|
|
2016-06-13 18:49:23 -07:00
|
|
|
|
# Ensure that IHaskell notebook remains unchanged.
|
|
|
|
|
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
|
2017-03-06 10:51:20 -05:00
|
|
|
|
stack install
|
2016-06-13 18:49:23 -07:00
|
|
|
|
stack exec -- ihaskell install --stack
|
|
|
|
|
stack exec -- jupyter nbconvert --to=notebook --execute --stdout notebooks/IHaskell.ipynb > ~/ihaskell-out.ipynb
|
|
|
|
|
|
|
|
|
|
# Images are rendered differently on different systems, so filter them out in the comparison
|
|
|
|
|
diff <(grep -v image/png ~/ihaskell-out.ipynb) <(grep -v image/png notebooks/IHaskell.ipynb)
|
2016-06-08 00:02:40 -07:00
|
|
|
|
fi
|
2016-06-09 00:01:49 -07:00
|
|
|
|
|