mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-19 04:46:08 +00:00
218 lines
8.3 KiB
YAML
218 lines
8.3 KiB
YAML
matrix:
|
||
allow_failures:
|
||
- language: nix
|
||
fast_finish: true
|
||
include:
|
||
- env: DISPLAY=true USE_STACK_YAML="stack.yaml" # GHC 8.0.2
|
||
language: python
|
||
# Test against different stack LTS versions.
|
||
|
||
# Choose a lightweight base image; we provide our own build tools.
|
||
python: "3.6"
|
||
|
||
# Enable caching.
|
||
sudo: false
|
||
|
||
# Caching so the next build will be fast too.
|
||
# 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
|
||
- $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
|
||
- libcairo2-dev # cairo
|
||
- libpango1.0-dev # pango
|
||
|
||
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'
|
||
|
||
# Install zeromq3 -- the package is not supported yet on Travis whitelist... (06/06/2016)
|
||
- |
|
||
if [ ! -d "$HOME/zeromq/lib" ]; then
|
||
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
|
||
|
||
# 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
|
||
|
||
# This step takes the longest, and is what generates the Stack cache.
|
||
install:
|
||
# Set path for pkg-config to find zeromq, otherwise install of zeromq4-haskell fails.
|
||
- export PKG_CONFIG_PATH=$HOME/zeromq/lib/pkgconfig/
|
||
- |
|
||
# Used to avoid 'source and destination file are the same' error
|
||
mv $USE_STACK_YAML intermediate-stack.yaml
|
||
mv intermediate-stack.yaml stack.yaml
|
||
|
||
echo "apply-ghc-options: everything" >> stack.yaml
|
||
|
||
- stack setup
|
||
- stack install gtk2hs-buildtools --fast
|
||
- stack build hmatrix --fast
|
||
- stack build --dependencies-only --fast
|
||
|
||
script:
|
||
- export LD_LIBRARY_PATH=$HOME/zeromq/lib
|
||
- stack test --no-terminal --fast
|
||
- |
|
||
set -e
|
||
if $DISPLAY; then
|
||
TOP=$(pwd)
|
||
stack build --no-terminal --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.
|
||
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)
|
||
fi
|
||
- env: DISPLAY=true USE_STACK_YAML="stack-8.2.yaml" # GHC 8.2.1
|
||
language: python
|
||
# Test against different stack LTS versions.
|
||
|
||
# Choose a lightweight base image; we provide our own build tools.
|
||
python: "3.6"
|
||
|
||
# Enable caching.
|
||
sudo: false
|
||
|
||
# Caching so the next build will be fast too.
|
||
# 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
|
||
- $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
|
||
- libcairo2-dev # cairo
|
||
- libpango1.0-dev # pango
|
||
|
||
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'
|
||
|
||
# Install zeromq3 -- the package is not supported yet on Travis whitelist... (06/06/2016)
|
||
- |
|
||
if [ ! -d "$HOME/zeromq/lib" ]; then
|
||
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
|
||
|
||
# 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
|
||
|
||
# This step takes the longest, and is what generates the Stack cache.
|
||
install:
|
||
# Set path for pkg-config to find zeromq, otherwise install of zeromq4-haskell fails.
|
||
- export PKG_CONFIG_PATH=$HOME/zeromq/lib/pkgconfig/
|
||
- |
|
||
# Used to avoid 'source and destination file are the same' error
|
||
mv $USE_STACK_YAML intermediate-stack.yaml
|
||
mv intermediate-stack.yaml stack.yaml
|
||
|
||
echo "apply-ghc-options: everything" >> stack.yaml
|
||
|
||
- stack setup
|
||
- stack install gtk2hs-buildtools --fast
|
||
- stack build hmatrix --fast
|
||
- stack build --dependencies-only --fast
|
||
|
||
script:
|
||
- export LD_LIBRARY_PATH=$HOME/zeromq/lib
|
||
- stack test --no-terminal --fast
|
||
- |
|
||
set -e
|
||
if $DISPLAY; then
|
||
TOP=$(pwd)
|
||
stack build --no-terminal --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.
|
||
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)
|
||
fi
|
||
- language: nix
|
||
env: RELEASE_NIX="release.nix"
|
||
cache:
|
||
directories:
|
||
- /nix/store
|
||
install:
|
||
- export NIX_CONF_DIR=~
|
||
- echo "binary-caches = http://128.199.234.106:3000" >> $NIX_CONF_DIR/nix.conf
|
||
- echo "binary-cache-public-keys = 128.199.234.106:jzUyrIQHov5i6f94jQVriqPDLuPYlZPAsga3W3k+L8E=" >> $NIX_CONF_DIR/nix.conf
|
||
script: nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/a0b50eab599005127476e7b3b4ae8bd2d363091b.tar.gz $RELEASE_NIX
|
||
- language: nix
|
||
env: RELEASE_NIX="release-8.2.nix"
|
||
cache:
|
||
directories:
|
||
- /nix/store
|
||
install:
|
||
- export NIX_CONF_DIR=~
|
||
- echo "binary-caches = http://128.199.234.106:3000" >> $NIX_CONF_DIR/nix.conf
|
||
- echo "binary-cache-public-keys = 128.199.234.106:jzUyrIQHov5i6f94jQVriqPDLuPYlZPAsga3W3k+L8E=" >> $NIX_CONF_DIR/nix.conf
|
||
script: nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/a0b50eab599005127476e7b3b4ae8bd2d363091b.tar.gz $RELEASE_NIX
|