IHaskell/.travis.yml

92 lines
3.0 KiB
YAML
Raw Normal View History

# Test against different stack LTS versions.
2015-03-04 16:45:22 -08:00
env:
2017-07-20 00:00:19 +08:00
- DISPLAY=true RESOLVER=lts-8.23 # GHC 8.0.2
2016-06-07 18:35:00 -07:00
# Choose a lightweight base image; we provide our own build tools.
language: python
2016-06-07 18:35:00 -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.
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:
- libmagic-dev # magic
- libgmp-dev # ghc
- libblas-dev # hmatrix
- liblapack-dev # hmatrix
2015-03-04 16:45:22 -08:00
before_install:
# 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
# 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
- stack install gtk2hs-buildtools --fast
- stack build hmatrix --resolver=$RESOLVER --fast
- 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
- stack test --no-terminal --resolver=$RESOLVER --fast
2016-06-08 00:02:40 -07:00
- |
set -e
2016-06-08 00:02:40 -07:00
if $DISPLAY; then
TOP=$(pwd)
stack build --no-terminal --resolver=$RESOLVER --fast
# Ensure that ipython-kernel examples build successfully.
stack build ipython-kernel --flag ipython-kernel:examples --fast
# Ensure that IHaskell notebook remains unchanged.
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
2017-03-15 19:58:16 -04:00
stack install --fast
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