Merge pull request #1103 from yesodweb/travis-with-stack
Travis with stack
This commit is contained in:
commit
77c614fa86
@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
mkdir -p $HOME/.cabal
|
|
||||||
cat > $HOME/.cabal/config <<EOF
|
|
||||||
remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/
|
|
||||||
remote-repo-cache: $HOME/.cabal/packages
|
|
||||||
jobs: \$ncpus
|
|
||||||
EOF
|
|
||||||
57
.travis.yml
57
.travis.yml
@ -1,33 +1,36 @@
|
|||||||
# NB: don't set `language: haskell` here
|
# Use new container infrastructure to enable caching
|
||||||
|
sudo: false
|
||||||
|
|
||||||
# The following enables several GHC versions to be tested; often it's enough to test only against the last release in a major GHC version. Feel free to omit lines listings versions you don't need/want testing for.
|
# 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:
|
env:
|
||||||
#- CABALVER=1.20 GHCVER=7.6.3
|
- ARGS=""
|
||||||
- CABALVER=1.20 GHCVER=7.8.4
|
- ARGS="--resolver lts-2"
|
||||||
- CABALVER=1.22 GHCVER=7.10.1
|
- ARGS="--resolver lts-3"
|
||||||
- CABALVER=1.22 GHCVER=7.10.2
|
- ARGS="--resolver lts"
|
||||||
#- CABALVER=head GHCVER=head # see section about GHC HEAD snapshots
|
- ARGS="--resolver nightly"
|
||||||
|
|
||||||
# Note: the distinction between `before_install` and `install` is not important.
|
|
||||||
before_install:
|
before_install:
|
||||||
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
|
# Download and unpack the stack executable
|
||||||
- travis_retry sudo apt-get update
|
- mkdir -p ~/.local/bin
|
||||||
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER # see note about happy/alex
|
- export PATH=$HOME/.local/bin:$PATH
|
||||||
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.cabal/bin:$PATH
|
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
||||||
- export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
|
|
||||||
- ./.travis-setup.sh
|
|
||||||
|
|
||||||
|
# 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 test --haddock
|
||||||
|
|
||||||
install:
|
# Caching so the next build will be fast too.
|
||||||
- cabal --version
|
cache:
|
||||||
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
|
directories:
|
||||||
- travis_retry cabal update
|
- $HOME/.stack
|
||||||
- travis_retry curl -L http://download.fpcomplete.com/michael/cabal-meta.tar.gz > cabal-meta.tar.gz
|
|
||||||
- mkdir -p $HOME/.cabal/bin
|
|
||||||
- tar zxfv cabal-meta.tar.gz -C $HOME/.cabal/bin
|
|
||||||
- cabal install alex happy
|
|
||||||
|
|
||||||
# Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail.
|
|
||||||
script:
|
|
||||||
- cabal-meta install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls
|
|
||||||
- cabal-meta install --run-tests
|
|
||||||
|
|||||||
@ -13,3 +13,7 @@ packages:
|
|||||||
- ./yesod
|
- ./yesod
|
||||||
- ./yesod-eventsource
|
- ./yesod-eventsource
|
||||||
- ./yesod-websockets
|
- ./yesod-websockets
|
||||||
|
|
||||||
|
# Needed for LTS 2
|
||||||
|
extra-deps:
|
||||||
|
- wai-app-static-3.1.3
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user