60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
# Use new container infrastructure to enable caching
|
|
sudo: false
|
|
|
|
# Choose a lightweight base image; we provide our own build tools.
|
|
language: c
|
|
|
|
# GHC depends on GMP. You can add other dependencies here as well.
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- libgmp-dev
|
|
|
|
# The different configurations we want to test. You could also do things like
|
|
# change flags or use --stack-yaml to point to a different file.
|
|
env:
|
|
- ARGS=""
|
|
- ARGS="--resolver lts-2"
|
|
- ARGS="--resolver lts-3"
|
|
- ARGS="--resolver lts-4"
|
|
- ARGS="--resolver lts-5"
|
|
- ARGS="--resolver lts-6"
|
|
- ARGS="--resolver lts-7"
|
|
- ARGS="--resolver lts"
|
|
- ARGS="--resolver nightly"
|
|
|
|
before_install:
|
|
# Download and unpack the stack executable
|
|
- mkdir -p ~/.local/bin
|
|
- export PATH=$HOME/.local/bin:$PATH
|
|
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
|
|
|
# This line does all of the work: installs GHC if necessary, build the library,
|
|
# executables, and test suites, and runs the test suites. --no-terminal works
|
|
# around some quirks in Travis's terminal implementation.
|
|
script:
|
|
- stack $ARGS --no-terminal --install-ghc install --test --fast
|
|
- cat << EOF > test_sdist.sh
|
|
export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}');
|
|
cd $(stack path | grep dist-dir | awk '{print $2}');
|
|
if [ -f "$SRC_TGZ" ]; then
|
|
cabal install "$SRC_TGZ";
|
|
else
|
|
echo "expected '$SRC_TGZ' not found";
|
|
exit 1;
|
|
fi
|
|
EOF
|
|
|
|
- stack sdist ringo-core
|
|
- cd ringo-core;
|
|
- sh ../test_sdist.sh
|
|
- cd $(stack path | grep project-root | awk '{print $2}')
|
|
- stack sdist ringo
|
|
- cd ringo
|
|
- sh ../test_sdist.sh
|
|
|
|
# Caching so the next build will be fast too.
|
|
cache:
|
|
directories:
|
|
- $HOME/.stack
|